-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathFindJSONBOX.cmake
More file actions
47 lines (40 loc) · 1.05 KB
/
FindJSONBOX.cmake
File metadata and controls
47 lines (40 loc) · 1.05 KB
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
#
# Try to find JsonBox library and include path.
# Once done this will define
#
# JSONBOX_FOUND
# JSONBOX_INCLUDE_DIR
# JSONBOX_LIBRARIES
# JSONBOX_ROOT
#
set(FIND_JSONBOX_PATHS
${JSONBOX_ROOT}
$ENV{JSONBOX_ROOT}
/usr/local
/usr
/sw
/opt/local
/opt/csw
/opt)
if(JSONBOX_ROOT)
SET(JSONBOX_INCLUDE_DIR "${JSONBOX_ROOT}/include")
SET(JSONBOX_LIBRARIES "${JSONBOX_ROOT}/lib/libJsonBox.a")
SET(JSONBOX_FOUND 1)
endif(JSONBOX_ROOT)
find_path(JSONBOX_INCLUDE_DIR JsonBox/include/JsonBox.h
PATH_SUFFIXES include
PATHS ${FIND_JSONBOX_PATHS})
find_library(JSONBOX_LIBRARY
NAMES JsonBox
PATH_SUFFIXES lib
PATHS ${FIND_JSONBOX_PATHS})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(JSONBOX DEFAULT_MSG JSONBOX_LIBRARY JSONBOX_INCLUDE_DIR)
set(JSONBOX_INCLUDE_DIR "${JSONBOX_INCLUDE_DIR}")
set(JSONBOX_LIBRARIES "${JSONBOX_LIBRARY}")
if(NOT JSONBOX_FOUND)
set(FIND_JSONBOX_ERROR "Could NOT find JSONBOX")
if(JSONBOX_FIND_REQUIRED)
message(FATAL_ERROR ${FIND_JSONBOX_ERROR})
endif()
endif()