From df7bc1890ea9b78db7e89ab3d24971369218dda0 Mon Sep 17 00:00:00 2001 From: tastytea Date: Sat, 2 May 2020 23:53:30 +0200 Subject: [PATCH] Change jsoncpp detection from CMake to pkg-config. Upstream no longer provides jsoncppConfig*.cmake. --- CMakeLists.txt | 2 +- src/CMakeLists.txt | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 72a6b9c..b4c3e16 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "The type of build.") option(BUILD_SHARED_LIBS "Build shared libraries." YES) project (mastorss - VERSION 0.11.0 + VERSION 0.11.1 DESCRIPTION "Another RSS to Mastodon bot." LANGUAGES CXX) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 550afed..e2df078 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,7 +2,8 @@ include(GNUInstallDirs) # The minimum versions should be in Debian oldstable, if possible. find_package(Boost 1.62 REQUIRED COMPONENTS filesystem log regex) -find_package(jsoncpp REQUIRED CONFIG) # 1.7.4 (Debian buster) has no version. +find_package(PkgConfig REQUIRED) +pkg_check_modules(jsoncpp REQUIRED IMPORTED_TARGET jsoncpp) find_package(CURL 7.52 REQUIRED) find_package(Threads REQUIRED) find_package(restclient-cpp 0.5 CONFIG) @@ -31,7 +32,7 @@ file(GLOB sources *.cpp) add_executable(mastorss ${sources}) target_link_libraries(mastorss PRIVATE - jsoncpp_lib restclient-cpp mastodonpp::mastodonpp + PkgConfig::jsoncpp restclient-cpp mastodonpp::mastodonpp Boost::filesystem Boost::log Boost::regex) if(BUILD_SHARED_LIBS) target_compile_definitions(mastorss PRIVATE "BOOST_ALL_DYN_LINK=1")