-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
33 lines (28 loc) · 846 Bytes
/
CMakeLists.txt
File metadata and controls
33 lines (28 loc) · 846 Bytes
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
cmake_minimum_required(VERSION 3.14)
project(atime VERSION 1.0.0 LANGUAGES CXX)
# Header-only library
add_library(atime INTERFACE)
target_include_directories(atime INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_compile_features(atime INTERFACE cxx_std_14)
# Options
option(ATIME_BUILD_TESTS "Build tests" ON)
option(ATIME_BUILD_EXAMPLES "Build examples" ON)
if(ATIME_BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
endif()
if(ATIME_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
# Install
include(GNUInstallDirs)
install(TARGETS atime EXPORT atimeTargets)
install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(EXPORT atimeTargets
FILE atimeConfig.cmake
NAMESPACE atime::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/atime
)