]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cmake: include boost before default system directory
authorKefu Chai <kchai@redhat.com>
Sun, 16 Apr 2017 05:04:16 +0000 (13:04 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 14 Jun 2017 15:53:50 +0000 (23:53 +0800)
so ceph will prefer the local boost installation to the one in system if
any.

Signed-off-by: Kefu Chai <kchai@redhat.com>
CMakeLists.txt

index cc299cfaf7dbfa1c3f7750887c5d3950188b6812..e6863bee0ea54f46a30dc618f2534cb877b803b8 100644 (file)
@@ -23,9 +23,12 @@ if(POLICY CMP0065)
   cmake_policy(SET CMP0065 NEW)
 endif()
 if(POLICY CMP0051)
-  # cmake 3.1 and higher include generator expressions in SOURCES property,
-  # but i don't want to bother with stripping off the TARGET_OBJECTS elements
-  # from it. so let's stick with the old behavior now.
+  # cmake 3.1 and higher include generator expressions in SOURCES property.
+  # in BuildBoost.cmake, get_target_property(<var> <target> SOURCES) is used
+  # to retrieve the source files of a target. in that case, we are only
+  # interested in the *source* files. and i don't want to bother stripping off
+  # the TARGET_OBJECTS elements from the returned SOURCES. so let's stick with
+  # the old behavior now.
   cmake_policy(SET CMP0051 OLD)
 endif()
 list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules/")
@@ -555,10 +558,10 @@ else()
   include(BuildBoost)
   build_boost(1.63
     COMPONENTS ${BOOST_COMPONENTS} ${BOOST_HEADER_COMPONENTS})
+  include_directories(BEFORE SYSTEM ${Boost_INCLUDE_DIRS})
 endif()
 set(Boost_USE_MULTITHREADED ON)
 
-include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
 include_directories(SYSTEM ${PROJECT_BINARY_DIR}/include)
 
 find_package(Threads REQUIRED)