forked from lewissbaker/cppcoro
-
Notifications
You must be signed in to change notification settings - Fork 53
/
CMakeLists.txt
42 lines (35 loc) · 1.11 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
cmake_minimum_required(VERSION 3.12)
project(cppcoro LANGUAGES CXX)
if(NOT "${CMAKE_CXX_STANDARD}")
message("C++ version not set. Defaulting to CMAKE_CXX_STANDARD=20")
set(CMAKE_CXX_STANDARD 20)
endif()
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
add_subdirectory(lib)
enable_testing()
if(BUILD_TESTING)
add_subdirectory(test)
endif()
export(EXPORT cppcoroTargets
FILE "${PROJECT_BINARY_DIR}/cppcoro/cppcoroTargets.cmake"
NAMESPACE cppcoro::)
configure_file(cmake/cppcoroConfig.cmake
"${PROJECT_BINARY_DIR}/cppcoro/cppcoroConfig.cmake"
COPYONLY)
set(config_package_location lib/cmake/cppcoro)
install(DIRECTORY include/cppcoro
DESTINATION include
COMPONENT Devel)
install(FILES cmake/FindCoroutines.cmake
DESTINATION ${config_package_location}
COMPONENT Devel)
install(EXPORT cppcoroTargets
FILE cppcoroTargets.cmake
NAMESPACE cppcoro::
DESTINATION ${config_package_location})
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/cppcoro/cppcoroConfig.cmake
DESTINATION ${config_package_location}
COMPONENT Devel)