Change jsoncpp discovery from CMake to pkg-config.
Some checks failed
continuous-integration/drone/push Build is failing

CMake is deprecated by upstream.
This commit is contained in:
tastytea 2020-05-01 20:30:07 +02:00
parent 095645ba6e
commit 5906db11da
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
3 changed files with 4 additions and 3 deletions

View File

@ -41,7 +41,8 @@ else()
add_link_options("$<$<CONFIG:Debug>:${DEBUG_LDFLAGS}>")
endif()
find_package(jsoncpp CONFIG REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(jsoncpp REQUIRED IMPORTED_TARGET jsoncpp)
# Some distributions do not contain Poco*Config.cmake recipes.
find_package(Poco COMPONENTS Foundation Net NetSSL CONFIG)

View File

@ -11,7 +11,7 @@ target_include_directories(${PROJECT_NAME}
PRIVATE "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>")
target_link_libraries(${PROJECT_NAME}
PRIVATE jsoncpp_lib)
PRIVATE PkgConfig::jsoncpp)
# If no Poco*Config.cmake recipes are found, look for headers in standard dirs.
if(PocoNetSSL_FOUND)

View File

@ -9,7 +9,7 @@ target_include_directories(${PROJECT_NAME}_testlib
"$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/src>")
target_link_libraries(${PROJECT_NAME}_testlib
PRIVATE Poco::Foundation Poco::Net Poco::NetSSL jsoncpp_lib)
PRIVATE Poco::Foundation Poco::Net Poco::NetSSL PkgConfig::jsoncpp)
file(GLOB sources_tests test_*.cpp)