diff options
author | Kefu Chai <kchai@redhat.com> | 2018-03-18 09:08:34 +0100 |
---|---|---|
committer | Kefu Chai <kchai@redhat.com> | 2018-04-13 06:19:36 +0200 |
commit | a15d3d39a7e6fd6454349e1716b21be9336873f0 (patch) | |
tree | 0c1f28bbc9d316e20d55617237e90a9b65b19dc8 /cmake/modules/BuildBoost.cmake | |
parent | Merge PR #21181 into master (diff) | |
download | ceph-a15d3d39a7e6fd6454349e1716b21be9336873f0.tar.xz ceph-a15d3d39a7e6fd6454349e1716b21be9336873f0.zip |
cmake: rename the boost header target to Boost::boost
because FindBoost.cmake defines Boost::boost as the target for header
only dependencies.
due to the limit of cmake < 3.1, this only applies to cmake > 3.1
Signed-off-by: Kefu Chai <kchai@redhat.com>
Diffstat (limited to 'cmake/modules/BuildBoost.cmake')
-rw-r--r-- | cmake/modules/BuildBoost.cmake | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/cmake/modules/BuildBoost.cmake b/cmake/modules/BuildBoost.cmake index 12105575cb2..63320b712ca 100644 --- a/cmake/modules/BuildBoost.cmake +++ b/cmake/modules/BuildBoost.cmake @@ -237,10 +237,10 @@ macro(build_boost version) # INTERFACE library is not allowed until cmake 3.1 add_custom_target(Boost.boost DEPENDS Boost) else() - add_library(Boost.boost INTERFACE IMPORTED) - set_target_properties(Boost.boost PROPERTIES + add_library(Boost::boost INTERFACE IMPORTED) + set_target_properties(Boost::boost PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}") - add_dependencies(Boost.boost Boost) + add_dependencies(Boost::boost Boost) endif() find_package_handle_standard_args(Boost DEFAULT_MSG Boost_INCLUDE_DIRS Boost_LIBRARIES) @@ -257,7 +257,11 @@ function(maybe_add_boost_dep target) get_filename_component(ext ${src} EXT) # assuming all cxx source files include boost header(s) if(ext MATCHES ".cc|.cpp|.cxx") - add_dependencies(${target} Boost.boost) + if(CMAKE_VERSION VERSION_LESS 3.3) + add_dependencies(${target} Boost.boost) + else() + add_dependencies(${target} Boost::boost) + endif() return() endif() endforeach() |