-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
50 lines (39 loc) · 1.45 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
cmake_minimum_required(VERSION 3.16)
project(layout_contiguous
VERSION 0.6.0
LANGUAGES CXX)
include(CTest)
find_package(mdspan 0.6.0 EXACT CONFIG REQUIRED)
add_library(layout_contiguous INTERFACE)
target_include_directories(layout_contiguous
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/layout_contiguous>)
target_include_directories(layout_contiguous
SYSTEM INTERFACE $<INSTALL_INTERFACE:include>)
target_link_libraries(layout_contiguous
INTERFACE std::mdspan)
target_compile_features(layout_contiguous
INTERFACE cxx_std_17)
add_library(layout_contiguous::layout_contiguous
ALIAS layout_contiguous)
if(BUILD_TESTING)
add_subdirectory(tests)
endif()
install(
TARGETS layout_contiguous
EXPORT layout_contiguous-targets)
install(
EXPORT layout_contiguous-targets
NAMESPACE layout_contiguous::
DESTINATION lib/cmake/layout_contiguous)
install(
DIRECTORY src/layout_contiguous
DESTINATION include)
include(CMakePackageConfigHelpers)
configure_package_config_file(cmake/layout_contiguous-config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/layout_contiguous-config.cmake
INSTALL_DESTINATION lib/cmake/layout_contiguous)
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/layout_contiguous-config-version.cmake
COMPATIBILITY SameMajorVersion)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/layout_contiguous-config.cmake ${CMAKE_CURRENT_BINARY_DIR}/layout_contiguous-config-version.cmake
DESTINATION lib/cmake/layout_contiguous)