Change jsoncpp detection from CMake to pkg-config.
continuous-integration/drone/push Build is failing Details

Upstream no longer provides jsoncppConfig*.cmake.
This commit is contained in:
tastytea 2020-05-02 23:53:30 +02:00
parent 41f013820c
commit df7bc1890e
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
2 changed files with 4 additions and 3 deletions

View File

@ -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)

View File

@ -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")