Merge pull request #5455 from ceph/wip-cephfs-cmake

CMake fixes for CephFS

Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2015-08-04 01:18:47 +08:00
commit 12c4e7dac9
4 changed files with 89 additions and 45 deletions

View File

@ -117,6 +117,9 @@ set(HAVE_LIBFUSE ${FUSE_FOUND})
CHECK_FUNCTION_EXISTS(fuse_getgroups HAVE_FUSE_GETGROUPS)
endif(${WITH_FUSE})
find_package(blkid REQUIRED)
set(HAVE_LIBBLKID ${BLKID_FOUND})
# probably fuse etc need this -- how to check? XXX
option(WITH_MDS "MDS is here" ON)
@ -129,10 +132,6 @@ option(WITH_KVS "Key value store is here" ON)
# remote block storage
option(WITH_RBD "Remote block storage is here" ON)
if(${WITH_RBD})
find_package(blkid REQUIRED)
set(HAVE_LIBBLKID ${BLKID_FOUND})
endif(${WITH_RBD})
option(WITH_LEVELDB "LevelDB is here" ON)
if(${WITH_LEVELDB})
@ -207,6 +206,9 @@ endif(WITH_XIO)
#option for RGW
option(WITH_RADOSGW "Rados Gateway is enabled" ON)
#option for CephFS
option(WITH_CEPHFS "CephFS is enabled" ON)
# Now create a useable config.h
configure_file(
${PROJECT_SOURCE_DIR}/src/include/config-h.in.cmake

View File

@ -316,14 +316,11 @@ add_subdirectory(cls)
# RADOS client/library
set(osdc_files
osdc/Objecter.cc)
osdc/Objecter.cc
osdc/Filer.cc)
set(osdc_rbd_files
osdc/ObjectCacher.cc
osdc/Striper.cc)
if(${WITH_CLIENT})
list(APPEND osdc_files
osdc/Filer.cc)
endif(${WITH_CLIENT})
add_library(osdc_rbd_objs OBJECT ${osdc_rbd_files})
add_library(osdc STATIC ${osdc_files} $<TARGET_OBJECTS:osdc_rbd_objs>)
@ -340,6 +337,7 @@ add_library(librados ${CEPH_SHARED} ${librados_srcs}
$<TARGET_OBJECTS:common_util_obj>)
add_dependencies(librados osdc)
target_link_libraries(librados PRIVATE osdc osd os global common cls_lock_client
${BLKID_LIBRARIES}
${CRYPTO_LIBS} ${EXTRALIBS} ${TCMALLOC_LIBS})
if(${ENABLE_SHARED})
set_target_properties(librados PROPERTIES OUTPUT_NAME rados VERSION 2.0.0
@ -371,6 +369,42 @@ set(rados_srcs
add_executable(rados ${rados_srcs} $<TARGET_OBJECTS:heap_profiler_objs>)
target_link_libraries(rados librados global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} libradosstriper)
if (WITH_CEPHFS)
set(cephfs_journal_tool_srcs
tools/cephfs/cephfs-journal-tool.cc
tools/cephfs/JournalTool.cc
tools/cephfs/JournalFilter.cc
tools/cephfs/JournalScanner.cc
tools/cephfs/EventOutput.cc
tools/cephfs/Dumper.cc
tools/cephfs/Resetter.cc
tools/cephfs/MDSUtility.cc)
add_executable(cephfs-journal-tool ${cephfs_journal_tool_srcs}
$<TARGET_OBJECTS:heap_profiler_objs>)
target_link_libraries(cephfs-journal-tool librados mds osdc global
${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS})
set(cephfs_table_tool_srcs
tools/cephfs/cephfs-table-tool.cc
tools/cephfs/TableTool.cc
tools/cephfs/MDSUtility.cc)
add_executable(cephfs-table-tool ${cephfs_table_tool_srcs}
$<TARGET_OBJECTS:heap_profiler_objs>)
target_link_libraries(cephfs-table-tool librados mds osdc global
${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS})
set(cephfs_data_scan_srcs
tools/cephfs/cephfs-data-scan.cc
tools/cephfs/DataScan.cc
tools/cephfs/MDSUtility.cc)
add_executable(cephfs-data-scan ${cephfs_data_scan_srcs}
$<TARGET_OBJECTS:heap_profiler_objs>)
target_link_libraries(cephfs-data-scan librados mds osdc global
cls_cephfs_client
${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS})
endif (WITH_CEPHFS)
set(librados_config_srcs
librados-config.cc)
add_executable(librados-config ${librados_config_srcs}
@ -544,6 +578,11 @@ endif(${WITH_MDS})
add_subdirectory(erasure-code)
set(crushtool_srcs
tools/crushtool.cc)
add_executable(crushtool ${crushtool_srcs})
target_link_libraries(crushtool global)
# Support/Tools
add_subdirectory(gmock)
add_subdirectory(test)
@ -622,6 +661,10 @@ install(PROGRAMS
${CMAKE_SOURCE_DIR}/src/ceph-disk-udev
DESTINATION sbin)
set(parse_secret_files
common/secret.c)
add_library(parse_secret_objs OBJECT ${parse_secret_files})
if(WITH_LIBCEPHFS)
set(libclient_srcs
client/Client.cc
@ -649,8 +692,8 @@ if(WITH_LIBCEPHFS)
set(mount_ceph_srcs
mount/mount.ceph.c)
add_executable(mount.ceph ${mount_ceph_srcs}
$<TARGET_OBJECTS:common_mountcephfs_objs>
$<TARGET_OBJECTS:rbd_mountcephfs_objs>)
$<TARGET_OBJECTS:parse_secret_objs>
$<TARGET_OBJECTS:common_mountcephfs_objs>)
target_link_libraries(mount.ceph keyutils)
install(TARGETS ceph-syn DESTINATION bin)
@ -699,14 +742,11 @@ if(${WITH_RBD})
install(TARGETS librados librbd DESTINATION lib)
set(rbd_srcs
rbd.cc common/TextTable.cc)
set(rbd_mountcephfs_files
common/secret.c)
add_library(rbd_mountcephfs_objs OBJECT ${rbd_mountcephfs_files})
add_executable(rbd ${rbd_srcs} $<TARGET_OBJECTS:common_util_obj>
$<TARGET_OBJECTS:rbd_mountcephfs_objs>
$<TARGET_OBJECTS:parse_secret_objs>
$<TARGET_OBJECTS:heap_profiler_objs>)
set_target_properties(rbd PROPERTIES OUTPUT_NAME rbd)
target_link_libraries(rbd global librbd librados common keyutils udev
target_link_libraries(rbd librbd librados common keyutils udev
${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS})
install(TARGETS rbd DESTINATION bin)
install(PROGRAMS ${CMAKE_SOURCE_DIR}/src/ceph-rbdnamer DESTINATION bin)

View File

@ -100,10 +100,10 @@ endif (WITH_RADOSGW)
# cls_cephfs
if (WITH_CEPHFS)
add_library(cls_cephfs SHARED
rgw/cls_cephfs.cc)
cephfs/cls_cephfs.cc)
set_target_properties(cls_cephfs PROPERTIES VERSION "1.0.0" SOVERSION "1")
install(TARGETS cls_cephfs DESTINATION lib/rados-classes)
add_library(cls_cephfs_client
rgw/cls_cephfs_client.cc)
cephfs/cls_cephfs_client.cc)
endif (WITH_CEPHFS)

View File

@ -206,31 +206,33 @@ target_link_libraries(smalliobenchdumb librados boost_program_options os global
${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS})
# smalliobenchrbd
set(smalliobenchrbd_srcs
bench/small_io_bench_rbd.cc
bench/rbd_backend.cc
bench/detailed_stat_collector.cc
bench/bencher.cc
${CMAKE_SOURCE_DIR}/src/common/TextTable.cc
${CMAKE_SOURCE_DIR}/src/common/secret.c
)
add_executable(smalliobenchrbd
${smalliobenchrbd_srcs}
$<TARGET_OBJECTS:heap_profiler_objs>
)
target_link_libraries(smalliobenchrbd
librbd
librados
os
global
boost_program_options
blkid
udev
${BLKID_LIBRARIES}
${CMAKE_DL_LIBS}
${TCMALLOC_LIBS}
keyutils
if (${WITH_RBD})
set(smalliobenchrbd_srcs
bench/small_io_bench_rbd.cc
bench/rbd_backend.cc
bench/detailed_stat_collector.cc
bench/bencher.cc
${CMAKE_SOURCE_DIR}/src/common/TextTable.cc
${CMAKE_SOURCE_DIR}/src/common/secret.c
)
add_executable(smalliobenchrbd
${smalliobenchrbd_srcs}
$<TARGET_OBJECTS:heap_profiler_objs>
)
target_link_libraries(smalliobenchrbd
librbd
librados
os
global
boost_program_options
blkid
udev
${BLKID_LIBRARIES}
${CMAKE_DL_LIBS}
${TCMALLOC_LIBS}
keyutils
)
endif (${WITH_RBD})
# tpbench
set(tpbench_srcs
@ -1571,7 +1573,7 @@ if(${WITH_CEPHFS})
set_target_properties(test_libcephfs PROPERTIES COMPILE_FLAGS
${UNITTEST_CXX_FLAGS})
target_link_libraries(test_libcephfs
libcephfs
cephfs
${UNITTEST_LIBS}
${EXTRALIBS}
${TCMALLOC_LIBS}
@ -1776,9 +1778,9 @@ if(${WITH_CEPHFS})
)
target_link_libraries(test_c_headers
librados
rados
libcephfs
cephfs
${EXTRALIBS}
${BLKID_LIBRARIES}
${TCMALLOC_LIBS}
${CMAKE_DL_LIBS}
)