summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-10-22 14:36:20 (GMT)
committerBrad King <brad.king@kitware.com>2020-10-22 14:42:33 (GMT)
commit4b2a61946fdb77ab37b66b1d2b81d2d77453ca5d (patch)
treee54fb02ab8ae3a27ce2ba7b6bc8fb6cf54b49a01 /Modules
parentb32cb33275ecafe7465d30a46ce63a7fc25904f8 (diff)
downloadCMake-4b2a61946fdb77ab37b66b1d2b81d2d77453ca5d.zip
CMake-4b2a61946fdb77ab37b66b1d2b81d2d77453ca5d.tar.gz
CMake-4b2a61946fdb77ab37b66b1d2b81d2d77453ca5d.tar.bz2
FindBoost: Honor BOOST_ROOT when finding upstream BoostConfig
Fixes: #21200
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindBoost.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index f27666d..77868f4 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -450,7 +450,13 @@ if (NOT Boost_NO_BOOST_CMAKE)
# 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.
+ 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 ()