From: Kefu Chai Date: Wed, 7 Dec 2016 03:41:18 +0000 (+0800) Subject: cmake: find keyutils if rbd or libcephfs is enabled X-Git-Tag: v11.1.0~34^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b805505d254fafcd8a5654da41f8ac0e74f5576e;p=ceph.git cmake: find keyutils if rbd or libcephfs is enabled * find_package(keyutils REQUIRED) if (WITH_LIBCEPHFS OR WITH_RBD) prior to this change, we detect keyutils if the building platform is not FreeBSD, we should instead check the WITH_* options, and let the maintainer to decided what is the best for his/her platform, and error out if the building host cannot fulfill the requirement to build the asserts. * build krbd.cc if (WITH_RBD) Signed-off-by: Kefu Chai --- diff --git a/CMakeLists.txt b/CMakeLists.txt index a31877790948..c70e6648a138 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -285,10 +285,9 @@ else(ALLOCATOR) endif(GPERFTOOLS_FOUND) endif(ALLOCATOR) -if(NOT FREEBSD) - # XXX keyutils is available, but not yet recognised +if(WITH_LIBCEPHFS OR WITH_RBD) find_package(keyutils REQUIRED) -endif(NOT FREEBSD) +endif() find_package(CURL REQUIRED) set(CMAKE_REQUIRED_INCLUDES ${CURL_INCLUDE_DIRS}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 33f7ae954874..c145db07e06c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -628,19 +628,15 @@ if(${WITH_RADOSGW}) endif(${WITH_RADOSGW}) if(WITH_RBD) set(DENCODER_EXTRALIBS - ${DENCODER_EXTRALIBS} - rbd_types - cls_rbd_client - rbd_replay_types) - if(LINUX) - list(APPEND dencoder_srcs - $ - $) - set(DENCODER_EXTRALIBS - ${DENCODER_EXTRALIBS} - keyutils - udev) - endif(LINUX) + ${DENCODER_EXTRALIBS} + rbd_types + cls_rbd_client + rbd_replay_types + keyutils + udev) + list(APPEND dencoder_srcs + $ + $) endif(WITH_RBD) add_executable(ceph-dencoder ${dencoder_srcs}) @@ -820,7 +816,7 @@ install(PROGRAMS add_subdirectory(bash_completion) -if(KEYUTILS_FOUND) +if(WITH_LIBCEPHFS OR WITH_RBD) set(parse_secret_files common/secret.c) add_library(parse_secret_objs OBJECT ${parse_secret_files}) @@ -876,11 +872,8 @@ endif(WITH_LIBCEPHFS) add_subdirectory(journal) -if(LINUX) - add_library(krbd_objs OBJECT krbd.cc) -endif() - if(${WITH_RBD}) + add_library(krbd_objs OBJECT krbd.cc) add_subdirectory(librbd) if(WITH_FUSE) add_subdirectory(rbd_fuse)