aboutsummaryrefslogtreecommitdiff
path: root/CMake
diff options
context:
space:
mode:
authorminus <minus@mnus.de>2015-08-27 00:06:09 +0200
committerminus <minus@mnus.de>2015-08-27 00:06:09 +0200
commitc948432fb460fbd6d9304034293dcf691a30a628 (patch)
tree70816ebb76153e092381dbede629e1f8e89b2395 /CMake
parent2289029fabe919c670e19ed24baeac74846bc7b3 (diff)
fixed json-c CMake inclusion
Diffstat (limited to 'CMake')
-rw-r--r--CMake/FindJsonC.cmake17
1 files changed, 17 insertions, 0 deletions
diff --git a/CMake/FindJsonC.cmake b/CMake/FindJsonC.cmake
new file mode 100644
index 00000000..2ca0df39
--- /dev/null
+++ b/CMake/FindJsonC.cmake
@@ -0,0 +1,17 @@
+# - Find json-c
+# Find the json-c libraries
+#
+# This module defines the following variables:
+# JSONC_FOUND - True if JSONC is found
+# JSONC_LIBRARIES - JSONC libraries
+# JSONC_INCLUDE_DIRS - JSONC include directories
+#
+
+find_package(PkgConfig)
+pkg_check_modules(PC_JSONC QUIET JSONC)
+find_path(JSONC_INCLUDE_DIRS NAMES json-c/json.h HINTS ${PC_JSONC_INCLUDE_DIRS})
+find_library(JSONC_LIBRARIES NAMES json-c HINTS ${PC_JSONC_LIBRARY_DIRS})
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(JSONC DEFAULT_MSG JSONC_LIBRARIES JSONC_INCLUDE_DIRS)
+mark_as_advanced(JSONC_LIBRARIES JSONC_INCLUDE_DIRS)