-
Notifications
You must be signed in to change notification settings - Fork 71
/
Findrados.cmake
61 lines (53 loc) · 1.74 KB
/
Findrados.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Copyright (c) 2017 [email protected]
# - Try to find the Rados library
# Once done this will define
#
# RADOS_ROOT - Set this variable to the root installation
#
# Read-Only variables:
# RADOS_FOUND - system has the Rados library
# RADOS_INCLUDE_DIR - the Rados include directory
# RADOS_LIBRARIES - The libraries needed to use Rados
# RADOS_VERSION - This is set to $major.$minor.$patch (eg. 0.9.8)
include(FindPackageHandleStandardArgs)
if(rados_FIND_REQUIRED)
set(_RADOS_output_type FATAL_ERROR)
else()
set(_RADOS_output_type STATUS)
endif()
if(rados_FIND_QUIETLY)
set(_RADOS_output)
else()
set(_RADOS_output 1)
endif()
find_path(_RADOS_INCLUDE_DIR rados/librados.hpp
HINTS ${CMAKE_SOURCE_DIR}/../../.. $ENV{RADOS_ROOT} ${RADOS_ROOT}
PATH_SUFFIXES include
PATHS /usr /usr/local /opt /opt/local)
find_library(RADOS_LIBRARY rados
HINTS ${CMAKE_SOURCE_DIR}/../../.. $ENV{RADOS_ROOT} ${RADOS_ROOT}
PATH_SUFFIXES lib lib64
PATHS /usr /usr/local /opt /opt/local)
if(rados_FIND_REQUIRED)
if(RADOS_LIBRARY MATCHES "RADOS_LIBRARY-NOTFOUND")
message(FATAL_ERROR "Missing the rados library.\n"
"Consider using CMAKE_PREFIX_PATH or the RADOS_ROOT environment variable. "
"See the ${CMAKE_CURRENT_LIST_FILE} for more details.")
endif()
endif()
find_package_handle_standard_args(rados DEFAULT_MSG
RADOS_LIBRARY _RADOS_INCLUDE_DIR)
if(_RADOS_EPIC_FAIL)
set(RADOS_FOUND FALSE)
set(RADOS_LIBRARY)
set(_RADOS_INCLUDE_DIR)
set(RADOS_INCLUDE_DIRS)
set(RADOS_LIBRARIES)
else()
set(RADOS_INCLUDE_DIRS ${_RADOS_INCLUDE_DIR})
set(RADOS_LIBRARIES ${RADOS_LIBRARY})
if(_RADOS_output)
message(STATUS
"Found rados in ${RADOS_INCLUDE_DIRS};${RADOS_LIBRARIES}")
endif()
endif()