forked from tumi8/vermont
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFindMONGO.cmake
58 lines (46 loc) · 1.6 KB
/
FindMONGO.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
# - Find MongoDB
# Find the MongoDB includes and client library
# This module defines
# MONGO_INCLUDE_DIR, where to find client/dbclient.h
# MONGO_LIBRARIES, the libraries needed to use MONGO.
# MONGO_FOUND, If false, do not try to use MongoDB.
#
# Copyright (c) 2011, Philipp Fehre, <[email protected]>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
# Add the mongodb include paths here
if(MONGO_INCLUDE_DIR AND MONGO_LIBRARIES)
set(MONGO_FOUND TRUE)
else(MONGO_INCLUDE_DIR AND MONGO_LIBRARIES)
find_path(MONGO_INCLUDE_DIR client/dbclient.h
/usr/include/mongo
/usr/local/include/mongo
/opt/local/include/mongo
)
find_library(MONGO_LIBRARIES NAMES mongoclient libmongoclient
PATHS
/usr/lib
/usr/local/lib
/opt/local/lib
)
if(MONGO_INCLUDE_DIR AND MONGO_LIBRARIES)
set(MONGO_FOUND TRUE)
message(STATUS "Found MongoDB: ${MONGO_INCLUDE_DIR}, ${MONGO_LIBRARIES}")
INCLUDE_DIRECTORIES(${MONGO_INCLUDE_DIR})
else(MONGO_INCLUDE_DIR AND MONGO_LIBRARIES)
set(MONGO_FOUND FALSE)
message(STATUS "MongoDB not found.")
endif(MONGO_INCLUDE_DIR AND MONGO_LIBRARIES)
mark_as_advanced(MONGO_INCLUDE_DIR MONGO_LIBRARIES)
mark_as_advanced(MONGO_VERSION_CHECK)
endif(MONGO_INCLUDE_DIR AND MONGO_LIBRARIES)
if (MONGO_FOUND)
find_path(MONGO_VERSION_CHECK util/net/hostandport.h
/usr/include/mongo/
/usr/local/include/mongo/
/opt/local/include/mongo)
if (MONGO_VERSION_CHECK)
set (MONGO_VERSION_2 TRUE)
endif(MONGO_VERSION_CHECK)
endif (MONGO_FOUND)