aboutsummaryrefslogtreecommitdiffstats
path: root/CMake
diff options
context:
space:
mode:
authorLibravatar Marius Orcsik <marius.orcsik@rocket-internet.de>2017-10-27 12:14:40 +0200
committerLibravatar Marius Orcsik <marius.orcsik@rocket-internet.de>2017-10-27 12:17:02 +0200
commit69e9b1386ffa2f78bfa69ccd84e815c9f1d5920e (patch)
treead7b8b58b12924e640c93f549fa33933936f558b /CMake
parentMerge pull request #1430 from dlrobertson/nvidia_drm (diff)
downloadsway-69e9b1386ffa2f78bfa69ccd84e815c9f1d5920e.tar.gz
sway-69e9b1386ffa2f78bfa69ccd84e815c9f1d5920e.tar.zst
sway-69e9b1386ffa2f78bfa69ccd84e815c9f1d5920e.zip
Explicitly setting the version of json-c required
to 0.12.1. This is needed because the development version breaks the existing API of json_object_array_length() by moving the return from int to size_t. This would fix #1355
Diffstat (limited to 'CMake')
-rw-r--r--CMake/FindJsonC.cmake16
1 files changed, 14 insertions, 2 deletions
diff --git a/CMake/FindJsonC.cmake b/CMake/FindJsonC.cmake
index 2ca0df39..bbf6930c 100644
--- a/CMake/FindJsonC.cmake
+++ b/CMake/FindJsonC.cmake
@@ -8,10 +8,22 @@
8# 8#
9 9
10find_package(PkgConfig) 10find_package(PkgConfig)
11pkg_check_modules(PC_JSONC QUIET JSONC) 11
12if (JsonC_FIND_REQUIRED)
13 set(_pkgconfig_REQUIRED "REQUIRED")
14else()
15 set(_pkgconfig_REQUIRED "")
16endif()
17
18if(JsonC_FIND_VERSION)
19 pkg_check_modules(PC_JSONC ${_pkgconfig_REQUIRED} json-c=${JsonC_FIND_VERSION})
20else()
21 pkg_check_modules(PC_JSONC ${_pkgconfig_REQUIRED} json-c)
22endif()
23
12find_path(JSONC_INCLUDE_DIRS NAMES json-c/json.h HINTS ${PC_JSONC_INCLUDE_DIRS}) 24find_path(JSONC_INCLUDE_DIRS NAMES json-c/json.h HINTS ${PC_JSONC_INCLUDE_DIRS})
13find_library(JSONC_LIBRARIES NAMES json-c HINTS ${PC_JSONC_LIBRARY_DIRS}) 25find_library(JSONC_LIBRARIES NAMES json-c HINTS ${PC_JSONC_LIBRARY_DIRS})
14
15include(FindPackageHandleStandardArgs) 26include(FindPackageHandleStandardArgs)
27
16find_package_handle_standard_args(JSONC DEFAULT_MSG JSONC_LIBRARIES JSONC_INCLUDE_DIRS) 28find_package_handle_standard_args(JSONC DEFAULT_MSG JSONC_LIBRARIES JSONC_INCLUDE_DIRS)
17mark_as_advanced(JSONC_LIBRARIES JSONC_INCLUDE_DIRS) 29mark_as_advanced(JSONC_LIBRARIES JSONC_INCLUDE_DIRS)