From: Kefu Chai Date: Sat, 21 May 2016 12:45:55 +0000 (+0800) Subject: cmake: add ocf support X-Git-Tag: v11.0.0~449^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F9249%2Fhead;p=ceph.git cmake: add ocf support a new option is added: WITH_OCF. it is OFF by default. Signed-off-by: Kefu Chai --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3657a2458fd..babb28312a8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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 index 00000000000..8b90499062c --- /dev/null +++ b/src/ocf/CMakeLists.txt @@ -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()