-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathCMakeLists.txt
43 lines (30 loc) · 1.15 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
cmake_minimum_required(VERSION 3.13)
project(HEDRON CXX ASM)
include(CTest)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(default_build_type "Debug")
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
STRING "Choose the type of build." FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Release")
endif()
option(ENABLE_CLANG_TIDY "Enable clang-tidy analysis." OFF)
# Globally enable additional goodies, if we are compiling with clang.
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND ENABLE_CLANG_TIDY)
# Optionally enable clang-tidy for the whole project.
find_program(CLANG_TIDY_EXE NAMES "clang-tidy" DOC "Path to clang-tidy executable")
if(CLANG_TIDY_EXE)
set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXE}")
else()
message(FATAL_ERROR "clang-tidy not found. Please install for automatic static analysis.")
endif()
endif()
include_directories(include)
add_subdirectory(src)
if(BUILD_TESTING)
enable_testing()
add_subdirectory(test/unit)
endif()