summaryrefslogtreecommitdiffstats
path: root/cmake/modules/FindRapidJSON.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/modules/FindRapidJSON.cmake')
-rw-r--r--cmake/modules/FindRapidJSON.cmake40
1 files changed, 40 insertions, 0 deletions
diff --git a/cmake/modules/FindRapidJSON.cmake b/cmake/modules/FindRapidJSON.cmake
new file mode 100644
index 0000000..d41985b
--- /dev/null
+++ b/cmake/modules/FindRapidJSON.cmake
@@ -0,0 +1,40 @@
1#.rst:
2# FindRapidJSON
3# -----------
4# Finds the RapidJSON library
5#
6# This will define the following variables::
7#
8# RapidJSON_FOUND - system has RapidJSON parser
9# RapidJSON_INCLUDE_DIRS - the RapidJSON parser include directory
10#
11
12if(PKG_CONFIG_FOUND)
13 pkg_check_modules(PC_RapidJSON RapidJSON>=1.0.2 QUIET)
14endif()
15
16if(CORE_SYSTEM_NAME STREQUAL windows OR CORE_SYSTEM_NAME STREQUAL windowsstore)
17 set(RapidJSON_VERSION 1.1.0)
18else()
19 if(PC_RapidJSON_VERSION)
20 set(RapidJSON_VERSION ${PC_RapidJSON_VERSION})
21 else()
22 find_package(RapidJSON 1.1.0 CONFIG REQUIRED QUIET)
23 endif()
24endif()
25
26find_path(RapidJSON_INCLUDE_DIR NAMES rapidjson/rapidjson.h
27 PATHS ${PC_RapidJSON_INCLUDEDIR})
28
29
30include(FindPackageHandleStandardArgs)
31find_package_handle_standard_args(RapidJSON
32 REQUIRED_VARS RapidJSON_INCLUDE_DIR RapidJSON_VERSION
33 VERSION_VAR RapidJSON_VERSION)
34
35if(RAPIDJSON_FOUND)
36 set(RAPIDJSON_INCLUDE_DIRS ${RapidJSON_INCLUDE_DIR})
37endif()
38
39mark_as_advanced(RapidJSON_INCLUDE_DIR)
40