diff options
author | Brad King <brad.king@kitware.com> | 2017-05-28 13:11:58 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-05-28 13:12:04 (GMT) |
commit | f9ea6247c10fa0b39977f9b75d266e7282b19a1b (patch) | |
tree | e12b7476e3b146bbf217f8fb4067048c1ea50878 /Modules | |
parent | 5a0fa11fec8f9cf4ad53defdb4b389aab77ccb2f (diff) | |
parent | cc329a01258ecc7f4debbae94baf067136617c65 (diff) | |
download | CMake-f9ea6247c10fa0b39977f9b75d266e7282b19a1b.zip CMake-f9ea6247c10fa0b39977f9b75d266e7282b19a1b.tar.gz CMake-f9ea6247c10fa0b39977f9b75d266e7282b19a1b.tar.bz2 |
Merge topic 'FindBoost-use-IN_LIST'
cc329a01 FindBoost: Simplify search in lists.
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !750
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindBoost.cmake | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index b2fb4b7..cc273e0 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -208,6 +208,10 @@ # # Set Boost_NO_BOOST_CMAKE to ON to disable the search for boost-cmake. +# Save project's policies +cmake_policy(PUSH) +cmake_policy(SET CMP0057 NEW) # if IN_LIST + #------------------------------------------------------------------------------- # Before we go searching, check whether boost-cmake is available, unless the # user specifically asked NOT to search for boost-cmake. @@ -865,14 +869,12 @@ function(_Boost_MISSING_DEPENDENCIES componentvar extravar) list(APPEND _boost_processed_components ${_boost_unprocessed_components}) foreach(component ${_boost_unprocessed_components}) string(TOUPPER ${component} uppercomponent) - set(${_ret} ${_Boost_${uppercomponent}_DEPENDENCIES} PARENT_SCOPE) + set(${_ret} ${_Boost_${uppercomponent}_DEPENDENCIES} PARENT_SCOPE) _Boost_COMPONENT_DEPENDENCIES("${component}" _Boost_${uppercomponent}_DEPENDENCIES) set(_Boost_${uppercomponent}_DEPENDENCIES ${_Boost_${uppercomponent}_DEPENDENCIES} PARENT_SCOPE) set(_Boost_IMPORTED_TARGETS ${_Boost_IMPORTED_TARGETS} PARENT_SCOPE) foreach(componentdep ${_Boost_${uppercomponent}_DEPENDENCIES}) - list(FIND _boost_processed_components "${componentdep}" _boost_component_found) - list(FIND _boost_new_components "${componentdep}" _boost_component_new) - if (_boost_component_found EQUAL -1 AND _boost_component_new EQUAL -1) + if (NOT ("${componentdep}" IN_LIST _boost_processed_components OR "${componentdep}" IN_LIST _boost_new_components)) list(APPEND _boost_new_components ${componentdep}) endif() endforeach() @@ -1499,8 +1501,7 @@ endif() _Boost_MISSING_DEPENDENCIES(Boost_FIND_COMPONENTS _Boost_EXTRA_FIND_COMPONENTS) # If thread is required, get the thread libs as a dependency -list(FIND Boost_FIND_COMPONENTS thread _Boost_THREAD_DEPENDENCY_LIBS) -if(NOT _Boost_THREAD_DEPENDENCY_LIBS EQUAL -1) +if("thread" IN_LIST Boost_FIND_COMPONENTS) include(CMakeFindDependencyMacro) find_dependency(Threads) endif() @@ -1925,3 +1926,6 @@ list(REMOVE_DUPLICATES _Boost_COMPONENTS_SEARCHED) list(SORT _Boost_COMPONENTS_SEARCHED) set(_Boost_COMPONENTS_SEARCHED "${_Boost_COMPONENTS_SEARCHED}" CACHE INTERNAL "Components requested for this build tree.") + +# Restore project's policies +cmake_policy(POP) |