From: Kefu Chai Date: Sun, 18 Mar 2018 08:08:34 +0000 (+0800) Subject: cmake: rename the boost header target to Boost::boost X-Git-Tag: v13.1.0~262^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=a15d3d39a7e6fd6454349e1716b21be9336873f0;p=ceph.git 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 --- diff --git a/cmake/modules/BuildBoost.cmake b/cmake/modules/BuildBoost.cmake index 12105575cb2fa..63320b712cace 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()