summaryrefslogtreecommitdiff
path: root/Modules/FindBoost.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-09-04 13:43:07 +0000
committerKitware Robot <kwrobot@kitware.com>2019-09-04 09:43:18 -0400
commit790db8d477cfaf10b227d6d7a7ca2c0d7d8aaf62 (patch)
tree2067a8e9c6e9525c1b3ee635e882ec110cd54d72 /Modules/FindBoost.cmake
parent09032f09f8d2b4f7af658060ef434083f9d6a0d4 (diff)
parent907d3ed824d8b82525c687747662b358accded9c (diff)
downloadcmake-790db8d477cfaf10b227d6d7a7ca2c0d7d8aaf62.tar.gz
Merge topic 'FindBoost-1.71'
907d3ed824 FindBoost: Tolerate future Boost INTERFACE libraries 2d357b7a68 FindBoost: Clarify role of legacy variables in warning message Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3780
Diffstat (limited to 'Modules/FindBoost.cmake')
-rw-r--r--Modules/FindBoost.cmake24
1 files changed, 15 insertions, 9 deletions
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index 49243836fa..744d2c7895 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -345,7 +345,7 @@ function(_boost_set_legacy_variables_from_config)
_boost_get_existing_target(${comp} target)
if(NOT target)
if(Boost_DEBUG OR Boost_VERBOSE)
- message(WARNING "Could not find imported target for required component '${comp}'. Standard variables for this component might be missing. Refer to the documentation of your Boost installation for help on variables to use.")
+ message(WARNING "Could not find imported target for required component '${comp}'. Legacy variables for this component might be missing. Refer to the documentation of your Boost installation for help on variables to use.")
endif()
continue()
endif()
@@ -353,14 +353,20 @@ function(_boost_set_legacy_variables_from_config)
_boost_set_if_unset(Boost_${uppercomp}_LIBRARY "${target}")
_boost_set_if_unset(Boost_${uppercomp}_LIBRARIES "${target}") # Very old legacy variable
list(APPEND libraries "${target}")
- foreach(cfg RELEASE DEBUG)
- get_target_property(lib ${target} IMPORTED_LOCATION_${cfg})
- if(lib)
- get_filename_component(lib_dir "${lib}" DIRECTORY)
- list(APPEND library_dirs ${lib_dir})
- _boost_set_cache_if_unset(Boost_${uppercomp}_LIBRARY_${cfg} "${lib}")
- endif()
- endforeach()
+ get_property(type TARGET "${target}" PROPERTY TYPE)
+ if(NOT type STREQUAL "INTERFACE_LIBRARY")
+ foreach(cfg RELEASE DEBUG)
+ get_target_property(lib ${target} IMPORTED_LOCATION_${cfg})
+ if(lib)
+ get_filename_component(lib_dir "${lib}" DIRECTORY)
+ list(APPEND library_dirs ${lib_dir})
+ _boost_set_cache_if_unset(Boost_${uppercomp}_LIBRARY_${cfg} "${lib}")
+ endif()
+ endforeach()
+ elseif(Boost_DEBUG OR Boost_VERBOSE)
+ # For projects using only the Boost::* targets this warning can be safely ignored.
+ message(WARNING "Imported target '${target}' for required component '${comp}' has no artifact. Legacy variables for this component might be missing. Refer to the documentation of your Boost installation for help on variables to use.")
+ endif()
_boost_get_canonical_target_name("${comp}" canonical_target)
if(NOT TARGET "${canonical_target}")
add_library("${canonical_target}" INTERFACE IMPORTED)