Skip to content

Commit

Permalink
CMake - add check for XFS
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Gryniewicz <[email protected]>
  • Loading branch information
dang committed Sep 23, 2015
1 parent 571215e commit 3570dd5
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ set(HAVE_LIBFUSE ${FUSE_FOUND})
CHECK_FUNCTION_EXISTS(fuse_getgroups HAVE_FUSE_GETGROUPS)
endif(${WITH_FUSE})

option(WITH_XFS "XFS is here" ON)
if(${WITH_XFS})
find_package(xfs)
set(HAVE_XFS ${XFS_FOUND})
endif(${WITH_XFS})

find_package(blkid REQUIRED)
set(HAVE_LIBBLKID ${BLKID_FOUND})

Expand Down
33 changes: 33 additions & 0 deletions cmake/modules/Findxfs.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Try to find xfs
# Once done, this will define
#
# XFS_FOUND - system has Profiler
# XFS_INCLUDE_DIR - the Profiler include directories
# XFS_LIBRARIES - link these to use Profiler

if(XFS_INCLUDE_DIR AND XFS_LIBRARIES)
set(XFS_FIND_QUIETLY TRUE)
endif(XFS_INCLUDE_DIR AND XFS_LIBRARIES)

INCLUDE(CheckCXXSymbolExists)

# include dir

find_path(XFS_INCLUDE_DIR xfs.h NO_DEFAULT_PATH PATHS
/usr/include
/usr/include/xfs
/opt/local/include
/usr/local/include
)


# finally the library itself
find_library(LIBXFS NAMES handle)
set(XFS_LIBRARIES ${LIBXFS})

# handle the QUIETLY and REQUIRED arguments and set XFS_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(xfs DEFAULT_MSG XFS_LIBRARIES XFS_INCLUDE_DIR)

mark_as_advanced(XFS_LIBRARIES XFS_INCLUDE_DIR)
9 changes: 7 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,11 @@ target_link_libraries(ceph-mon mon boost_thread common os global ${EXTRALIBS}
install(TARGETS ceph-mon DESTINATION bin)

# OSD
if(${HAVE_XFS})
set(libos_xfs_srcs
os/XfsFileStoreBackend.cc
os/fs/XFS.cc)
endif(${HAVE_XFS})
set(libos_srcs
os/FileJournal.cc
os/FileStore.cc
Expand All @@ -562,7 +567,6 @@ set(libos_srcs
os/GenericFileStoreBackend.cc
os/BtrfsFileStoreBackend.cc
os/ZFSFileStoreBackend.cc
os/XfsFileStoreBackend.cc
os/KeyValueStore.cc
os/KeyValueDB.cc
os/MemStore.cc
Expand All @@ -571,7 +575,8 @@ set(libos_srcs
os/newstore/NewStore.cc
os/newstore/newstore_types.cc
os/fs/FS.cc
os/fs/XFS.cc)
${libos_xfs_srcs})

set(os_mon_files
os/LevelDBStore.cc)
add_library(os_mon_objs OBJECT ${os_mon_files})
Expand Down

0 comments on commit 3570dd5

Please sign in to comment.