-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
35 lines (31 loc) · 1.08 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
cmake_minimum_required(VERSION 3.5.0)
project(graph VERSION 0.1.0 LANGUAGES CXX)
add_library(graph INTERFACE)
target_compile_features(graph INTERFACE cxx_std_20)
target_include_directories(graph INTERFACE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>"
)
add_library(graph::graph ALIAS graph)
install(TARGETS graph EXPORT graphTargets)
install(DIRECTORY include/ DESTINATION include)
install(EXPORT graphTargets
FILE graphTargets.cmake
NAMESPACE graph::
DESTINATION lib/cmake/graph)
include(CMakePackageConfigHelpers)
configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/graphConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/graphConfig.cmake"
INSTALL_DESTINATION lib/cmake/graph
)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/graphConfigVersion.cmake"
VERSION "${PROJECT_VERSION}"
COMPATIBILITY AnyNewerVersion
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/graphConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/graphConfigVersion.cmake"
DESTINATION lib/cmake/graph
)