-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFindMongoDBCPlusPlusDriver.cmake
88 lines (73 loc) · 2.52 KB
/
FindMongoDBCPlusPlusDriver.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
SET(SEARCH_PATH_MONGODBCPLUSPLUSDRIVER "" CACHE PATH "Additional MongoDBCPlusPlusDriver search path")
if(CMAKE_SYSTEM MATCHES "Windows")
set(MONGODBCPLUSPLUSDRIVER_DIR_SEARCH
$ENV{MONGODBCPLUSPLUSDRIVER_ROOT}
${SEARCH_PATH_MONGODBCPLUSPLUSDRIVER}
${MONGODBCPLUSPLUSDRIVER_DIR_SEARCH}
)
if (EXISTS "C:/")
set(MONGODBCPLUSPLUSDRIVER_DIR_SEARCH
${MONGODBCPLUSPLUSDRIVER_DIR_SEARCH}
C:/Development
"C:/Development/moja.global/Third Party"
"C:/Program Files/"
"C:/Program Files/mongo"
"C:/Program Files/mongo-cxx-driver"
)
endif()
if (EXISTS "D:/")
set(MONGODBCPLUSPLUSDRIVER_DIR_SEARCH
${MONGODBCPLUSPLUSDRIVER_DIR_SEARCH}
D:/Development
"D:/Development/moja.global/Third Party"
"D:/Program Files/"
"D:/Program Files/mongo"
"D:/Program Files/mongo-cxx-driver"
)
endif()
endif()
if (CMAKE_SYSTEM MATCHES "Linux" )
set(MONGODBCPLUSPLUSDRIVER_DIR_SEARCH
$ENV{MONGODBCPLUSPLUSDRIVER_ROOT}
${SEARCH_PATH_MONGODBCPLUSPLUSDRIVER}
${MONGODBCPLUSPLUSDRIVER_DIR_SEARCH}
/home/vagrant/moja.global/Third Party/
/usr/
/Library/Frameworks
/System/Library/Frameworks
/Network/Library/Frameworks
)
endif(CMAKE_SYSTEM MATCHES "Linux")
# Add in some path suffixes. These will have to be updated whenever a new Driver version version comes out.
SET(SUFFIX_FOR_INCLUDE_PATH
mongo-cxx-driver-legacy-1.1.0/include
mongo-cxx-driver-legacy-1.0.6/include
mongo-cxx-driver/include
)
# MESSAGE("SUFFIX_FOR_INCLUDE_PATH: " ${SUFFIX_FOR_INCLUDE_PATH})
find_path(MONGODBCPLUSPLUSDRIVER_INCLUDE_PATH mongo/config.h
HINTS
$ENV{MONGODBCPLUSPLUSDRIVER_ROOT}
PATH_SUFFIXES ${SUFFIX_FOR_INCLUDE_PATH}
PATHS
${MONGODBCPLUSPLUSDRIVER_DIR_SEARCH}
)
SET(SUFFIX_FOR_LIBRARY_PATH
mongo-cxx-driver-legacy-1.1.0/lib
mongo-cxx-driver-legacy-1.0.6/lib
mongo-cxx-driver/lib
)
IF(NOT MONGODBCPLUSPLUSDRIVER_LIBRARY_DIR)
FIND_LIBRARY(MONGODBCPLUSPLUSDRIVER_LIB NAMES mongoclient mongoclient-gd libmongoclient libmongoclient-gd
PATH_SUFFIXES
${SUFFIX_FOR_LIBRARY_PATH}
PATHS # Look in other places.
${MONGODBCPLUSPLUSDRIVER_DIR_SEARCH}
)
GET_FILENAME_COMPONENT(MONGODBCPLUSPLUSDRIVER_LIBRARY_DIR ${MONGODBCPLUSPLUSDRIVER_LIB} PATH CACHE)
ENDIF(NOT MONGODBCPLUSPLUSDRIVER_LIBRARY_DIR)
# handle the QUIETLY and REQUIRED arguments and set OPENAL_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MONGODBCPLUSPLUSDRIVER DEFAULT_MSG MONGODBCPLUSPLUSDRIVER_INCLUDE_PATH)
mark_as_advanced(MONGODBCPLUSPLUSDRIVER_INCLUDE_PATH)