From c27ccf69390e59a4b70f357914d5af204fd5ea58 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sun, 16 Apr 2017 13:02:55 +0800 Subject: [PATCH] cmake: use boost target instead of libary path while linking against them Signed-off-by: Kefu Chai --- src/CMakeLists.txt | 18 +++++++++--------- src/rbd_replay/CMakeLists.txt | 2 +- src/rgw/CMakeLists.txt | 4 ++-- src/test/CMakeLists.txt | 6 +++--- src/test/bench/CMakeLists.txt | 10 +++++----- src/test/erasure-code/CMakeLists.txt | 6 +++--- src/test/librados/CMakeLists.txt | 2 +- src/tools/CMakeLists.txt | 6 +++--- 8 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8a68c0b4d6ca5..b19d00d779de0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -607,13 +607,13 @@ set(ceph_common_objs $) set(ceph_common_deps json_spirit erasure_code rt ${LIB_RESOLV} - ${Boost_THREAD_LIBRARY} - ${Boost_SYSTEM_LIBRARY} - ${Boost_REGEX_LIBRARY} - ${Boost_RANDOM_LIBRARY} - ${Boost_PROGRAM_OPTIONS_LIBRARY} - ${Boost_DATE_TIME_LIBRARY} - ${Boost_IOSTREAMS_LIBRARY} + Boost::thread + Boost::system + Boost::regex + Boost::random + Boost::program_options + Boost::date_time + Boost::iostreams ${BLKID_LIBRARIES} ${Backtrace_LIBRARIES} ${BLKIN_LIBRARIES} @@ -689,7 +689,7 @@ if (WITH_MGR) $) target_include_directories(ceph-mgr PRIVATE "${PYTHON_INCLUDE_DIRS}") target_link_libraries(ceph-mgr osdc client global-static common - ${Boost_PYTHON_LIBRARY} ${PYTHON_LIBRARIES} ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS}) + Boost::python ${PYTHON_LIBRARIES} ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS}) install(TARGETS ceph-mgr DESTINATION bin) endif (WITH_MGR) @@ -873,7 +873,7 @@ set(ceph_mds_srcs add_executable(ceph-mds ${ceph_mds_srcs} $) target_link_libraries(ceph-mds mds ${CMAKE_DL_LIBS} global-static common - ${Boost_THREAD_LIBRARY}) + Boost::thread) install(TARGETS ceph-mds DESTINATION bin) add_subdirectory(erasure-code) diff --git a/src/rbd_replay/CMakeLists.txt b/src/rbd_replay/CMakeLists.txt index a842960a62f2b..100a3ab861b3a 100644 --- a/src/rbd_replay/CMakeLists.txt +++ b/src/rbd_replay/CMakeLists.txt @@ -36,7 +36,7 @@ if(${WITH_BABELTRACE}) global babeltrace babeltrace-ctf - ${Boost_DATE_TIME_LIBRARY} + Boost::date_time ) install(TARGETS rbd-replay-prep DESTINATION bin) endif(${WITH_BABELTRACE}) diff --git a/src/rgw/CMakeLists.txt b/src/rgw/CMakeLists.txt index 2a22e3f1a03d0..c6fa7c0bac886 100644 --- a/src/rgw/CMakeLists.txt +++ b/src/rgw/CMakeLists.txt @@ -172,8 +172,8 @@ add_library(radosgw_a STATIC ${radosgw_srcs} target_link_libraries(radosgw_a rgw_a ${SSL_LIBRARIES}) if(WITH_RADOSGW_BEAST_FRONTEND) target_link_libraries(radosgw_a - ${Boost_COROUTINE_LIBRARY} - ${Boost_CONTEXT_LIBRARY}) + Boost::coroutine + Boost::context) endif() add_executable(radosgw rgw_main.cc) diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index 080eccf765388..cf0f028cbad45 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -147,7 +147,7 @@ add_executable(ceph_omapbench ) target_link_libraries(ceph_omapbench librados - ${Boost_PROGRAM_OPTIONS_LIBRARY} + Boost::program_options global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} @@ -201,7 +201,7 @@ if(${WITH_RADOSGW}) cls_rgw_client cls_user_client cls_lock_client - ${Boost_REGEX_LIBRARY} + Boost::regex ${BLKID_LIBRARIES} ${CURL_LIBRARIES} ${EXPAT_LIBRARIES} @@ -231,7 +231,7 @@ if(${WITH_RADOSGW}) cls_rgw_client cls_user_client cls_lock_client - ${Boost_REGEX_LIBRARY} + Boost::regex ${BLKID_LIBRARIES} ${CURL_LIBRARIES} ${EXPAT_LIBRARIES} diff --git a/src/test/bench/CMakeLists.txt b/src/test/bench/CMakeLists.txt index ce4357fa7d0b5..9fba701e05221 100644 --- a/src/test/bench/CMakeLists.txt +++ b/src/test/bench/CMakeLists.txt @@ -8,7 +8,7 @@ set(smalliobench_srcs add_executable(ceph_smalliobench ${smalliobench_srcs} ) -target_link_libraries(ceph_smalliobench librados ${Boost_PROGRAM_OPTIONS_LIBRARY} global +target_link_libraries(ceph_smalliobench librados Boost::program_options global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS}) # ceph_smalliobenchrbd @@ -27,7 +27,7 @@ if(WITH_RBD) librados os global - ${Boost_PROGRAM_OPTIONS_LIBRARY} + Boost::program_options ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ) @@ -50,7 +50,7 @@ set(ceph_smalliobenchfs_srcs add_executable(ceph_smalliobenchfs ${ceph_smalliobenchfs_srcs} ) -target_link_libraries(ceph_smalliobenchfs librados ${Boost_PROGRAM_OPTIONS_LIBRARY} os global +target_link_libraries(ceph_smalliobenchfs librados Boost::program_options os global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS}) # ceph_smalliobenchdumb @@ -63,7 +63,7 @@ set(smalliobenchdumb_srcs add_executable(ceph_smalliobenchdumb ${smalliobenchdumb_srcs} ) -target_link_libraries(ceph_smalliobenchdumb librados ${Boost_PROGRAM_OPTIONS_LIBRARY} os global +target_link_libraries(ceph_smalliobenchdumb librados Boost::program_options os global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS}) # ceph_tpbench @@ -73,7 +73,7 @@ set(tpbench_srcs add_executable(ceph_tpbench ${tpbench_srcs} ) -target_link_libraries(ceph_tpbench librados ${Boost_PROGRAM_OPTIONS_LIBRARY} global +target_link_libraries(ceph_tpbench librados Boost::program_options global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS}) install(TARGETS diff --git a/src/test/erasure-code/CMakeLists.txt b/src/test/erasure-code/CMakeLists.txt index 1c4ca798433f3..218e6908f9526 100644 --- a/src/test/erasure-code/CMakeLists.txt +++ b/src/test/erasure-code/CMakeLists.txt @@ -6,15 +6,15 @@ add_ceph_test(test-erasure-eio.sh ${CMAKE_CURRENT_SOURCE_DIR}/test-erasure-eio.s add_executable(ceph_erasure_code_benchmark ${CMAKE_SOURCE_DIR}/src/erasure-code/ErasureCode.cc ceph_erasure_code_benchmark.cc) -target_link_libraries(ceph_erasure_code_benchmark ceph-common ${Boost_PROGRAM_OPTIONS_LIBRARY} global ${CMAKE_DL_LIBS}) +target_link_libraries(ceph_erasure_code_benchmark ceph-common Boost::program_options global ${CMAKE_DL_LIBS}) install(TARGETS ceph_erasure_code_benchmark DESTINATION bin) add_executable(ceph_erasure_code_non_regression ceph_erasure_code_non_regression.cc) -target_link_libraries(ceph_erasure_code_non_regression ceph-common ${Boost_PROGRAM_OPTIONS_LIBRARY} global ${CMAKE_DL_LIBS}) +target_link_libraries(ceph_erasure_code_non_regression ceph-common Boost::program_options global ${CMAKE_DL_LIBS}) add_executable(ceph_erasure_code ceph_erasure_code.cc) -target_link_libraries(ceph_erasure_code ceph-common ${Boost_PROGRAM_OPTIONS_LIBRARY} global ${CMAKE_DL_LIBS}) +target_link_libraries(ceph_erasure_code ceph-common Boost::program_options global ${CMAKE_DL_LIBS}) install(TARGETS ceph_erasure_code DESTINATION bin) diff --git a/src/test/librados/CMakeLists.txt b/src/test/librados/CMakeLists.txt index 2194a3e1fa67c..d81ebf256d01e 100644 --- a/src/test/librados/CMakeLists.txt +++ b/src/test/librados/CMakeLists.txt @@ -125,7 +125,7 @@ add_executable(ceph_test_rados_api_tier set_target_properties(ceph_test_rados_api_tier PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}) target_link_libraries(ceph_test_rados_api_tier - global rados_a ${UNITTEST_LIBS} ${Boost_SYSTEM_LIBRARY} radostest) + global rados_a ${UNITTEST_LIBS} Boost::system radostest) # ceph_test_rados_api_snapshots add_executable(ceph_test_rados_api_snapshots diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index f6336fa594f2f..ea241cceef2ae 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -23,11 +23,11 @@ target_link_libraries(ceph_radosacl librados global) install(TARGETS ceph_radosacl DESTINATION bin) add_executable(ceph-osdomap-tool ceph_osdomap_tool.cc) -target_link_libraries(ceph-osdomap-tool os global ${Boost_PROGRAM_OPTIONS_LIBRARY}) +target_link_libraries(ceph-osdomap-tool os global Boost::program_options) install(TARGETS ceph-osdomap-tool DESTINATION bin) add_executable(ceph-monstore-tool ceph_monstore_tool.cc) -target_link_libraries(ceph-monstore-tool os global ${Boost_PROGRAM_OPTIONS_LIBRARY}) +target_link_libraries(ceph-monstore-tool os global Boost::program_options) install(TARGETS ceph-monstore-tool DESTINATION bin) install(PROGRAMS ceph-monstore-update-crush.sh @@ -38,7 +38,7 @@ add_executable(ceph-objectstore-tool ceph_objectstore_tool.cc rebuild_mondb.cc RadosDump.cc) -target_link_libraries(ceph-objectstore-tool osd os global ${Boost_PROGRAM_OPTIONS_LIBRARY} ${CMAKE_DL_LIBS}) +target_link_libraries(ceph-objectstore-tool osd os global Boost::program_options ${CMAKE_DL_LIBS}) if(WITH_FUSE) target_link_libraries(ceph-objectstore-tool fuse) endif(WITH_FUSE) -- 2.39.5