-
Notifications
You must be signed in to change notification settings - Fork 242
/
FindRAPIDJSON.cmake
37 lines (30 loc) · 1.31 KB
/
FindRAPIDJSON.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
# Try find RapidJSON
#
# The following variables are set when RapidJSON is found:
# RAPIDJSON_FOUND = Set to true, if all components of RapidJSON have been found.
# RAPIDJSON_INCLUDES = Include path for the header files of RapidJSON
# RAPIDJSON_LIBRARIES = Link these to use RapidJSON
if (NOT RAPIDJSON_FOUND)
if (NOT RAPIDJSON_ROOT_DIR)
set (RAPIDJSON_ROOT_DIR ${CMAKE_INSTALL_PREFIX})
endif (NOT RAPIDJSON_ROOT_DIR)
find_path (RAPIDJSON_INCLUDES
NAMES rapidjson/rapidjson.h rapidjson/reader.h rapidjson/writer.h
HINTS ${RAPIDJSON_ROOT_DIR} ${CMAKE_INSTALL_PREFIX}
PATH_SUFFIXES include
)
find_package_handle_standard_args (RAPIDJSON DEFAULT_MSG RAPIDJSON_INCLUDES)
if (RAPIDJSON_FOUND)
get_filename_component (RAPIDJSON_ROOT_DIR ${RAPIDJSON_INCLUDES} PATH)
if (NOT RAPIDJSON_FIND_QUIETLY)
message (STATUS "Found components for RapidJSON")
message (STATUS "RAPIDJSON_ROOT_DIR = ${RAPIDJSON_ROOT_DIR}")
message (STATUS "RAPIDJSON_INCLUDES = ${RAPIDJSON_INCLUDES}")
endif (NOT RAPIDJSON_FIND_QUIETLY)
else (RAPIDJSON_FOUND)
if (RAPIDJSON_FIND_REQUIRED)
message (FATAL_ERROR "Could not find RapidJSON!")
endif (RAPIDJSON_FIND_REQUIRED)
endif (RAPIDJSON_FOUND)
mark_as_advanced(RAPIDJSON_ROOT_DIR RAPIDJSON_INCLUDES)
endif (NOT RAPIDJSON_FOUND)