2019-08-03 20:10:20 +02:00
|
|
|
include(GNUInstallDirs)
|
2019-07-26 21:00:05 +02:00
|
|
|
|
2019-08-06 17:14:32 +02:00
|
|
|
find_package(Poco COMPONENTS Util CONFIG)
|
|
|
|
|
2019-07-26 07:08:13 +02:00
|
|
|
file(GLOB sources_cli *.cpp)
|
2019-07-26 20:57:24 +02:00
|
|
|
|
2019-07-26 07:08:13 +02:00
|
|
|
add_executable(${PROJECT_NAME}-cli ${sources_cli})
|
2019-08-03 20:10:20 +02:00
|
|
|
|
2019-07-30 07:02:09 +02:00
|
|
|
set_target_properties(${PROJECT_NAME}-cli
|
|
|
|
PROPERTIES OUTPUT_NAME ${PROJECT_NAME})
|
2019-07-26 20:57:24 +02:00
|
|
|
|
2019-08-03 20:10:20 +02:00
|
|
|
target_include_directories(${PROJECT_NAME}-cli
|
2019-09-25 03:58:29 +02:00
|
|
|
PRIVATE "${PROJECT_BINARY_DIR}/src" "${CMAKE_CURRENT_SOURCE_DIR}")
|
2019-08-03 20:10:20 +02:00
|
|
|
|
|
|
|
target_link_libraries(${PROJECT_NAME}-cli
|
2019-08-09 00:14:26 +02:00
|
|
|
PRIVATE ${PROJECT_NAME})
|
2019-08-06 17:35:12 +02:00
|
|
|
|
|
|
|
# If no Poco*Config.cmake recipes are found, look for headers in standard dirs.
|
|
|
|
if(PocoUtil_FOUND)
|
|
|
|
target_link_libraries(${PROJECT_NAME}-cli
|
|
|
|
PRIVATE Poco::Util)
|
|
|
|
else()
|
|
|
|
find_file(Poco_h NAMES "Poco/Poco.h"
|
|
|
|
PATHS "${CMAKE_INSTALL_PREFIX}/${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}-cli
|
2019-08-06 17:58:19 +02:00
|
|
|
PRIVATE PocoFoundation PocoUtil)
|
2019-08-06 17:35:12 +02:00
|
|
|
endif()
|
|
|
|
endif()
|
2019-08-03 20:10:20 +02:00
|
|
|
|
|
|
|
install(TARGETS ${PROJECT_NAME}-cli
|
|
|
|
DESTINATION ${CMAKE_INSTALL_BINDIR})
|