]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: install mgr plugins into $prefix/share/ceph
authorKefu Chai <kchai@redhat.com>
Fri, 15 Feb 2019 12:14:53 +0000 (20:14 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 16 Feb 2019 08:38:27 +0000 (16:38 +0800)
as mgr plugins are architecture independent source files. see also
/usr/share/cmake-*/

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/CMakeLists.txt
src/common/CMakeLists.txt
src/common/options.cc
src/crimson/CMakeLists.txt
src/pybind/mgr/CMakeLists.txt

index 3f7123f5451ea44aeb337a6beb008f21edf21767..3031524230d44917989e52acfd7f0ab91154e85f 100644 (file)
@@ -4,6 +4,8 @@ include(GNUInstallDirs)
 # for erasure and compressor plugins
 set(CMAKE_INSTALL_PKGLIBDIR ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME})
 set(CMAKE_INSTALL_FULL_PKGLIBDIR ${CMAKE_INSTALL_FULL_LIBDIR}/${PROJECT_NAME})
+# for mgr plugins
+set(CEPH_INSTALL_DATADIR ${CMAKE_INSTALL_FULL_DATADIR}/${PROJECT_NAME})
 # so libceph-common can be found
 set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
 if(NOT CMAKE_INSTALL_RPATH)
@@ -17,7 +19,7 @@ set(libdir ${CMAKE_INSTALL_FULL_LIBDIR})
 set(sysconfdir ${CMAKE_INSTALL_FULL_SYSCONFDIR})
 set(libexecdir ${CMAKE_INSTALL_FULL_LIBEXECDIR})
 set(pkgdatadir ${CMAKE_INSTALL_FULL_DATADIR})
-set(datadir ${CMAKE_INSTALL_FULL_DATADIR}/${PROJECT_NAME})
+set(datadir ${CEPH_INSTALL_DATADIR})
 set(prefix ${CMAKE_INSTALL_PREFIX})
 
 add_definitions("-DHAVE_CONFIG_H -D__CEPH__ -D_REENTRANT -D_THREAD_SAFE -D__STDC_FORMAT_MACROS")
index 1aa742d5ae55d2b8b509239ed26ccbba6e711344..4ebff8718330a80afc0ea24908a6b29272d32d51 100644 (file)
@@ -127,7 +127,8 @@ add_library(common-common-objs OBJECT
 # for options.cc
 target_compile_definitions(common-common-objs PRIVATE
   "CEPH_LIBDIR=\"${CMAKE_INSTALL_FULL_LIBDIR}\""
-  "CEPH_PKGLIBDIR=\"${CMAKE_INSTALL_FULL_PKGLIBDIR}\"")
+  "CEPH_PKGLIBDIR=\"${CMAKE_INSTALL_FULL_PKGLIBDIR}\""
+  "CEPH_DATADIR=\"${CEPH_INSTALL_DATADIR}\"")
 
 set(common_mountcephfs_srcs
   armor.c
index a9f2c6e25eff0acb3ea7c96654cfd54114525f9a..27198996392c968dc0778628dea2769b94b55e4f 100644 (file)
@@ -5148,7 +5148,7 @@ std::vector<Option> get_global_options() {
     .set_description(""),
 
     Option("mgr_module_path", Option::TYPE_STR, Option::LEVEL_ADVANCED)
-    .set_default(CEPH_PKGLIBDIR "/mgr")
+    .set_default(CEPH_DATADIR "/mgr")
     .add_service("mgr")
     .set_description("Filesystem path to manager modules."),
 
index 5d42f60f24bb0e45e212a67d90fcd5e82af026c9..360b986855d2246dc73fa0b61642cde8f48e90f6 100644 (file)
@@ -96,7 +96,8 @@ add_library(crimson-common STATIC
 
 target_compile_definitions(crimson-common PRIVATE
   "CEPH_LIBDIR=\"${CMAKE_INSTALL_FULL_LIBDIR}\""
-  "CEPH_PKGLIBDIR=\"${CMAKE_INSTALL_FULL_PKGLIBDIR}\"")
+  "CEPH_PKGLIBDIR=\"${CMAKE_INSTALL_FULL_PKGLIBDIR}\""
+  "CEPH_DATADIR=\"${CEPH_INSTALL_DATADIR}\"")
 
 target_link_libraries(crimson-common
   PUBLIC
index 216cda718c35d9721dec5b66ec33e4e32097aeba..2b5f4a7d4ad73dfcfac618d2c033e7592bd8c9ff 100644 (file)
@@ -7,7 +7,7 @@ add_subdirectory(orchestrator_cli)
 # OPTION(mgr_module_path, OPT_STR, CEPH_PKGLIBDIR "/mgr")
 install(DIRECTORY
   ${CMAKE_CURRENT_SOURCE_DIR}
-  DESTINATION ${CMAKE_INSTALL_PKGLIBDIR}
+  DESTINATION ${CEPH_INSTALL_DATADIR}
   REGEX "CMakeLists.txt" EXCLUDE
   REGEX "\\.gitignore" EXCLUDE
   REGEX "hello/.*" EXCLUDE