]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: add ocf support 9249/head
authorKefu Chai <kchai@redhat.com>
Sat, 21 May 2016 12:45:55 +0000 (20:45 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 21 May 2016 13:26:57 +0000 (21:26 +0800)
a new option is added: WITH_OCF. it is OFF by default.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/CMakeLists.txt
src/ocf/CMakeLists.txt [new file with mode: 0644]

index 3657a2458fd3023519f39c6ea5a8b317128715cc..babb28312a84ce46613a7205a641b96231f385b3 100644 (file)
@@ -113,6 +113,11 @@ else(${ENABLE_GIT_VERSION})
   set(CEPH_GIT_NICE_VER "Development")
 endif(${ENABLE_GIT_VERSION})
 
+option(WITH_OCF "build OCF-compliant cluster resource agent" OFF)
+if(WITH_OCF)
+  add_subdirectory(ocf)
+endif()
+
 # Python stuff
 find_package(PythonInterp 2 QUIET)
 if(NOT PYTHONINTERP_FOUND)
diff --git a/src/ocf/CMakeLists.txt b/src/ocf/CMakeLists.txt
new file mode 100644 (file)
index 0000000..8b90499
--- /dev/null
@@ -0,0 +1,22 @@
+# The root of the OCF resource agent hierarchy
+# Per the OCF standard, it's always "lib",
+# not "lib64" (even on 64-bit platforms).
+set(ocf_dir ${CMAKE_INSTALL_PREFIX}/lib/ocf)
+
+string(TOLOWER ${PROJECT_NAME} lower_project_name)
+# The ceph provider directory
+set(ra_dir ${ocf_dir}/resource.d/${lower_project_name})
+
+foreach(agent ceph rbd)
+  configure_file(${agent}.in
+    ${agent} @ONLY)
+  install(FILES
+    ${CMAKE_CURRENT_BINARY_DIR}/${agent}
+    DESTINATION ${ra_dir})
+endforeach()
+
+foreach(agent osd mds mon)
+  install(CODE
+    "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink ceph ${agent}
+       WORKING_DIRECTORY \"${ra_dir}\")")
+endforeach()