From 88f7df7d1a1b5267c0ebbf2dd2e3185070975401 Mon Sep 17 00:00:00 2001 From: Daniel Gryniewicz Date: Mon, 21 Sep 2015 11:37:18 -0400 Subject: [PATCH] CMake - add check for libuuid Signed-off-by: Daniel Gryniewicz --- CMakeLists.txt | 2 ++ cmake/modules/Findlibuuid.cmake | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 cmake/modules/Findlibuuid.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index a7837a9b423a1..7c5ac0deab716 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 0000000000000..a2d1fbc57faab --- /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) -- 2.39.5