diff options
author | Brad King <brad.king@kitware.com> | 2020-10-26 14:27:17 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-10-26 14:27:25 (GMT) |
commit | 9a01da2cfba65d15a3739f19e0506966651118ed (patch) | |
tree | 1dacc18a8720961975161cbee3539f0effdded33 /Modules | |
parent | 67a38655871a77d6c19d769bb0e31abb879aaf28 (diff) | |
parent | 4b2a61946fdb77ab37b66b1d2b81d2d77453ca5d (diff) | |
download | CMake-9a01da2cfba65d15a3739f19e0506966651118ed.zip CMake-9a01da2cfba65d15a3739f19e0506966651118ed.tar.gz CMake-9a01da2cfba65d15a3739f19e0506966651118ed.tar.bz2 |
Merge topic 'FindBoost-config-mode'
4b2a61946f FindBoost: Honor BOOST_ROOT when finding upstream BoostConfig
b32cb33275 FindBoost: Honor Boost_NO_SYSTEM_PATHS when finding upstream BoostConfig
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5408
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindBoost.cmake | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index 6154dd6..77868f4 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -442,10 +442,21 @@ if (NOT Boost_NO_BOOST_CMAKE) endif() endif() + set(_boost_FIND_PACKAGE_ARGS "") + if(Boost_NO_SYSTEM_PATHS) + list(APPEND _boost_FIND_PACKAGE_ARGS NO_CMAKE_SYSTEM_PATH NO_SYSTEM_ENVIRONMENT_PATH) + endif() + # Do the same find_package call but look specifically for the CMake version. # Note that args are passed in the Boost_FIND_xxxxx variables, so there is no # need to delegate them to this find_package call. - find_package(Boost QUIET NO_MODULE) + cmake_policy(PUSH) + if(BOOST_ROOT AND NOT Boost_ROOT) + cmake_policy(SET CMP0074 NEW) + set(Boost_ROOT "${BOOST_ROOT}") + endif() + find_package(Boost QUIET NO_MODULE ${_boost_FIND_PACKAGE_ARGS}) + cmake_policy(POP) if (DEFINED Boost_DIR) mark_as_advanced(Boost_DIR) endif () |