Added workaround for when Poco*Config.cmake recipes cannot be found.
continuous-integration/drone/push Build is failing Details

This commit is contained in:
tastytea 2019-08-04 20:04:55 +02:00
parent 9d0dd589a7
commit 5e18bbdf50
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 22 additions and 3 deletions

View File

@ -3,7 +3,7 @@ include(GNUInstallDirs)
find_package(PkgConfig REQUIRED)
pkg_check_modules(libxdg-basedir REQUIRED IMPORTED_TARGET libxdg-basedir)
find_package(ICU COMPONENTS uc i18n REQUIRED)
find_package(Poco COMPONENTS Net NetSSL Util CONFIG REQUIRED)
find_package(Poco COMPONENTS Net NetSSL Util CONFIG) # Not required, see below.
file(GLOB_RECURSE sources_lib *.cpp)
file(GLOB_RECURSE headers_lib ../../include/*.hpp)
@ -22,10 +22,29 @@ target_include_directories(${PROJECT_NAME}
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
target_link_libraries(${PROJECT_NAME}
PRIVATE
PkgConfig::libxdg-basedir ICU::uc ICU::i18n Poco::Net Poco::NetSSL Poco::Util
PRIVATE PkgConfig::libxdg-basedir ICU::uc ICU::i18n
PUBLIC vsqlitepp stdc++fs)
# Debian Stretch does not contain Poco*Config.cmake recipes.
if(PocoNetSSL_FOUND)
target_link_libraries(${PROJECT_NAME}
PRIVATE Poco::Net Poco::NetSSL Poco::Util)
else()
find_file(Poco_h NAMES "Poco/Poco.h"
PATHS ${CMAKE_INSTALL_INCLUDEDIR})
if("${Poco_h}" STREQUAL "Poco_h-NOTFOUND")
message(FATAL_ERROR "Could not find POCO.")
else()
message(WARNING
"Your distribution of POCO doesn't contain the *Config.cmake recipes, "
"but the files seem to be in the standard directories. "
"Let's hope this works.")
target_link_libraries(${PROJECT_NAME}
PRIVATE PocoNet PocoNetSSL PocoUtil)
endif()
endif()
install(TARGETS ${PROJECT_NAME}
EXPORT "${PROJECT_NAME}Targets"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"