Skip to content

Commit

Permalink
cmake: Use WITH_TESTS flag to guard the build of ceph-test scripts/bi…
Browse files Browse the repository at this point in the history
…naries

Signed-off-by: Ricardo Dias <rdias@suse.com>
  • Loading branch information
rjfd committed Aug 25, 2016
1 parent ea8ab19 commit ad1a2c1
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Expand Up @@ -366,6 +366,8 @@ option(HAVE_LIBZFS "LibZFS is enabled" OFF)
option(ENABLE_COVERAGE "Coverage is enabled" OFF)
option(PG_DEBUG_REFS "PG Ref debugging is enabled" OFF)

option(WITH_TESTS "enable the build of ceph-test package scripts/binaries" ON)

if(LINUX)
add_definitions(-D__linux__)
endif(LINUX)
Expand Down
5 changes: 4 additions & 1 deletion doc/man/8/CMakeLists.txt
Expand Up @@ -13,8 +13,11 @@ set(server_srcs
ceph-run.rst
mount.ceph.rst
ceph-create-keys.rst
ceph-rest-api.rst
ceph-rest-api.rst)
if(WITH_TESTS)
list(APPEND server_srcs
ceph-debugpack.rst)
endif(WITH_TESTS)

set(osd_srcs
ceph-clsinfo.rst
Expand Down
12 changes: 10 additions & 2 deletions src/CMakeLists.txt
Expand Up @@ -702,18 +702,21 @@ install(TARGETS ceph-mds DESTINATION bin)
add_subdirectory(erasure-code)

# Support/Tools
if(WITH_TESTS)
add_subdirectory(googletest/googlemock)

add_subdirectory(test)
endif(WITH_TESTS)

add_subdirectory(compressor)
add_subdirectory(tools)

if(WITH_TESTS)
configure_file(${CMAKE_SOURCE_DIR}/src/ceph-coverage.in
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-coverage @ONLY)

configure_file(${CMAKE_SOURCE_DIR}/src/ceph-debugpack.in
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-debugpack @ONLY)
endif(WITH_TESTS)

configure_file(${CMAKE_SOURCE_DIR}/src/ceph.in
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph @ONLY)
Expand All @@ -727,10 +730,15 @@ configure_file(${CMAKE_SOURCE_DIR}/src/init-ceph.in
configure_file(ceph-post-file.in
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-post-file @ONLY)

if(WITH_TESTS)
install(PROGRAMS
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-debugpack
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-coverage
DESTINATION bin)
endif(WITH_TESTS)

install(PROGRAMS
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-crush-location
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-post-file
${CMAKE_SOURCE_DIR}/src/ceph-run
Expand Down
2 changes: 2 additions & 0 deletions src/rgw/CMakeLists.txt
@@ -1,3 +1,4 @@
if(WITH_TESTS)
add_executable(ceph_rgw_jsonparser
rgw_jsonparser.cc)
target_link_libraries(ceph_rgw_jsonparser
Expand All @@ -14,6 +15,7 @@ install(TARGETS
ceph_rgw_jsonparser
ceph_rgw_multiparser
DESTINATION bin)
endif(WITH_TESTS)


set(rgw_a_srcs
Expand Down
6 changes: 6 additions & 0 deletions src/tools/CMakeLists.txt
Expand Up @@ -8,6 +8,7 @@ add_executable(rados ${rados_srcs})
target_link_libraries(rados librados global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} radosstriper)
install(TARGETS rados DESTINATION bin)

if(WITH_TESTS)
add_executable(ceph_scratchtool scratchtool.c)
target_link_libraries(ceph_scratchtool librados global)
install(TARGETS ceph_scratchtool DESTINATION bin)
Expand All @@ -30,6 +31,7 @@ install(TARGETS ceph-monstore-tool DESTINATION bin)
install(PROGRAMS
ceph-monstore-update-crush.sh
DESTINATION ${CMAKE_INSTALL_LIBDIR}/ceph)
endif(WITH_TESTS)

add_executable(ceph-objectstore-tool
ceph_objectstore_tool.cc
Expand All @@ -40,13 +42,15 @@ if(WITH_FUSE)
endif(WITH_FUSE)
install(TARGETS ceph-objectstore-tool DESTINATION bin)

if(WITH_TESTS)
add_executable(ceph-client-debug ceph-client-debug.cc)
target_link_libraries(ceph-client-debug cephfs global client)
install(TARGETS ceph-client-debug DESTINATION bin)

add_executable(ceph-kvstore-tool ceph_kvstore_tool.cc)
target_link_libraries(ceph-kvstore-tool os global)
install(TARGETS ceph-kvstore-tool DESTINATION bin)
endif(WITH_TESTS)

set(ceph_conf_srcs ceph_conf.cc)
add_executable(ceph-conf ${ceph_conf_srcs})
Expand All @@ -68,10 +72,12 @@ add_executable(osdmaptool ${osdomaptool_srcs})
target_link_libraries(osdmaptool global)
install(TARGETS osdmaptool DESTINATION bin)

if(WITH_TESTS)
set(ceph_psim_srcs psim.cc)
add_executable(ceph_psim ${ceph_psim_srcs})
target_link_libraries(ceph_psim global)
install(TARGETS ceph_psim DESTINATION bin)
endif(WITH_TESTS)

set(ceph_authtool_srcs ceph_authtool.cc)
add_executable(ceph-authtool ${ceph_authtool_srcs})
Expand Down

0 comments on commit ad1a2c1

Please sign in to comment.