-
Notifications
You must be signed in to change notification settings - Fork 0
/
FindLibMMDB.cmake
52 lines (46 loc) · 1.43 KB
/
FindLibMMDB.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
# - Try to find libmaxminddb headers and libraries
#
# Usage of this module as follows:
#
# find_package(LibMMDB)
#
# Variables used by this module, they can change the default behaviour and need
# to be set before calling find_package:
#
# LibMMDB_ROOT_DIR Set this variable to the root installation of
# libmaxminddb if the module has problems finding the
# proper installation path.
#
# Variables defined by this module:
#
# LibMMDB_FOUND System has libmaxminddb libraries and headers
# LibMMDB_LIBRARY The libmaxminddb library
# LibMMDB_INCLUDE_DIR The location of libmaxminddb headers
find_path(LibMMDB_ROOT_DIR
NAMES include/maxminddb.h
)
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# the static version of the library is preferred on OS X for the
# purposes of making packages (libmaxminddb doesn't ship w/ OS X)
set(libmmdb_names libmaxminddb.a maxminddb)
else ()
set(libmmdb_names maxminddb)
endif ()
find_library(LibMMDB_LIBRARY
NAMES ${libmmdb_names}
HINTS ${LibMMDB_ROOT_DIR}/lib
)
find_path(LibMMDB_INCLUDE_DIR
NAMES maxminddb.h
HINTS ${LibMMDB_ROOT_DIR}/include
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LibMMDB DEFAULT_MSG
LibMMDB_LIBRARY
LibMMDB_INCLUDE_DIR
)
mark_as_advanced(
LibMMDB_ROOT_DIR
LibMMDB_LIBRARY
LibMMDB_INCLUDE_DIR
)