]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: use the same name for macros and cmake variables
authorKefu Chai <kchai@redhat.com>
Sun, 11 Apr 2021 04:54:18 +0000 (12:54 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 13 Apr 2021 01:13:46 +0000 (09:13 +0800)
for two reasons,

* consolidate the namings
* pave the road to yamlize options where we will use cmake variables
  to substitude the @<variable-name>@ in .in files instead of relying
  on C/C++ macros

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

index ea9d46cfe776833dba012f1b1b55a11664f7fbff..a2d50aed896f952d28653626a7d0a48ac288a0d0 100644 (file)
@@ -183,9 +183,9 @@ add_library(common-common-objs OBJECT
 target_include_directories(common-common-objs PRIVATE ${OPENSSL_INCLUDE_DIR})
 # for options.cc
 target_compile_definitions(common-common-objs PRIVATE
-  "CEPH_LIBDIR=\"${CMAKE_INSTALL_FULL_LIBDIR}\""
-  "CEPH_PKGLIBDIR=\"${CEPH_INSTALL_FULL_PKGLIBDIR}\""
-  "CEPH_DATADIR=\"${CEPH_INSTALL_DATADIR}\"")
+  "CMAKE_INSTALL_LIBDIR=\"${CMAKE_INSTALL_LIBDIR}\""
+  "CEPH_INSTALL_FULL_PKGLIBDIR=\"${CEPH_INSTALL_FULL_PKGLIBDIR}\""
+  "CEPH_INSTALL_DATADIR=\"${CEPH_INSTALL_DATADIR}\"")
 
 set(common_mountcephfs_srcs
   armor.c
index 15911cbe8205f1e8dec78b25c32aa77b246c131d..f2c0104f7d896cd4ff0c3f90dbd1a05d4b9b59de 100644 (file)
@@ -574,7 +574,7 @@ std::vector<Option> get_global_options() {
     .set_description("default set by python code"),
 
     Option("erasure_code_dir", Option::TYPE_STR, Option::LEVEL_ADVANCED)
-    .set_default(CEPH_PKGLIBDIR"/erasure-code")
+    .set_default(CEPH_INSTALL_FULL_PKGLIBDIR"/erasure-code")
     .set_flag(Option::FLAG_STARTUP)
     .set_description("directory where erasure-code plugins can be found")
     .add_service({"mon", "osd"}),
@@ -805,7 +805,7 @@ std::vector<Option> get_global_options() {
     .set_description("Enable named (or all with '*') experimental features that may be untested, dangerous, and/or cause permanent data loss"),
 
     Option("plugin_dir", Option::TYPE_STR, Option::LEVEL_ADVANCED)
-    .set_default(CEPH_PKGLIBDIR)
+    .set_default(CEPH_INSTALL_FULL_PKGLIBDIR)
     .set_flag(Option::FLAG_STARTUP)
     .add_service({"mon", "osd"})
     .set_description("Base directory for dynamically loaded plugins"),
@@ -3480,7 +3480,7 @@ std::vector<Option> get_global_options() {
     .add_see_also("osd_deep_scrub_large_omap_object_key_threshold"),
 
     Option("osd_class_dir", Option::TYPE_STR, Option::LEVEL_ADVANCED)
-    .set_default(CEPH_LIBDIR "/rados-classes")
+    .set_default(CMAKE_INSTALL_LIBDIR "/rados-classes")
     .set_description(""),
 
     Option("osd_open_classes_on_start", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
@@ -5426,7 +5426,7 @@ std::vector<Option> get_global_options() {
     .set_description("Path to cephadm utility"),
 
     Option("mgr_module_path", Option::TYPE_STR, Option::LEVEL_ADVANCED)
-    .set_default(CEPH_DATADIR "/mgr")
+    .set_default(CEPH_INSTALL_DATADIR "/mgr")
     .add_service("mgr")
     .set_description("Filesystem path to manager modules."),
 
index 89572322f3146415e48d815886e10b0ef8ab6414..cfcb600104d032e2041abe229a0f0f9d9c085e51 100644 (file)
@@ -121,9 +121,9 @@ add_library(crimson-common STATIC
   $<TARGET_OBJECTS:common_mountcephfs_objs>)
 
 target_compile_definitions(crimson-common PRIVATE
-  "CEPH_LIBDIR=\"${CMAKE_INSTALL_FULL_LIBDIR}\""
-  "CEPH_PKGLIBDIR=\"${CEPH_INSTALL_FULL_PKGLIBDIR}\""
-  "CEPH_DATADIR=\"${CEPH_INSTALL_DATADIR}\"")
+  "CMAKE_INSTALL_LIBDIR=\"${CMAKE_INSTALL_LIBDIR}\""
+  "CEPH_INSTALL_FULL_PKGLIBDIR=\"${CEPH_INSTALL_FULL_PKGLIBDIR}\""
+  "CEPH_INSTALL_DATADIR=\"${CEPH_INSTALL_DATADIR}\"")
 
 set(crimson_common_deps
   Boost::iostreams
index 679d0d9ae58ba3cf9f739cb344f89517f2706fa3..032857c09c048acfba5e93ed1ec78dc6cbe673a1 100644 (file)
@@ -10,7 +10,7 @@ if(WITH_TESTS)
 endif()
 
 # Location needs to match default setting for mgr_module_path, currently:
-# OPTION(mgr_module_path, OPT_STR, CEPH_PKGLIBDIR "/mgr")
+# OPTION(mgr_module_path, OPT_STR, CEPH_INSTALL_DATADIR "/mgr")
 install(DIRECTORY
   ${CMAKE_CURRENT_SOURCE_DIR}
   DESTINATION ${CEPH_INSTALL_DATADIR}