acts-project / algebra-plugins

Mozilla Public License 2.0
3 stars 10 forks source link

CMake Export Fix, main branch (2023.03.24.) #96

Closed krasznaa closed 1 year ago

krasznaa commented 1 year ago

Moved the use of "magic variables" before the first use of find_dependency to fix #36. (This of course also very much relates to https://github.com/acts-project/traccc/pull/364.)

The way that the variables provided by configure_package_config_file(...) work is that a "PACKAGE_PREFIX_DIR" variable is created behind the scenes, and all other variables are declared relative to this "hidden" variable.

The problem is that if a package "found" by find_dependency(...) uses the same CMake mechanism in its own exported CMake configuration (like Vc does for instance), then this "hidden" PACKAGE_PREFIX_DIR variable gets re-defined after the find_dependency(...) calls. And all of a sudden the rest of the lines that try to set paths using the mechanism provided by configure_package_config_file(...) become broken in a fairly confusing way.

This is something that will need to be fixed in the rest of our projects as well, Algebra Plugins is just the first in line to be fixed...