From: Willem Jan Withagen Date: Fri, 20 Sep 2019 14:02:23 +0000 (+0200) Subject: cmake: Allow cephfs and ceph-mds to be build when building on FreeBSD X-Git-Tag: v15.1.0~1282^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F30494%2Fhead;p=ceph.git cmake: Allow cephfs and ceph-mds to be build when building on FreeBSD on FreeBSD keyutil absence prevents building KRBD and mount. But on FreeBSD icephfs, ceph-fuse and ceph-mds do work, so we need ceph-mds to be build. Signed-off-by: Willem Jan Withagen --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 354a51a8977d..606211cd6cb5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -132,10 +132,13 @@ if(LINUX) set(HAVE_UDEV ${UDEV_FOUND}) find_package(blkid REQUIRED) set(HAVE_BLKID ${BLKID_FOUND}) + find_package(keyutils REQUIRED) + set(HAVE_KEYUTILS ${KEYUTILS_FOUND}) elseif(FREEBSD) set(HAVE_UDEV OFF) set(HAVE_LIBAIO OFF) set(HAVE_BLKID OFF) + set(HAVE_KEYUTILS OFF) else() set(HAVE_UDEV OFF) set(HAVE_BLKID OFF) @@ -231,6 +234,13 @@ option(WITH_KRBD "Enable Linux krbd support of 'rbd' utility" ON) if(WITH_KRBD AND NOT WITH_RBD) message(FATAL_ERROR "Cannot have WITH_KRBD without WITH_RBD.") endif() +if(LINUX) + if(WITH_LIBCEPHFS OR WITH_KRBD) + # keyutils is only used when talking to the Linux Kernel key store + find_package(keyutils REQUIRED) + set(HAVE_KEYUTILS ${KEYUTILS_FOUND}) + endif() +endif() option(WITH_LEVELDB "LevelDB is here" ON) if(WITH_LEVELDB) @@ -301,10 +311,6 @@ if (HAVE_LIBTCMALLOC AND TCMALLOC_VERSION_STRING VERSION_LESS 2.6.2) set(LIBTCMALLOC_MISSING_ALIGNED_ALLOC ON) endif() -if(WITH_LIBCEPHFS OR WITH_KRBD) - find_package(keyutils REQUIRED) -endif() - find_package(CURL REQUIRED) set(CMAKE_REQUIRED_INCLUDES ${CURL_INCLUDE_DIRS}) set(CMAKE_REQUIRED_LIBRARIES ${CURL_LIBRARIES}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 60e261b10e60..5610c8857bf5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -640,8 +640,6 @@ add_subdirectory(bash_completion) add_subdirectory(client) if(WITH_LIBCEPHFS) - find_package(PkgConfig QUIET REQUIRED) - pkg_check_modules(CAPNG REQUIRED libcap-ng) set(libcephfs_srcs libcephfs.cc) add_library(cephfs ${CEPH_SHARED} ${libcephfs_srcs}) target_link_libraries(cephfs PRIVATE client ceph-common @@ -668,7 +666,9 @@ if(WITH_LIBCEPHFS) add_executable(ceph-syn ${ceph_syn_srcs}) target_link_libraries(ceph-syn client global-static ceph-common) install(TARGETS ceph-syn DESTINATION bin) - add_subdirectory(mount) + if(LINUX) + add_subdirectory(mount) + endif() endif(WITH_LIBCEPHFS) if(WITH_FUSE) diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 222833fa4af6..c97051fb4ae6 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -177,7 +177,7 @@ target_link_libraries(crc32 add_library(common_utf8 STATIC utf8.c) -if(WITH_LIBCEPHFS OR WITH_KRBD) +if(HAVE_KEYUTILS) set(parse_secret_srcs secret.c) add_library(parse_secret_objs OBJECT ${parse_secret_srcs}) diff --git a/src/mount/CMakeLists.txt b/src/mount/CMakeLists.txt index 67e7130e9e06..605ca2f67c73 100644 --- a/src/mount/CMakeLists.txt +++ b/src/mount/CMakeLists.txt @@ -1,3 +1,6 @@ +find_package(PkgConfig QUIET REQUIRED) +pkg_check_modules(CAPNG REQUIRED libcap-ng) + set(mount_ceph_srcs mount.ceph.c conf.cc) add_executable(mount.ceph ${mount_ceph_srcs}