From c4a87843308ace6f24a05be73c9c96cc1c2aa6a1 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 2 Jun 2016 01:50:21 +0800 Subject: [PATCH 1/9] cmake: install ceph-disk to /usr/sbin * add keyword "INSTALL_SCRIPT" to distutils_install_module(), so we can override the install path of ceph-disk script. * refactor the Distutils.cmake module a little bit, the ${option} variable out lives the CODE snipplet. so we need to reset it at the beginning. Signed-off-by: Kefu Chai --- cmake/modules/Distutils.cmake | 35 ++++++++++++++++++++++------------- src/ceph-disk/CMakeLists.txt | 3 ++- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/cmake/modules/Distutils.cmake b/cmake/modules/Distutils.cmake index b4c678b208c..07e6a0ff50a 100644 --- a/cmake/modules/Distutils.cmake +++ b/cmake/modules/Distutils.cmake @@ -1,13 +1,6 @@ -function(distutils_install_module name) - if(DEFINED ENV{DESTDIR}) - get_filename_component(debian_version /etc/debian_version ABSOLUTE) - if(EXISTS ${debian_version}) - set(options "--install-layout=deb") - else() - set(options "--prefix=/usr") - endif() - endif() +include(CMakeParseArguments) +function(distutils_install_module name) set(py_srcs setup.py README.rst requirements.txt test-requirements.txt ${name}) foreach(src ${py_srcs}) list(APPEND py_clone ${CMAKE_CURRENT_BINARY_DIR}/${src}) @@ -18,9 +11,24 @@ function(distutils_install_module name) endforeach() add_custom_target(${name}-clone ALL DEPENDS ${py_clone}) - install(CODE - "execute_process(COMMAND ${PYTHON_EXECUTABLE} setup.py install ${options} --root=$DESTDIR - WORKING_DIRECTORY \"${CMAKE_CURRENT_BINARY_DIR}\")") + cmake_parse_arguments(DU "" INSTALL_SCRIPT "" ${ARGN}) + install(CODE " + set(options) + if(DEFINED ENV{DESTDIR}) + if(EXISTS /etc/debian_version) + list(APPEND options --install-layout=deb) + else() + list(APPEND options --prefix=/usr) + endif() + list(APPEND options --root=\$ENV{DESTDIR}) + if(NOT \"${DU_INSTALL_SCRIPT}\" STREQUAL \"\") + list(APPEND options --install-script=${DU_INSTALL_SCRIPT}) + endif() + endif() + execute_process( + COMMAND ${PYTHON_EXECUTABLE} + setup.py install \${options} + WORKING_DIRECTORY \"${CMAKE_CURRENT_BINARY_DIR}\")") endfunction(distutils_install_module) function(distutils_add_cython_module name src) @@ -46,10 +54,11 @@ endfunction(distutils_add_cython_module) function(distutils_install_cython_module name) install(CODE " - set(options --prefix=/usr) if(DEFINED ENV{DESTDIR}) if(EXISTS /etc/debian_version) set(options --install-layout=deb) + else() + set(options --prefix=/usr) endif() set(root --root=\$ENV{DESTDIR}) else() diff --git a/src/ceph-disk/CMakeLists.txt b/src/ceph-disk/CMakeLists.txt index 9c91f18c9f8..a7a7a3376fe 100644 --- a/src/ceph-disk/CMakeLists.txt +++ b/src/ceph-disk/CMakeLists.txt @@ -8,4 +8,5 @@ add_custom_target(ceph-disk COMMENT "ceph-disk is being created") include(Distutils) -distutils_install_module(ceph_disk) +distutils_install_module(ceph_disk + INSTALL_SCRIPT /usr/sbin) From 52021ff9f0b23c36a012f19c7388dcfb2281b523 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 2 Jun 2016 02:08:45 +0800 Subject: [PATCH 2/9] makefile: install mount.fuse.ceph,mount.ceph into /usr/sbin Signed-off-by: Kefu Chai --- ceph.spec.in | 2 -- debian/ceph-fs-common.install | 2 +- debian/ceph-fuse.install | 2 +- src/CMakeLists.txt | 4 ++-- src/Makefile-server.am | 4 ++-- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/ceph.spec.in b/ceph.spec.in index 79cf4c912cb..86733a27c10 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -713,8 +713,6 @@ install -m 0644 -D etc/sysconfig/SuSEfirewall2.d/services/ceph-osd-mds %{buildro # udev rules install -m 0644 -D udev/50-rbd.rules %{buildroot}%{_udevrulesdir}/50-rbd.rules install -m 0644 -D udev/95-ceph-osd.rules %{buildroot}%{_udevrulesdir}/95-ceph-osd.rules -mv %{buildroot}/sbin/mount.ceph %{buildroot}/usr/sbin/mount.ceph -mv %{buildroot}/sbin/mount.fuse.ceph %{buildroot}/usr/sbin/mount.fuse.ceph #set up placeholder directories mkdir -p %{buildroot}%{_sysconfdir}/ceph diff --git a/debian/ceph-fs-common.install b/debian/ceph-fs-common.install index b20f66af344..70f6e949ab1 100644 --- a/debian/ceph-fs-common.install +++ b/debian/ceph-fs-common.install @@ -1,4 +1,4 @@ -sbin/mount.ceph +usr/sbin/mount.ceph sbin usr/bin/cephfs usr/share/man/man8/cephfs.8 usr/share/man/man8/mount.ceph.8 diff --git a/debian/ceph-fuse.install b/debian/ceph-fuse.install index c3bcd499304..364e8639322 100644 --- a/debian/ceph-fuse.install +++ b/debian/ceph-fuse.install @@ -1,3 +1,3 @@ -sbin/mount.fuse.ceph +usr/sbin/mount.fuse.ceph sbin usr/bin/ceph-fuse usr/share/man/man8/ceph-fuse.8 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7dda69460fc..7a81415655e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1151,7 +1151,7 @@ endif(BUILD_SHARED_LIBS) target_link_libraries(mount.ceph keyutils) install(TARGETS ceph-syn DESTINATION bin) - install(TARGETS mount.ceph DESTINATION /sbin) + install(TARGETS mount.ceph DESTINATION ${CMAKE_INSTALL_SBINDIR}) if(HAVE_LIBFUSE) set(ceph_fuse_srcs @@ -1161,7 +1161,7 @@ endif(BUILD_SHARED_LIBS) target_link_libraries(ceph-fuse ${FUSE_LIBRARIES} client global) set_target_properties(ceph-fuse PROPERTIES COMPILE_FLAGS "-I${FUSE_INCLUDE_DIRS}") install(TARGETS ceph-fuse DESTINATION bin) - install(PROGRAMS mount.fuse.ceph DESTINATION /sbin) + install(PROGRAMS mount.fuse.ceph DESTINATION ${CMAKE_INSTALL_SBINDIR}) endif(HAVE_LIBFUSE) endif(WITH_LIBCEPHFS) diff --git a/src/Makefile-server.am b/src/Makefile-server.am index 1ea73b1c1d6..f75017a524e 100644 --- a/src/Makefile-server.am +++ b/src/Makefile-server.am @@ -19,9 +19,9 @@ shell_scripts += init-ceph mount_ceph_SOURCES = mount/mount.ceph.c mount_ceph_LDADD = $(LIBSECRET) $(LIBCOMMON) if LINUX -su_sbin_PROGRAMS += mount.ceph +sbin_PROGRAMS += mount.ceph endif # LINUX -su_sbin_SCRIPTS += mount.fuse.ceph +sbin_SCRIPTS += mount.fuse.ceph if WITH_MON From 3245df5508f315e39c5992a1c6f434370c008851 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 2 Jun 2016 11:15:26 +0800 Subject: [PATCH 3/9] cmake: fix linkage of ceph_test_cls_${name} they should link against cls_${name}_client, instead of against cls_${name} directly. Signed-off-by: Kefu Chai --- src/test/cls_lock/CMakeLists.txt | 2 +- src/test/cls_rbd/CMakeLists.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/cls_lock/CMakeLists.txt b/src/test/cls_lock/CMakeLists.txt index c2544915fc7..ef2b6458e28 100644 --- a/src/test/cls_lock/CMakeLists.txt +++ b/src/test/cls_lock/CMakeLists.txt @@ -4,7 +4,7 @@ add_executable(ceph_test_cls_lock set_target_properties(ceph_test_cls_lock PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}) target_link_libraries(ceph_test_cls_lock - cls_lock + cls_lock_client librados global ${UNITTEST_LIBS} diff --git a/src/test/cls_rbd/CMakeLists.txt b/src/test/cls_rbd/CMakeLists.txt index 84be512201f..51f063d1706 100644 --- a/src/test/cls_rbd/CMakeLists.txt +++ b/src/test/cls_rbd/CMakeLists.txt @@ -8,8 +8,8 @@ set_target_properties(ceph_test_cls_rbd PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}) target_link_libraries(ceph_test_cls_rbd librbd - cls_rbd - cls_lock + cls_rbd_client + cls_lock_client librados global ${UNITTEST_LIBS} From 93b120030692f20592c13918d54b38b1c0627a94 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 2 Jun 2016 11:25:26 +0800 Subject: [PATCH 4/9] cmake: link rbd cli against krbd_objs directly rbd cli => Kernel.cc => krbd_create_from_context() <= krbd.cc Signed-off-by: Kefu Chai --- src/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7a81415655e..28fa1462913 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1283,7 +1283,8 @@ if(${WITH_RBD}) add_executable(rbd ${rbd_srcs} $ $ - $) + $ + $) set_target_properties(rbd PROPERTIES OUTPUT_NAME rbd) target_link_libraries(rbd librbd librados global common keyutils udev ${Boost_REGEX_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} From 01efc89aa71bd11233269da08f8b022d23f54803 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 2 Jun 2016 11:37:18 +0800 Subject: [PATCH 5/9] cmake: link ceph-dencoder against os lib os is a top level target which is linked into executables or user facing libraries. so it is not included by any libraries linked by ceph-dencoder so far. Signed-off-by: Kefu Chai --- src/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 28fa1462913..9e0a0b90021 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -706,6 +706,7 @@ target_link_libraries(ceph-dencoder librados librbd global + os osd mds mon From c24098cc542711e7bc481560ecc05ccfa578b6ea Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 2 Jun 2016 11:51:36 +0800 Subject: [PATCH 6/9] cmake: do not link ceph_test_rgw_*, ceph-dencoder against cls_kvs it is not used, and causes link errors. Signed-off-by: Kefu Chai --- src/CMakeLists.txt | 1 - src/test/rgw/CMakeLists.txt | 2 -- 2 files changed, 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9e0a0b90021..5b7606cf168 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -719,7 +719,6 @@ target_link_libraries(ceph-dencoder cls_statelog_client cls_version_client cls_replica_log_client - cls_kvs cls_user_client cls_journal_client cls_timeindex_client diff --git a/src/test/rgw/CMakeLists.txt b/src/test/rgw/CMakeLists.txt index d47db6279c2..05a53b4b453 100644 --- a/src/test/rgw/CMakeLists.txt +++ b/src/test/rgw/CMakeLists.txt @@ -18,7 +18,6 @@ target_link_libraries(ceph_test_rgw_manifest cls_timeindex_client cls_version_client cls_replica_log_client - cls_kvs cls_user_client librados global @@ -46,7 +45,6 @@ target_link_libraries(ceph_test_rgw_obj cls_statelog_client cls_version_client cls_replica_log_client - cls_kvs cls_user_client librados global From a011b4e71aa03d8cdc364a92d50c4afe75060fe4 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 3 Jun 2016 13:32:44 +0800 Subject: [PATCH 7/9] cmake: compile more radosstriper tests Signed-off-by: Kefu Chai --- src/test/libradosstriper/CMakeLists.txt | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/test/libradosstriper/CMakeLists.txt b/src/test/libradosstriper/CMakeLists.txt index f633b734051..5dc864a696d 100644 --- a/src/test/libradosstriper/CMakeLists.txt +++ b/src/test/libradosstriper/CMakeLists.txt @@ -3,12 +3,26 @@ target_link_libraries(rados_striper_test radostest) set_target_properties(rados_striper_test PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}) -add_executable(ceph_test_rados_api_striping +add_executable(ceph_test_rados_striper_api_striping striping.cc ) -target_link_libraries(ceph_test_rados_api_striping librados radosstriper +target_link_libraries(ceph_test_rados_striper_api_striping librados radosstriper ${UNITTEST_LIBS} rados_striper_test) -set_target_properties(ceph_test_rados_api_striping PROPERTIES COMPILE_FLAGS +set_target_properties(ceph_test_rados_striper_api_striping PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}) add_ceph_test(rados-striper.sh ${CMAKE_SOURCE_DIR}/src/test/libradosstriper/rados-striper.sh) + +add_executable(ceph_test_rados_striper_api_io + io.cc) +target_link_libraries(ceph_test_rados_striper_api_io librados radosstriper + ${UNITTEST_LIBS} rados_striper_test) +set_target_properties(ceph_test_rados_striper_api_io PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) + +add_executable(ceph_test_rados_striper_api_aio + aio.cc) +target_link_libraries(ceph_test_rados_striper_api_aio librados radosstriper + ${UNITTEST_LIBS} rados_striper_test) +set_target_properties(ceph_test_rados_striper_api_aio PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) From 703e9c800cd7877078d2c76152f70dadd2a5430b Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 3 Jun 2016 13:39:04 +0800 Subject: [PATCH 8/9] cmake: install binaries used by ceph-qa-suite they are: - ceph_test_rados: used by tasks/rados.py - ceph_test_rados_delete_pools_parallel: used by suites/rados/monthrash/workloads/pool-create-delete.yaml - ceph_test_filejournal suites/rados/objectstore/filejournal.yaml - ceph_test_objectstore: used by suites/rados/objectstore/objectstore.yaml - ceph_test_{async_driver,msgr}: used by suites/rados/singleton-nomsgr/all/msgr.yaml Signed-off-by: Kefu Chai --- src/test/CMakeLists.txt | 3 +++ src/test/msgr/CMakeLists.txt | 4 +++- src/test/objectstore/CMakeLists.txt | 2 ++ src/test/osd/CMakeLists.txt | 3 +++ src/test/system/CMakeLists.txt | 6 ++++-- 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index 07e83a1b4d7..ee0392f89be 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -398,6 +398,9 @@ target_link_libraries(ceph_test_filejournal ${CMAKE_DL_LIBS} ${EXTRALIBS} ) +install(TARGETS + ceph_test_filejournal + DESTINATION ${CMAKE_INSTALL_BINDIR}) # ceph_test_keys add_executable(ceph_test_keys diff --git a/src/test/msgr/CMakeLists.txt b/src/test/msgr/CMakeLists.txt index 78b78dc7204..4eb10acfa17 100644 --- a/src/test/msgr/CMakeLists.txt +++ b/src/test/msgr/CMakeLists.txt @@ -27,6 +27,8 @@ set_target_properties(ceph_perf_msgr_client PROPERTIES COMPILE_FLAGS target_link_libraries(ceph_perf_msgr_client os global ${UNITTEST_LIBS}) install(TARGETS + ceph_test_async_driver + ceph_test_msgr ceph_perf_msgr_server ceph_perf_msgr_client - DESTINATION bin) + DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/src/test/objectstore/CMakeLists.txt b/src/test/objectstore/CMakeLists.txt index 233fffafa1e..213549ab9df 100644 --- a/src/test/objectstore/CMakeLists.txt +++ b/src/test/objectstore/CMakeLists.txt @@ -23,6 +23,8 @@ target_link_libraries(ceph_test_objectstore ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ) +install(TARGETS ceph_test_objectstore + DESTINATION ${CMAKE_INSTALL_BINDIR}) #ceph_test_keyvaluedb add_executable(ceph_test_keyvaluedb diff --git a/src/test/osd/CMakeLists.txt b/src/test/osd/CMakeLists.txt index 1278675fc70..8eabea8da2a 100644 --- a/src/test/osd/CMakeLists.txt +++ b/src/test/osd/CMakeLists.txt @@ -13,6 +13,9 @@ target_link_libraries(ceph_test_rados ${EXTRALIBS} ${CMAKE_DL_LIBS} ) +install(TARGETS + ceph_test_rados + DESTINATION ${CMAKE_INSTALL_BINDIR}) # scripts add_ceph_test(osd-bench.sh ${CMAKE_CURRENT_SOURCE_DIR}/osd-bench.sh) diff --git a/src/test/system/CMakeLists.txt b/src/test/system/CMakeLists.txt index bd3a45b4ded..699643b9f3c 100644 --- a/src/test/system/CMakeLists.txt +++ b/src/test/system/CMakeLists.txt @@ -34,11 +34,13 @@ set(test_rados_delete_pools_parallel_srcs st_rados_delete_pool.cc st_rados_list_objects.cc ) -add_executable(test_rados_delete_pools_parallel +add_executable(ceph_test_rados_delete_pools_parallel ${test_rados_delete_pools_parallel_srcs} ) -target_link_libraries(test_rados_delete_pools_parallel librados systest global +target_link_libraries(ceph_test_rados_delete_pools_parallel librados systest global pthread rt ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS}) +install(TARGETS ceph_test_rados_delete_pools_parallel + DESTINATION ${CMAKE_INSTALL_BINDIR}) # test_rados_watch_notify set(test_rados_watch_notify_srcs From cf9a42c7cc8c13f91724db3a44e45b3fca696446 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 4 Jun 2016 09:50:00 +0800 Subject: [PATCH 9/9] cmake: use ENABLE_SHARED instead of BUILD_SHARED_LIBS we decided to drop the static libraries from the *-dev debian packages. so no more tricky changes for supporting creating both libraries. * partially revert 1dbfb26: s/BUILD_SHARED_LIBS/ENABLE_SHARED/ - add_library() command use BUILD_SHARED_LIBS as the default library type, and all intermediate libraries should static ones. it would cause unnecessary confusion if some developer uses add_library() without specifying the library type, and ends up with a .so. so we use our own setting variables for specifying the type of user facing libraries. * revert ac47440 - the BUILD_SHARED_LIBS setting is also populated to the gmock libraries, which should be compiled as static ones. otherwise the unit tests will crash on exit. Signed-off-by: Kefu Chai --- CMakeLists.txt | 13 ++++++++++--- src/CMakeLists.txt | 20 ++++++-------------- src/librbd/CMakeLists.txt | 6 +++--- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 26f4d17ff62..9956aa80cb8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -150,6 +150,13 @@ CHECK_CXX_SOURCE_COMPILES(" set(CEPH_MAN_DIR "share/man" CACHE STRING "Install location for man pages (relative to prefix).") +option(ENABLE_SHARED "build shared libraries" ON) +if(ENABLE_SHARED) + set(CEPH_SHARED SHARED) +else(ENABLE_SHARED) + set(CEPH_SHARED STATIC) +endif(ENABLE_SHARED) + option(BUILD_SHARED_LIBS "Build shared libraries" ON) find_package(execinfo) @@ -347,11 +354,11 @@ option(PG_DEBUG_REFS "PG Ref debugging is enabled" OFF) add_definitions(-D__linux__) -if(BUILD_SHARED_LIBS) +if(ENABLE_SHARED) set(Boost_USE_STATIC_LIBS OFF) -else(BUILD_SHARED_LIBS) +else(ENABLE_SHARED) set(Boost_USE_STATIC_LIBS ON) -endif(BUILD_SHARED_LIBS) +endif(ENABLE_SHARED) set(Boost_USE_MULTITHREADED ON) find_package(Boost COMPONENTS thread system regex random program_options date_time iostreams REQUIRED) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5b7606cf168..b62a479d8ea 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -508,10 +508,6 @@ target_link_libraries(global common ${CMAKE_THREAD_LIBS_INIT} ${CRYPTO_LIBS} if(${WITH_LTTNG}) target_link_libraries(global lttng-ust dl) endif(${WITH_LTTNG}) -if(BUILD_SHARED_LIBS) - set_target_properties(global PROPERTIES - OUTPUT_NAME ceph-global VERSION "1.0.0" SOVERSION "1") -endif(BUILD_SHARED_LIBS) # rados object classes add_subdirectory(cls) @@ -533,7 +529,7 @@ set(librados_srcs librados/snap_set_diff.cc librados/RadosXattrIter.cc ) -add_library(librados ${librados_srcs} +add_library(librados ${CEPH_SHARED} ${librados_srcs} $ $) add_dependencies(librados osdc) @@ -543,10 +539,10 @@ endif() # LINK_PRIVATE instead of PRIVATE is used to backward compatibility with cmake 2.8.11 target_link_libraries(librados LINK_PRIVATE osdc osd os global common cls_lock_client ${BLKID_LIBRARIES} ${CRYPTO_LIBS} ${EXTRALIBS}) -if(BUILD_SHARED_LIBS) +if(ENABLE_SHARED) set_target_properties(librados PROPERTIES OUTPUT_NAME rados VERSION 2.0.0 SOVERSION 2) -endif(BUILD_SHARED_LIBS) +endif(ENABLE_SHARED) add_library(librados_api STATIC common/buffer.cc librados/librados.cc) @@ -996,11 +992,7 @@ target_link_libraries(crushtool global) install(TARGETS crushtool DESTINATION bin) # Support/Tools -# the static gtest/gmock libraries load correctly for us -set(BUILD_SHARED_LIBS_saved ${BUILD_SHARED_LIBS}) -set(BUILD_SHARED_LIBS OFF) add_subdirectory(gmock) -set(BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_saved}) add_subdirectory(test) set(cephfs_srcs cephfs.cc) @@ -1123,16 +1115,16 @@ if(WITH_LIBCEPHFS) add_library(client STATIC ${libclient_srcs}) target_link_libraries(client osdc mds) set(libcephfs_srcs libcephfs.cc) - add_library(cephfs ${libcephfs_srcs} + add_library(cephfs ${CEPH_SHARED} ${libcephfs_srcs} $ $) target_link_libraries(cephfs LINK_PRIVATE client osdc osd os global common ${BLKID_LIBRARIES} ${CRYPTO_LIBS} ${EXTRALIBS}) -if(BUILD_SHARED_LIBS) +if(ENABLE_SHARED) set_target_properties(cephfs PROPERTIES OUTPUT_NAME cephfs VERSION 1.0.0 SOVERSION 1) -endif(BUILD_SHARED_LIBS) +endif(ENABLE_SHARED) install(TARGETS cephfs DESTINATION lib) install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/include/cephfs" diff --git a/src/librbd/CMakeLists.txt b/src/librbd/CMakeLists.txt index beb7ac2fe99..33055d8ca7b 100644 --- a/src/librbd/CMakeLists.txt +++ b/src/librbd/CMakeLists.txt @@ -68,7 +68,7 @@ if(WITH_LTTNG) add_dependencies(rbd_internal rbd-tp) endif() -add_library(librbd +add_library(librbd ${CEPH_SHARED} $ $ $ @@ -90,8 +90,8 @@ target_link_libraries(librbd LINK_PRIVATE keyutils ${CMAKE_DL_LIBS} ${EXTRALIBS}) -if(BUILD_SHARED_LIBS) +if(ENABLE_SHARED) set_target_properties(librbd PROPERTIES VERSION "1.0.0" SOVERSION "1" OUTPUT_NAME rbd) -endif(BUILD_SHARED_LIBS) +endif(ENABLE_SHARED) install(TARGETS librbd DESTINATION lib)