forked from smartdevicelink/sdl_atf
-
Notifications
You must be signed in to change notification settings - Fork 1
/
FindBSON.cmake
33 lines (25 loc) · 973 Bytes
/
FindBSON.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
set(INCLUDE_PATH "${CMAKE_SOURCE_PREFIX}/include")
set(LIB_PATH "${CMAKE_SOURCE_PREFIX}/lib")
find_path(BSON_INCLUDE_DIRECTORY bson_object.h bson_array.h bson_util.h
PATHS "${INCLUDE_PATH}")
find_library(BSON_LIB
NAMES bson
PATHS ${LIB_PATH})
set(PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES})
set(CMAKE_FIND_LIBRARY_PREFIXES ";" ${PREFIXES})
find_library(LUA_BSON_LIB
NAMES bson4lua
PATHS ${LIB_PATH}/lua/5.2)
set(CMAKE_FIND_LIBRARY_PREFIXES ${PREFIXES})
find_path(EMHASHMAP_INCLUDE_DIRECTORY emhashmap.h
PATHS ${INCLUDE_PATH}
PATH_SUFFIXES emhashmap)
find_library(EMHASHMAP_LIB
NAMES emhashmap
PATHS ${LIB_PATH})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(BSON DEFAULT_MSG BSON_INCLUDE_DIRECTORY BSON_LIB
EMHASHMAP_INCLUDE_DIRECTORY EMHASHMAP_LIB LUA_BSON_LIB)
mark_as_advanced(BSON_INCLUDE_DIRECTORY BSON_LIB)
mark_as_advanced(EMHASHMAP_INCLUDE_DIRECTORY EMHASHMAP_LIB)
mark_as_advanced(LUA_BSON_LIB)