generated from DARMA-tasking/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
74 lines (60 loc) · 1.7 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
63
64
65
66
67
68
69
70
71
72
73
74
cmake_minimum_required(VERSION 3.8)
project(registry)
include(cmake/turn_on_warnings.cmake)
# Try to find ccache to speed up compilation
find_program(ccache_binary ccache)
if (ccache_binary)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${ccache_binary}")
endif()
file(
GLOB
HEADER_FILES
${CMAKE_CURRENT_SOURCE_DIR}/src/*.h
)
set(REGISTRY_LIBRARY registry)
set(REGISTRY_LIBRARY_NS vt::lib::registry)
add_custom_target(registry_examples)
add_subdirectory(examples)
install(FILES ${HEADER_FILES} DESTINATION include)
add_library(${REGISTRY_LIBRARY} INTERFACE)
add_library(${REGISTRY_LIBRARY_NS} ALIAS ${REGISTRY_LIBRARY})
target_compile_features(${REGISTRY_LIBRARY} INTERFACE cxx_std_14)
target_compile_features(
${REGISTRY_LIBRARY} INTERFACE
cxx_variadic_templates
cxx_auto_type
cxx_constexpr
)
target_include_directories(
${REGISTRY_LIBRARY} INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:include>
)
install(
TARGETS ${REGISTRY_LIBRARY}
EXPORT ${REGISTRY_LIBRARY}
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
)
install(
EXPORT ${REGISTRY_LIBRARY}
DESTINATION cmake
NAMESPACE vt::lib::
FILE "registryTargets.cmake"
COMPONENT runtime
)
configure_file(
cmake/registryConfig.cmake.in
"${PROJECT_BINARY_DIR}/registryConfig.cmake" @ONLY
)
install(
FILES "${PROJECT_BINARY_DIR}/registryConfig.cmake"
DESTINATION cmake
)
export(
TARGETS ${REGISTRY_LIBRARY}
FILE "registryTargets.cmake"
NAMESPACE vt::lib::
)