summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-01-28 16:02:34 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-01-28 16:02:41 (GMT)
commit1d08099be7fcd1030470dfa248cac387e64e7d10 (patch)
treed4e9dd01b4eecaf701fc7d0b0a768bf495043e7a
parent193352e420f8a21300d80ca115da2858a7f27ae6 (diff)
parente0e87b9d701a3eb20462c61d398f73a591750e1f (diff)
downloadCMake-1d08099be7fcd1030470dfa248cac387e64e7d10.zip
CMake-1d08099be7fcd1030470dfa248cac387e64e7d10.tar.gz
CMake-1d08099be7fcd1030470dfa248cac387e64e7d10.tar.bz2
Merge topic 'FindBoost-delay-helper-targets'
e0e87b9d70 FindBoost: Do not add any Boost targets until after Boost found Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Alexander Grund <github@grundis.de> Merge-request: !4280
-rw-r--r--Modules/FindBoost.cmake74
1 files changed, 37 insertions, 37 deletions
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index deac9ef..3c52466 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -1470,43 +1470,6 @@ _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}"
_Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "Boost_ADDITIONAL_VERSIONS")
_Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "Boost_NO_SYSTEM_PATHS")
-# Supply Boost_LIB_DIAGNOSTIC_DEFINITIONS as a convenience target. It
-# will only contain any interface definitions on WIN32, but is created
-# on all platforms to keep end user code free from platform dependent
-# code. Also provide convenience targets to disable autolinking and
-# enable dynamic linking.
-if(NOT TARGET Boost::diagnostic_definitions)
- add_library(Boost::diagnostic_definitions INTERFACE IMPORTED)
- add_library(Boost::disable_autolinking INTERFACE IMPORTED)
- add_library(Boost::dynamic_linking INTERFACE IMPORTED)
- set_target_properties(Boost::dynamic_linking PROPERTIES
- INTERFACE_COMPILE_DEFINITIONS "BOOST_ALL_DYN_LINK")
-endif()
-if(WIN32)
- # In windows, automatic linking is performed, so you do not have
- # to specify the libraries. If you are linking to a dynamic
- # runtime, then you can choose to link to either a static or a
- # dynamic Boost library, the default is to do a static link. You
- # can alter this for a specific library "whatever" by defining
- # BOOST_WHATEVER_DYN_LINK to force Boost library "whatever" to be
- # linked dynamically. Alternatively you can force all Boost
- # libraries to dynamic link by defining BOOST_ALL_DYN_LINK.
-
- # This feature can be disabled for Boost library "whatever" by
- # defining BOOST_WHATEVER_NO_LIB, or for all of Boost by defining
- # BOOST_ALL_NO_LIB.
-
- # If you want to observe which libraries are being linked against
- # then defining BOOST_LIB_DIAGNOSTIC will cause the auto-linking
- # code to emit a #pragma message each time a library is selected
- # for linking.
- set(Boost_LIB_DIAGNOSTIC_DEFINITIONS "-DBOOST_LIB_DIAGNOSTIC")
- set_target_properties(Boost::diagnostic_definitions PROPERTIES
- INTERFACE_COMPILE_DEFINITIONS "BOOST_LIB_DIAGNOSTIC")
- set_target_properties(Boost::disable_autolinking PROPERTIES
- INTERFACE_COMPILE_DEFINITIONS "BOOST_ALL_NO_LIB")
-endif()
-
cmake_policy(GET CMP0074 _Boost_CMP0074)
if(NOT "x${_Boost_CMP0074}x" STREQUAL "xNEWx")
_Boost_CHECK_SPELLING(Boost_ROOT)
@@ -2299,6 +2262,43 @@ if(Boost_FOUND)
endif()
endif()
endforeach()
+
+ # Supply Boost_LIB_DIAGNOSTIC_DEFINITIONS as a convenience target. It
+ # will only contain any interface definitions on WIN32, but is created
+ # on all platforms to keep end user code free from platform dependent
+ # code. Also provide convenience targets to disable autolinking and
+ # enable dynamic linking.
+ if(NOT TARGET Boost::diagnostic_definitions)
+ add_library(Boost::diagnostic_definitions INTERFACE IMPORTED)
+ add_library(Boost::disable_autolinking INTERFACE IMPORTED)
+ add_library(Boost::dynamic_linking INTERFACE IMPORTED)
+ set_target_properties(Boost::dynamic_linking PROPERTIES
+ INTERFACE_COMPILE_DEFINITIONS "BOOST_ALL_DYN_LINK")
+ endif()
+ if(WIN32)
+ # In windows, automatic linking is performed, so you do not have
+ # to specify the libraries. If you are linking to a dynamic
+ # runtime, then you can choose to link to either a static or a
+ # dynamic Boost library, the default is to do a static link. You
+ # can alter this for a specific library "whatever" by defining
+ # BOOST_WHATEVER_DYN_LINK to force Boost library "whatever" to be
+ # linked dynamically. Alternatively you can force all Boost
+ # libraries to dynamic link by defining BOOST_ALL_DYN_LINK.
+
+ # This feature can be disabled for Boost library "whatever" by
+ # defining BOOST_WHATEVER_NO_LIB, or for all of Boost by defining
+ # BOOST_ALL_NO_LIB.
+
+ # If you want to observe which libraries are being linked against
+ # then defining BOOST_LIB_DIAGNOSTIC will cause the auto-linking
+ # code to emit a #pragma message each time a library is selected
+ # for linking.
+ set(Boost_LIB_DIAGNOSTIC_DEFINITIONS "-DBOOST_LIB_DIAGNOSTIC")
+ set_target_properties(Boost::diagnostic_definitions PROPERTIES
+ INTERFACE_COMPILE_DEFINITIONS "BOOST_LIB_DIAGNOSTIC")
+ set_target_properties(Boost::disable_autolinking PROPERTIES
+ INTERFACE_COMPILE_DEFINITIONS "BOOST_ALL_NO_LIB")
+ endif()
endif()
# ------------------------------------------------------------------------