Closed psalvaggio closed 1 week ago
I typically set the minimum required for a specific script file so it might be easier ported between various project. However, in this case it seems that the script could benefit from the higher version of CMake.
I see. Yeah, so on the documentation page: https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html
It says that cmake_minimum_required
should be called at the beginning of the top-level CMakeLists.txt so that policy settings are established first.
Due to the side effect here: https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html#policy-settings, calling it multiple times can lead to changing of the policy settings throughout your project, as we are seeing here. find_package
has a couple important ones that have changed in the 3.x series surrounding these _ROOT
variables for explicitly specifying where your dependencies live.
In the top-level CMakeLists.txt, the version required is 3.23. In test/runtime/CMakeLists.txt, it is 3.5. This results in CMP0074 not being set in the test directory. As a result, specifying dependency locations via
_ROOT
cache variables doesn't work for Catch2 and wg21_linear_algebra, while it does work for the other dependencies. Was there a reason there is a different version set in the test file?