From: Bassam Tabbara Date: Tue, 22 Nov 2016 19:53:34 +0000 (-0800) Subject: cmake: fix boost build on ubuntu yakkety X-Git-Tag: v11.1.0~204^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3eef10b977294f6d2d16f3fb6e61a99a35cbc6df;p=ceph.git cmake: fix boost build on ubuntu yakkety If the host system has boost version 1.61 or higher (as in the case for ubuntu 16.10 yakkety) the ceph build is currently broken. it will pickup the system boost libraries but use the headers from the submodule. This commit ensure that when WITH_SYSTEM_BOOST is OFF we always use the boost libraries and headers built from the submodule. Signed-off-by: Bassam Tabbara --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 12f3c5d383ed..69a6a371701b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -449,6 +449,9 @@ else() include_directories(BEFORE ${BOOST_PREFIX}/include) # fixup for CheckIncludeFileCXX set(HAVE_BOOST_ASIO_COROUTINE ON) + + set(BOOST_ROOT ${BOOST_PREFIX}) + set(Boost_NO_SYSTEM_PATHS ON) endif() set(Boost_USE_MULTITHREADED ON) @@ -460,7 +463,7 @@ if(WITH_MGR) endif() # require minimally the bundled version -find_package(Boost 1.61 COMPONENTS thread system regex random program_options date_time iostreams REQUIRED) +find_package(Boost 1.61 COMPONENTS ${BOOST_COMPONENTS} REQUIRED) include_directories(SYSTEM ${Boost_INCLUDE_DIRS}) include_directories(SYSTEM ${PROJECT_BINARY_DIR}/include)