forked from jupp0r/prometheus-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
61 lines (50 loc) · 1.25 KB
/
CMakeLists.txt
File metadata and controls
61 lines (50 loc) · 1.25 KB
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
59
60
61
if(USE_THIRDPARTY_LIBRARIES)
find_package(civetweb-3rdparty CONFIG REQUIRED)
else()
find_package(CivetWeb REQUIRED)
endif()
if(ENABLE_COMPRESSION)
find_package(ZLIB REQUIRED)
endif()
add_library(pull
src/exposer.cc
src/handler.cc
src/handler.h
$<$<BOOL:${USE_THIRDPARTY_LIBRARIES}>:$<TARGET_OBJECTS:civetweb>>
)
add_library(${PROJECT_NAME}::pull ALIAS pull)
target_link_libraries(pull
PUBLIC
${PROJECT_NAME}::core
PRIVATE
Threads::Threads
${CIVETWEB_LIBRARIES}
$<$<AND:$<BOOL:UNIX>,$<NOT:$<BOOL:APPLE>>>:rt>
$<$<BOOL:${ENABLE_COMPRESSION}>:ZLIB::ZLIB>
)
target_include_directories(pull
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PRIVATE
${CIVETWEB_INCLUDE_DIRS}
)
target_compile_definitions(pull
PRIVATE
$<$<BOOL:${ENABLE_COMPRESSION}>:HAVE_ZLIB>
)
set_target_properties(pull PROPERTIES OUTPUT_NAME ${PROJECT_NAME}-pull)
install(
TARGETS pull
EXPORT ${PROJECT_NAME}-targets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(
DIRECTORY include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
if(ENABLE_TESTING)
add_subdirectory(tests)
endif()