Since CMake 3.24, CMake automatically searches targets/deps in the install path (CMAKE_INSTALL_PREFIX).
https://cmake.org/cmake/help/latest/variable/CMAKE_FIND_USE_INSTALL_PREFIX.html
This raises errors with find_or_fetched libs such as gtest, tight_inclusion, cxxopts...
If you compiles and install after building, then the next cmake generation will find those in the CMAKE_INSTALL_PREFIX directory, not in the one fetched.
The solution is: CMAKE_FIND_USE_INSTALL_PREFIX=OFF + cleared stale *_DIR hints, so deps fetch cleanly rather than resolving to your prior install.
Since CMake 3.24, CMake automatically searches targets/deps in the install path (
CMAKE_INSTALL_PREFIX).https://cmake.org/cmake/help/latest/variable/CMAKE_FIND_USE_INSTALL_PREFIX.html
This raises errors with find_or_fetched libs such as gtest, tight_inclusion, cxxopts...
If you compiles and install after building, then the next cmake generation will find those in the CMAKE_INSTALL_PREFIX directory, not in the one fetched.
The solution is:
CMAKE_FIND_USE_INSTALL_PREFIX=OFF+ cleared stale *_DIR hints, so deps fetch cleanly rather than resolving to your prior install.