forked from pistacheio/pistache
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
62 lines (53 loc) · 1.64 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
59
60
61
62
file (GLOB COMMON_SOURCE_FILES "common/*.cc")
file (GLOB SERVER_SOURCE_FILES "server/*.cc")
file (GLOB CLIENT_SOURCE_FILES "client/*.cc")
file (GLOB INCLUDE_FILES ${PROJECT_SOURCE_DIR}/include/pistache/*h)
set(SOURCE_FILES
${COMMON_SOURCE_FILES}
${SERVER_SOURCE_FILES}
${CLIENT_SOURCE_FILES}
${INCLUDE_FILES}
)
add_library(pistache ${SOURCE_FILES})
set_target_properties(pistache PROPERTIES
OUTPUT_NAME "pistache"
VERSION ${GENERIC_LIB_VERSION}
SOVERSION ${GENERIC_LIB_SOVERSION}
)
target_include_directories(pistache PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
)
set(include_install_dir "include")
set(lib_install_dir "lib/")
set(bin_install_dir "bin/")
target_link_libraries(pistache pthread)
install(
TARGETS pistache
EXPORT ${targets_export_name}
ARCHIVE DESTINATION ${lib_install_dir}
LIBRARY DESTINATION ${lib_install_dir}
RUNTIME DESTINATION ${bin_install_dir}
INCLUDES DESTINATION ${include_install_dir})
install(
DIRECTORY "${PROJECT_SOURCE_DIR}/include/pistache"
DESTINATION ${include_install_dir}
FILES_MATCHING PATTERN "*.*h")
install(TARGETS pistache
EXPORT PistacheTargets
DESTINATION lib)
install(EXPORT PistacheTargets
DESTINATION "lib/cmake/pistache"
EXPORT_LINK_INTERFACE_LIBRARIES
COMPONENT cmake-config
)
include(CMakePackageConfigHelpers)
configure_package_config_file(
"PistacheConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/PistacheConfig.cmake"
INSTALL_DESTINATION "lib/cmake/pistache"
)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/PistacheConfig.cmake"
DESTINATION "lib/cmake/pistache"
COMPONENT cmake-config
)