-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
63 lines (46 loc) · 1.72 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
cmake_minimum_required(VERSION 3.14)
project(Lazy
VERSION 0.0.1
DESCRIPTION "Parallel function calls and continuations in C++ based on Eric Niebler's talk at CppCon 2019"
HOMEPAGE_URL "https://github.com/tirimatangi/Lazy"
LANGUAGES CXX)
# ---- Warning guard ----
# Protect dependents from this project's warnings if the guard isn't disabled
set(Lazy_warning_guard SYSTEM)
if(Lazy_INCLUDE_WITHOUT_SYSTEM)
set(Lazy_warning_guard "")
endif()
# ---- Declare library ----
add_library(Lazy INTERFACE)
add_library(Lazy::Lazy ALIAS Lazy)
target_include_directories(Lazy
${Lazy_warning_guard}
INTERFACE
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>")
target_compile_features(Lazy INTERFACE cxx_std_17)
find_package(Threads REQUIRED)
target_link_libraries(Lazy INTERFACE Threads::Threads)
# ---- Install ----
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
set(Lazy_directory "Lazy-${PROJECT_VERSION}")
set(Lazy_include_directory
"${CMAKE_INSTALL_INCLUDEDIR}/${Lazy_directory}")
install(DIRECTORY "${PROJECT_SOURCE_DIR}/include/"
DESTINATION "${Lazy_include_directory}")
install(TARGETS Lazy
EXPORT LazyTargets
INCLUDES DESTINATION "${Lazy_include_directory}")
write_basic_package_version_file(
LazyConfigVersion.cmake
COMPATIBILITY SameMajorVersion
ARCH_INDEPENDENT)
set(Lazy_install_cmakedir
"${CMAKE_INSTALL_LIBDIR}/cmake/${Lazy_directory}")
install(FILES
"${PROJECT_SOURCE_DIR}/cmake/LazyConfig.cmake"
"${PROJECT_BINARY_DIR}/LazyConfigVersion.cmake"
DESTINATION "${Lazy_install_cmakedir}")
install(EXPORT LazyTargets
NAMESPACE Lazy::
DESTINATION "${Lazy_install_cmakedir}")