-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
46 lines (35 loc) · 1.5 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
cmake_minimum_required(VERSION 3.24)
project(manticore
VERSION 1.0.2
DESCRIPTION "Main thread function executor"
LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
add_library(manticore INTERFACE)
add_library(tatami::manticore ALIAS manticore)
# Switch between include directories depending on whether the downstream is
# using the build directly or is using the installed package.
include(GNUInstallDirs)
target_include_directories(manticore
INTERFACE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/tatami_manticore>"
)
# Installing for find_package.
include(CMakePackageConfigHelpers)
install(DIRECTORY include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tatami_manticore)
install(TARGETS manticore
EXPORT manticoreTargets)
install(EXPORT manticoreTargets
FILE tatami_manticoreTargets.cmake
NAMESPACE tatami::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/tatami_manticore)
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/tatami_manticoreConfig.cmake"
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/tatami_manticore)
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/tatami_manticoreConfigVersion.cmake
COMPATIBILITY SameMajorVersion)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tatami_manticoreConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/tatami_manticoreConfigVersion.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/tatami_manticore)