-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
35 lines (28 loc) · 1.04 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
cmake_minimum_required(VERSION 3.0.0)
project(unconstexpr VERSION 0.1.0)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED 20)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# require at least gcc 4.8
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.1)
message(FATAL_ERROR "GCC version must be at least 9.1!")
endif()
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# require at least clang 3.2
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
message(FATAL_ERROR "Clang version must be at least 9.0!")
endif()
else()
message(WARNING "You are using an unsupported compiler! Compilation has only been tested with Clang and GCC.")
endif()
add_library(unconstexpr INTERFACE)
target_include_directories(unconstexpr INTERFACE include/)
INSTALL (
DIRECTORY ${CMAKE_SOURCE_DIR}/include/unconstexpr/
DESTINATION include/unconstexpr
FILES_MATCHING PATTERN "*.h*")
enable_testing()
add_subdirectory(tests)
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)