2014-08-22 17:10:24 +02:00
|
|
|
# Sources
|
|
|
|
file(GLOB SRCS_G "src/*.cpp")
|
2020-02-14 11:07:32 +01:00
|
|
|
POCO_SOURCES_AUTO(SRCS ${SRCS_G})
|
2014-08-22 17:10:24 +02:00
|
|
|
|
|
|
|
# Headers
|
2020-02-14 11:07:32 +01:00
|
|
|
file(GLOB_RECURSE HDRS_G "include/*.h")
|
|
|
|
POCO_HEADERS_AUTO(SRCS ${HDRS_G})
|
2012-11-11 11:28:44 +01:00
|
|
|
|
2019-06-24 15:39:06 +02:00
|
|
|
# Version Resource
|
2020-02-12 22:10:01 +01:00
|
|
|
if(MSVC AND BUILD_SHARED_LIBS)
|
2020-02-14 11:07:32 +01:00
|
|
|
source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc)
|
|
|
|
list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc)
|
2019-06-24 15:39:06 +02:00
|
|
|
endif()
|
|
|
|
|
2020-02-14 11:07:32 +01:00
|
|
|
POCO_SOURCES_AUTO_PLAT(SRCS WIN32
|
|
|
|
src/WinRegistryConfiguration.cpp
|
|
|
|
src/WinRegistryKey.cpp
|
|
|
|
src/WinService.cpp
|
2012-11-11 11:28:44 +01:00
|
|
|
)
|
|
|
|
|
2020-02-14 11:07:32 +01:00
|
|
|
add_library(Util ${SRCS})
|
2018-06-03 18:17:50 +02:00
|
|
|
add_library(Poco::Util ALIAS Util)
|
|
|
|
set_target_properties(Util
|
2020-02-14 11:07:32 +01:00
|
|
|
PROPERTIES
|
|
|
|
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION}
|
2018-06-03 18:17:50 +02:00
|
|
|
OUTPUT_NAME PocoUtil
|
2020-02-14 11:07:32 +01:00
|
|
|
DEFINE_SYMBOL Util_EXPORTS
|
|
|
|
)
|
2014-10-09 13:42:51 +02:00
|
|
|
|
2018-06-03 18:17:50 +02:00
|
|
|
target_link_libraries(Util PUBLIC Poco::Foundation)
|
2020-02-14 11:07:32 +01:00
|
|
|
if(ENABLE_XML)
|
2018-06-03 18:17:50 +02:00
|
|
|
target_link_libraries(Util PUBLIC Poco::XML)
|
2020-02-14 11:07:32 +01:00
|
|
|
else()
|
|
|
|
target_compile_definitions(Util PUBLIC POCO_UTIL_NO_XMLCONFIGURATION)
|
2015-05-19 16:12:39 +02:00
|
|
|
endif()
|
2020-02-14 11:07:32 +01:00
|
|
|
if(ENABLE_JSON)
|
2018-06-03 18:17:50 +02:00
|
|
|
target_link_libraries(Util PUBLIC Poco::JSON)
|
2020-02-14 11:07:32 +01:00
|
|
|
else()
|
|
|
|
target_compile_definitions(Util PUBLIC POCO_UTIL_NO_JSONCONFIGURATION)
|
2015-05-19 16:12:39 +02:00
|
|
|
endif()
|
|
|
|
|
2018-06-03 18:17:50 +02:00
|
|
|
target_include_directories(Util
|
2020-02-14 11:07:32 +01:00
|
|
|
PUBLIC
|
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
|
|
|
$<INSTALL_INTERFACE:include>
|
|
|
|
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
|
2018-06-03 18:17:50 +02:00
|
|
|
)
|
2012-11-11 11:28:44 +01:00
|
|
|
|
2018-06-03 18:17:50 +02:00
|
|
|
POCO_INSTALL(Util)
|
|
|
|
POCO_GENERATE_PACKAGE(Util)
|
2014-10-09 13:42:51 +02:00
|
|
|
|
2020-02-14 11:07:32 +01:00
|
|
|
if(ENABLE_TESTS)
|
|
|
|
add_subdirectory(samples)
|
|
|
|
add_subdirectory(testsuite)
|
|
|
|
endif()
|