diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-10-27 08:18:00 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-27 08:18:00 -0400 |
commit | ee6ed89e36f9c2ef1f57093e25bf5804ac6c856e (patch) | |
tree | ad7b8b58b12924e640c93f549fa33933936f558b /CMake/FindJsonC.cmake | |
parent | Merge pull request #1430 from dlrobertson/nvidia_drm (diff) | |
parent | Explicitly setting the version of json-c required (diff) | |
download | sway-ee6ed89e36f9c2ef1f57093e25bf5804ac6c856e.tar.gz sway-ee6ed89e36f9c2ef1f57093e25bf5804ac6c856e.tar.zst sway-ee6ed89e36f9c2ef1f57093e25bf5804ac6c856e.zip |
Merge pull request #1438 from mariusor/explicit_json-c_version
Explicitly setting the version of json-c required
Diffstat (limited to 'CMake/FindJsonC.cmake')
-rw-r--r-- | CMake/FindJsonC.cmake | 16 |
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 | ||
10 | find_package(PkgConfig) | 10 | find_package(PkgConfig) |
11 | pkg_check_modules(PC_JSONC QUIET JSONC) | 11 | |
12 | if (JsonC_FIND_REQUIRED) | ||
13 | set(_pkgconfig_REQUIRED "REQUIRED") | ||
14 | else() | ||
15 | set(_pkgconfig_REQUIRED "") | ||
16 | endif() | ||
17 | |||
18 | if(JsonC_FIND_VERSION) | ||
19 | pkg_check_modules(PC_JSONC ${_pkgconfig_REQUIRED} json-c=${JsonC_FIND_VERSION}) | ||
20 | else() | ||
21 | pkg_check_modules(PC_JSONC ${_pkgconfig_REQUIRED} json-c) | ||
22 | endif() | ||
23 | |||
12 | find_path(JSONC_INCLUDE_DIRS NAMES json-c/json.h HINTS ${PC_JSONC_INCLUDE_DIRS}) | 24 | find_path(JSONC_INCLUDE_DIRS NAMES json-c/json.h HINTS ${PC_JSONC_INCLUDE_DIRS}) |
13 | find_library(JSONC_LIBRARIES NAMES json-c HINTS ${PC_JSONC_LIBRARY_DIRS}) | 25 | find_library(JSONC_LIBRARIES NAMES json-c HINTS ${PC_JSONC_LIBRARY_DIRS}) |
14 | |||
15 | include(FindPackageHandleStandardArgs) | 26 | include(FindPackageHandleStandardArgs) |
27 | |||
16 | find_package_handle_standard_args(JSONC DEFAULT_MSG JSONC_LIBRARIES JSONC_INCLUDE_DIRS) | 28 | find_package_handle_standard_args(JSONC DEFAULT_MSG JSONC_LIBRARIES JSONC_INCLUDE_DIRS) |
17 | mark_as_advanced(JSONC_LIBRARIES JSONC_INCLUDE_DIRS) | 29 | mark_as_advanced(JSONC_LIBRARIES JSONC_INCLUDE_DIRS) |