Other superbuild projects won't find superbuild Boost if a system CMake'ified Boost is available
If a CMake'ified boost (providing a BoostConfig.cmake
) is available in CMake search paths (which is the default of Ubuntu 20.04), it will always be the one found, even if BOOST_ROOT
and/or Boost_NO_SYSTEM_PATHS
/ is set.
It breaks all previous CMake project (or superbuild) that rely on setting BOOST_ROOT
to find their predefined Boost libs.
People need to manually add Boost_No_CMake_Boost=1
to keep the previous behavior.
I'm not sure if this should be "fixed" in CMake itself (in FindBoost.cmake
), but at least this common-superbuild should enforce its own built Boost to be found by setting Boost_NO_BOOST_CMAKE=1
when appropriate.
IMO, on CMake side, FindBoost.cmake
should honor Boost_NO_SYSTEM_PATHS
and not find a CMake'ified boost (providing a BoostConfig.cmake) from the system if Boost_NO_SYSTEM_PATHS=1