]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cmake: use file(GLOB ..) to find .yaml.in files
authorKefu Chai <kchai@redhat.com>
Wed, 21 Apr 2021 05:28:52 +0000 (13:28 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 21 Apr 2021 05:34:35 +0000 (13:34 +0800)
instead of hardcode the option file names, use file(GLOB ..) to find
and collect them instead, for better maintainability.

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

index 6424271e381217385718d3e4b3ce93dd98a0988f..8b934a6df2dc5b83526ae35f0fc816f678cb2b45 100644 (file)
@@ -21,8 +21,7 @@ function(file_configure input_file output_file)
     VERBATIM)
 endfunction()
 
-function(add_options name)
-  set(yaml_in_file ${CMAKE_CURRENT_SOURCE_DIR}/${name}.yaml.in)
+function(add_options name yaml_in_file)
   set(yaml_file ${CMAKE_CURRENT_BINARY_DIR}/${name}.yaml)
   file_configure("${yaml_in_file}"
     "${yaml_file}" @ONLY)
@@ -79,21 +78,17 @@ if(WITH_MGR)
   endif()
 endif()
 
-add_options(global)
-add_options(cephfs-mirror)
-add_options(crimson)
-add_options(mds)
-add_options(mds-client)
-add_options(rbd)
-add_options(rbd-mirror)
-add_options(immutable-object-cache)
-
 # if set to empty string, system default luarocks package location (if exist) will be used
 set(rgw_luarocks_location "")
 if(WITH_RADOSGW_LUA_PACKAGES)
   set(rgw_luarocks_location "/tmp/luarocks")
 endif()
-add_options(rgw)
+
+file(GLOB yaml_in_srcs "*.yaml.in")
+foreach(fn ${yaml_in_srcs})
+  get_filename_component(name ${fn} NAME_WE)
+  add_options(${name} ${fn})
+endforeach()
 
 add_library(common-options-objs OBJECT
   ${common_options_srcs})