Skip to content

Commit

Permalink
Merge pull request #9249 from tchaikov/wip-cmake-ocf
Browse files Browse the repository at this point in the history
cmake: add ocf support

Reviewed-by: Casey Bodley <cbodley@redhat.com>
  • Loading branch information
cbodley committed May 23, 2016
2 parents bdd85cd + a78b939 commit 0120d27
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/CMakeLists.txt
Expand Up @@ -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)
Expand Down
22 changes: 22 additions & 0 deletions 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()

0 comments on commit 0120d27

Please sign in to comment.