From 255afcea027cb45e770c164050cb1b65ef30f553 Mon Sep 17 00:00:00 2001 From: tastytea Date: Wed, 25 Dec 2019 22:50:25 +0100 Subject: [PATCH] Try to find restclient-cpp if its CMake config is not found. --- src/CMakeLists.txt | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f01338e..6a73789 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,9 +5,22 @@ find_package(Boost 1.62 REQUIRED COMPONENTS filesystem log) find_package(jsoncpp REQUIRED CONFIG) # 1.7.4 (Debian buster) has no version. find_package(CURL 7.52 REQUIRED) find_package(Threads REQUIRED) -find_package(restclient-cpp 0.5 REQUIRED CONFIG) +find_package(restclient-cpp 0.5 CONFIG) find_package(mastodon-cpp REQUIRED CONFIG) +if(NOT ${restclient-cpp_FOUND}) + find_file(restclient_h NAMES "restclient-cpp/restclient.h" + PATHS "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}") + if("${restclient_h}" STREQUAL "restclient_h-NOTFOUND") + message(FATAL_ERROR "Could not find restclient-cpp.") + else() + message(WARNING + "Your distribution of restclient-cpp doesn't contain the *Config.cmake " + "recipes, but the files seem to be in the standard directories. " + "Let's hope this works.") + endif() +endif() + # Write version in header. configure_file ( "${PROJECT_SOURCE_DIR}/src/version.hpp.in"