Module: kamailio Branch: 6.0 Commit: d0360fbb8e622c786f3d8791b67f06d1eb6e0ae4 URL: https://github.com/kamailio/kamailio/commit/d0360fbb8e622c786f3d8791b67f06d1...
Author: Xenofon Karamanos xk@gilawa.com Committer: Xenofon Karamanos 22965395+xkaraman@users.noreply.github.com Date: 2025-01-29T10:28:03Z
cmake/json: Remove find_package call. Use pkg-config instead.
(cherry picked from commit 99d36df0a15bbb960b2d7ee5916d65a55b9b26cd)
---
Modified: src/modules/json/CMakeLists.txt
---
Diff: https://github.com/kamailio/kamailio/commit/d0360fbb8e622c786f3d8791b67f06d1... Patch: https://github.com/kamailio/kamailio/commit/d0360fbb8e622c786f3d8791b67f06d1...
---
diff --git a/src/modules/json/CMakeLists.txt b/src/modules/json/CMakeLists.txt index 72df4d390f5..5d791dbd03d 100644 --- a/src/modules/json/CMakeLists.txt +++ b/src/modules/json/CMakeLists.txt @@ -2,13 +2,18 @@ file(GLOB MODULE_SOURCES "*.c")
add_library(${module_name} SHARED ${MODULE_SOURCES})
-find_package(json-c CONFIG) - -if(NOT json-c_FOUND) - message(STATUS "json-c not found. looking with pkg-config") - find_package(PkgConfig REQUIRED) - pkg_check_modules(json-c REQUIRED IMPORTED_TARGET json-c) - add_library(json-c::json-c ALIAS PkgConfig::json-c) -endif() +# TODO: When we have a proper cmake config file for json-c for most OS, we can +# use that instead of pkg-config. +# json-c v 0.14 and 0.15 have wrong include directories in their cmake config +# files. uncomment the following line when we have a proper cmake config file +# for json-c for most OS. +# find_package(json-c 0.16 CONFIG) + +# if(NOT json-c_FOUND) +message(STATUS "json-c not found. looking with pkg-config") +find_package(PkgConfig REQUIRED) +pkg_check_modules(json-c REQUIRED IMPORTED_TARGET json-c) +add_library(json-c::json-c ALIAS PkgConfig::json-c) +# endif()
target_link_libraries(${module_name} PRIVATE json-c::json-c)