From: Daniel Gryniewicz Date: Mon, 21 Sep 2015 15:37:18 +0000 (-0400) Subject: CMake - add check for libuuid X-Git-Tag: v9.1.0~84^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=88f7df7d1a1b5267c0ebbf2dd2e3185070975401;p=ceph.git CMake - add check for libuuid Signed-off-by: Daniel Gryniewicz --- diff --git a/CMakeLists.txt b/CMakeLists.txt index a7837a9b423a..7c5ac0deab71 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -176,6 +176,8 @@ endif(${WITH_TCMALLOC}) find_package(keyutils REQUIRED) +find_package(libuuid REQUIRED) + option(USE_CRYPTOPP "Cryptopp is ON" ON) find_package(cryptopp) if(CRYPTOPP_FOUND) diff --git a/cmake/modules/Findlibuuid.cmake b/cmake/modules/Findlibuuid.cmake new file mode 100644 index 000000000000..a2d1fbc57faa --- /dev/null +++ b/cmake/modules/Findlibuuid.cmake @@ -0,0 +1,33 @@ +# Try to find libuuid +# Once done, this will define +# +# UUID_FOUND - system has Profiler +# UUID_INCLUDE_DIR - the Profiler include directories +# UUID_LIBRARIES - link these to use Profiler + +if(UUID_INCLUDE_DIR AND UUID_LIBRARIES) + set(UUID_FIND_QUIETLY TRUE) +endif(UUID_INCLUDE_DIR AND UUID_LIBRARIES) + +INCLUDE(CheckCXXSymbolExists) + +# include dir + +find_path(UUID_INCLUDE_DIR uuid.h NO_DEFAULT_PATH PATHS + /usr/include + /usr/include/uuid + /opt/local/include + /usr/local/include +) + + +# finally the library itself +find_library(LIBUUID NAMES uuid) +set(UUID_LIBRARIES ${LIBUUID}) + +# handle the QUIETLY and REQUIRED arguments and set UUID_FOUND to TRUE if +# all listed variables are TRUE +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(libuuid DEFAULT_MSG UUID_LIBRARIES UUID_INCLUDE_DIR) + +mark_as_advanced(UUID_LIBRARIES UUID_INCLUDE_DIR)