forked from CaseyCarter/cmcstl2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
43 lines (37 loc) · 1.35 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
# cmcstl2 - A concept-enabled C++ standard library
#
# Copyright Eric Niebler 2015
# Copyright Casey Carter 2015, 2017
#
# Use, modification and distribution is subject to the
# Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
# Project home: https://github.com/caseycarter/cmcstl2
#
cmake_minimum_required(VERSION 3.8)
project(cmcstl2 CXX)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
find_package(Sanitizer COMPONENTS address undefined)
add_library(stl2 INTERFACE)
target_include_directories(stl2 INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>)
target_compile_features(stl2 INTERFACE cxx_std_17)
target_compile_options(stl2 INTERFACE
$<$<CXX_COMPILER_ID:GNU>:-fconcepts>
$<$<CXX_COMPILER_ID:Clang>:-Xclang -fconcepts-ts>)
install(DIRECTORY include/ DESTINATION include)
install(TARGETS stl2 EXPORT cmcstl2-targets)
install(EXPORT cmcstl2-targets DESTINATION lib/cmake/cmcstl2)
file(
WRITE ${PROJECT_BINARY_DIR}/cmcstl2-config.cmake
"include(\${CMAKE_CURRENT_LIST_DIR}/cmcstl2-targets.cmake)")
install(
FILES ${PROJECT_BINARY_DIR}/cmcstl2-config.cmake
DESTINATION lib/cmake/cmcstl2)
add_subdirectory(examples)
enable_testing()
include(CTest)
add_subdirectory(test)