diff --git a/CMakeLists.txt b/CMakeLists.txt index ada646e..a2a1b56 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,7 +41,8 @@ else() add_link_options("$<$:${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) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a4792c1..2efd0ae 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -11,7 +11,7 @@ target_include_directories(${PROJECT_NAME} PRIVATE "$") 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) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 6094c72..f934cd4 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -9,7 +9,7 @@ target_include_directories(${PROJECT_NAME}_testlib "$") 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)