Added workaround for when Poco*Config.cmake recipes cannot be found.
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
9d0dd589a7
commit
5e18bbdf50
|
@ -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}"
|
||||
|
|
Loading…
Reference in New Issue