]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: rename the boost header target to Boost::boost
authorKefu Chai <kchai@redhat.com>
Sun, 18 Mar 2018 08:08:34 +0000 (16:08 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 13 Apr 2018 04:19:36 +0000 (12:19 +0800)
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>
cmake/modules/BuildBoost.cmake

index 12105575cb2fa68a52caccf23e606e65611e1088..63320b712cacefb2c8f038f046834cd46cfd68c6 100644 (file)
@@ -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()