summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2015-11-29 14:10:00 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2015-11-30 09:53:47 +0100
commit1542738826dd0ed26cfc8f5e2e37ffe80f1b9676 (patch)
tree7eb7a6bfdb7f4217449741942253c2115e6ad5d7 /cmake
parent501c6d70a6a7357652e2a4fb1ad5856d90bde29b (diff)
downloadunitd-1542738826dd0ed26cfc8f5e2e37ffe80f1b9676.tar
unitd-1542738826dd0ed26cfc8f5e2e37ffe80f1b9676.zip
Rename to unitd, clean up CMakeLists.txt
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindJSON_C.cmake24
1 files changed, 24 insertions, 0 deletions
diff --git a/cmake/FindJSON_C.cmake b/cmake/FindJSON_C.cmake
new file mode 100644
index 0000000..e31a8b9
--- /dev/null
+++ b/cmake/FindJSON_C.cmake
@@ -0,0 +1,24 @@
+# Defines the following variables:
+# JSON_C_FOUND
+# JSON_C_INCLUDE_DIR
+# JSON_C_LIBRARIES
+# JSON_C_CFLAGS_OTHER
+# JSON_C_LDFLAGS_OTHER
+
+
+if(ANDROID)
+ find_host_package(PkgConfig REQUIRED QUIET)
+else(ANDROID)
+ find_package(PkgConfig REQUIRED QUIET)
+endif(ANDROID)
+
+pkg_check_modules(_JSON_C json-c)
+
+find_path(JSON_C_INCLUDE_DIR NAMES json-c/json.h HINTS ${_JSON_C_INCLUDE_DIRS})
+find_library(JSON_C_LIBRARIES NAMES json-c HINTS ${_JSON_C_LIBRARY_DIRS})
+
+set(JSON_C_CFLAGS_OTHER "${_JSON_C_CFLAGS_OTHER}" CACHE STRING "Additional compiler flags for json-c")
+set(JSON_C_LDFLAGS_OTHER "${_JSON_C_LDFLAGS_OTHER}" CACHE STRING "Additional linker flags for json-c")
+
+find_package_handle_standard_args(JSON_C REQUIRED_VARS JSON_C_LIBRARIES JSON_C_INCLUDE_DIR)
+mark_as_advanced(JSON_C_INCLUDE_DIR JSON_C_LIBRARIES JSON_C_CFLAGS_OTHER JSON_C_LDFLAGS_OTHER)