]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
CMake - add check for XFS
authorDaniel Gryniewicz <dang@fprintf.net>
Mon, 21 Sep 2015 16:18:43 +0000 (12:18 -0400)
committerDaniel Gryniewicz <dang@fprintf.net>
Wed, 23 Sep 2015 14:55:54 +0000 (10:55 -0400)
Signed-off-by: Daniel Gryniewicz <dang@fprintf.net>
CMakeLists.txt
cmake/modules/Findxfs.cmake [new file with mode: 0644]
src/CMakeLists.txt

index b41278734b376b64900452873f803da11ff2ca62..d9b37fb59912e24b973a11dc229fdba55709be3f 100644 (file)
@@ -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})
 
diff --git a/cmake/modules/Findxfs.cmake b/cmake/modules/Findxfs.cmake
new file mode 100644 (file)
index 0000000..ecbf91c
--- /dev/null
@@ -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)
index 582d4b9ad33b768045bd69653711a76c82a54ea2..058f52084b65a15941e03bfa29ccf701d09e5d7a 100644 (file)
@@ -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
@@ -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
@@ -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})