forked from pocoproject/poco
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
58 lines (49 loc) · 1.35 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Sources
file(GLOB SRCS_G "src/*.cpp")
POCO_SOURCES_AUTO(SRCS ${SRCS_G})
# Headers
file(GLOB_RECURSE HDRS_G "include/*.h")
POCO_HEADERS_AUTO(SRCS ${HDRS_G})
# Version Resource
if(MSVC AND BUILD_SHARED_LIBS)
source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc)
list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc)
endif()
POCO_SOURCES_AUTO_PLAT(SRCS WIN32
src/WinRegistryConfiguration.cpp
src/WinRegistryKey.cpp
src/WinService.cpp
)
add_library(Util ${SRCS})
add_library(Poco::Util ALIAS Util)
set_target_properties(Util
PROPERTIES
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION}
OUTPUT_NAME PocoUtil
DEFINE_SYMBOL Util_EXPORTS
)
target_link_libraries(Util PUBLIC Poco::Foundation)
if(ENABLE_XML)
target_link_libraries(Util PUBLIC Poco::XML)
else()
target_compile_definitions(Util PUBLIC POCO_UTIL_NO_XMLCONFIGURATION)
endif()
if(ENABLE_JSON)
target_link_libraries(Util PUBLIC Poco::JSON)
else()
target_compile_definitions(Util PUBLIC POCO_UTIL_NO_JSONCONFIGURATION)
endif()
target_include_directories(Util
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
)
POCO_INSTALL(Util)
POCO_GENERATE_PACKAGE(Util)
if(ENABLE_SAMPLES)
add_subdirectory(samples)
endif()
if(ENABLE_TESTS)
add_subdirectory(testsuite)
endif()