From cbb71a4776213f55fbc1d00fb68312b3602c387c Mon Sep 17 00:00:00 2001 From: Ali Maredia Date: Thu, 31 Dec 2015 00:53:12 -0500 Subject: [PATCH] cmake: Boost libraries cleanup Added components to Boost find_package, changed libraries from boost_foo to ${Boost_FOO_LIBRARY} Signed-off-by: Ali Maredia --- CMakeLists.txt | 2 +- src/CMakeLists.txt | 6 +++--- src/test/CMakeLists.txt | 26 +++++++++++++------------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 27de8806ee5ae..1fcfe80eb0788 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -278,7 +278,7 @@ else(${ENABLE_SHARED}) endif(${ENABLE_SHARED}) set(Boost_USE_MULTITHREADED ON) -find_package(Boost COMPONENTS thread system regex random REQUIRED) +find_package(Boost COMPONENTS thread system regex random program_options date_time REQUIRED) include_directories(${Boost_INCLUDE_DIRS}) find_package(Threads REQUIRED) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3337c7e89ae0a..79b70c1308cb1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -582,7 +582,7 @@ set(ceph_mon_srcs common/TextTable.cc) add_executable(ceph-mon ${ceph_mon_srcs} $) add_dependencies(ceph-mon erasure_code_plugins) -target_link_libraries(ceph-mon mon boost_thread common os global ${EXTRALIBS} + target_link_libraries(ceph-mon mon ${Boost_THREAD_LIBRARY} common os global ${EXTRALIBS} ${CMAKE_DL_LIBS} ${ALLOC_LIBS}) install(TARGETS ceph-mon DESTINATION bin) @@ -744,7 +744,7 @@ if(${WITH_MDS}) $ $) target_link_libraries(ceph-mds mds osdc ${CMAKE_DL_LIBS} global - ${ALLOC_LIBS} boost_thread) + ${ALLOC_LIBS} ${Boost_THREAD_LIBRARY}) install(TARGETS ceph-mds DESTINATION bin) endif(${WITH_MDS}) @@ -1018,7 +1018,7 @@ if(${WITH_RBD}) $) set_target_properties(rbd PROPERTIES OUTPUT_NAME rbd) target_link_libraries(rbd librbd librados global common keyutils udev - boost_regex boost_program_options + ${Boost_REGEX_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS}) install(TARGETS rbd DESTINATION bin) install(PROGRAMS ${CMAKE_SOURCE_DIR}/src/ceph-rbdnamer DESTINATION bin) diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index c872d5204db20..b129e2c5d39c6 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -114,7 +114,7 @@ add_executable(smalliobench ${smalliobench_srcs} $ ) -target_link_libraries(smalliobench librados boost_program_options global +target_link_libraries(smalliobench librados ${Boost_PROGRAM_OPTIONS_LIBRARY} global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS}) # smalliobenchfs @@ -128,7 +128,7 @@ add_executable(smalliobenchfs ${smalliobenchfs_srcs} $ ) -target_link_libraries(smalliobenchfs librados boost_program_options os global +target_link_libraries(smalliobenchfs librados ${Boost_PROGRAM_OPTIONS_LIBRARY} os global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS}) # smalliobenchdumb @@ -142,7 +142,7 @@ add_executable(smalliobenchdumb ${smalliobenchdumb_srcs} $ ) -target_link_libraries(smalliobenchdumb librados boost_program_options os global +target_link_libraries(smalliobenchdumb librados ${Boost_PROGRAM_OPTIONS_LIBRARY} os global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS}) # smalliobenchrbd @@ -164,7 +164,7 @@ if (${WITH_RBD}) librados os global - boost_program_options + ${Boost_PROGRAM_OPTIONS_LIBRARY} blkid udev ${BLKID_LIBRARIES} @@ -182,7 +182,7 @@ add_executable(tpbench ${tpbench_srcs} $ ) -target_link_libraries(tpbench librados boost_program_options os global +target_link_libraries(tpbench librados ${Boost_PROGRAM_OPTIONS_LIBRARY} os global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS}) # omapbench @@ -195,7 +195,7 @@ add_executable(omapbench ) target_link_libraries(omapbench librados - boost_program_options + ${Boost_PROGRAM_OPTIONS_LIBRARY} os global ${BLKID_LIBRARIES} @@ -414,7 +414,7 @@ add_executable(unittest_encoding EXCLUDE_FROM_ALL ) add_test(unittest_encoding unittest_encoding) add_dependencies(check unittest_encoding) -#target_link_libraries(unittest_encoding librados global boost_filesystem +#target_link_libraries(unittest_encoding librados global ${Boost_FILESYSTEM_LIBRARY} target_link_libraries(unittest_encoding cephfs librados pthread rt m ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_encoding PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}) @@ -1539,7 +1539,7 @@ if(${WITH_RADOSGW}) cls_rgw_client cls_user_client cls_lock_client - boost_regex + ${Boost_REGEX_LIBRARY} ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS} ${UNITTEST_LIBS} ${CRYPTO_LIBS}) set_target_properties(test_cls_rgw_meta PROPERTIES COMPILE_FLAGS @@ -1566,7 +1566,7 @@ if(${WITH_RADOSGW}) cls_rgw_client cls_user_client cls_lock_client - boost_regex + ${Boost_REGEX_LIBRARY} ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS} @@ -2241,7 +2241,7 @@ add_executable(simple_server $ ) target_link_libraries(simple_server - os global common boost_regex + os global common ${Boost_REGEX_LIBRARY} ${EXTRALIBS} ${ALLOC_LIBS} ${CMAKE_DL_LIBS} @@ -2253,7 +2253,7 @@ add_executable(simple_client $ ) target_link_libraries(simple_client - os global common boost_regex + os global common ${Boost_REGEX_LIBRARY} ${EXTRALIBS} ${ALLOC_LIBS} ${CMAKE_DL_LIBS} @@ -2266,7 +2266,7 @@ if(HAVE_XIO) $ ) target_link_libraries(xio_server - os global common boost_regex + os global common ${Boost_REGEX_LIBRARY} ${Xio_LIBRARY} ibverbs rdmacm pthread rt ${EXTRALIBS} ${ALLOC_LIBS} @@ -2279,7 +2279,7 @@ if(HAVE_XIO) $ ) target_link_libraries(xio_client - os global common boost_regex + os global common ${Boost_REGEX_LIBRARY} ${Xio_LIBRARY} ibverbs rdmacm pthread rt ${EXTRALIBS} ${ALLOC_LIBS} -- 2.39.5