소스 검색

cmake: Use pkg-config instead for json-c dev package.

Xenofon Karamanos 7 달 전
부모
커밋
e7f9531adc
4개의 변경된 파일41개의 추가작업 그리고 23개의 파일을 삭제
  1. 1 1
      src/modules/json/CMakeLists.txt
  2. 13 7
      src/modules/jsonrpcc/CMakeLists.txt
  3. 14 8
      src/modules/kazoo/CMakeLists.txt
  4. 13 7
      src/modules/pua_json/CMakeLists.txt

+ 1 - 1
src/modules/json/CMakeLists.txt

@@ -10,7 +10,7 @@ add_library(${module_name} SHARED ${MODULE_SOURCES})
 # find_package(json-c 0.16 CONFIG)
 
 # if(NOT json-c_FOUND)
-message(STATUS "json-c not found. looking with pkg-config")
+# 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)

+ 13 - 7
src/modules/jsonrpcc/CMakeLists.txt

@@ -2,12 +2,18 @@ file(GLOB MODULE_SOURCES "*.c")
 
 add_library(${module_name} SHARED ${MODULE_SOURCES})
 
-find_package(json-c QUIET)
-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)

+ 14 - 8
src/modules/kazoo/CMakeLists.txt

@@ -4,15 +4,21 @@ add_library(${module_name} SHARED ${MODULE_SOURCES})
 
 # TODO: Create its own FindJsonC.cmake module since it;s used by multiple
 # modules throughout the project
-find_package(json-c QUIET)
-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()
 
-find_package(rabbitmq-c 0.13 QUIET)
+find_package(rabbitmq-c 0.13)
 if(NOT rabbitmq-c_FOUND)
   message(STATUS "rabbitmq-c not found. looking with pkg-config")
   find_package(PkgConfig REQUIRED)

+ 13 - 7
src/modules/pua_json/CMakeLists.txt

@@ -2,12 +2,18 @@ file(GLOB MODULE_SOURCES "*.c")
 
 add_library(${module_name} SHARED ${MODULE_SOURCES})
 
-find_package(json-c QUIET)
-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)