generated from toschmidt/cpp-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
30 lines (23 loc) · 1.01 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
cmake_minimum_required(VERSION 3.14)
project(cpp-utility)
# Options for building the project
option(ENABLE_TESTING "Enable testing of the project." ON)
option(ENABLE_BENCHMARKING "Enable benchmarking of the project." ON)
option(ENABLE_INSTALL "Enable installation of the library." ON)
# C++ Standards
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Compilation Flags
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -march=native")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -static-libasan -static-libubsan -fsanitize=address -fsanitize=leak -fsanitize=undefined")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} --coverage -fprofile-arcs -ftest-coverage")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
# Standard Libraries
include(${CMAKE_SOURCE_DIR}/cmake/import/threads.cmake)
# Test Framework
include(${CMAKE_SOURCE_DIR}/cmake/import/catch2.cmake)
# Implementation
add_subdirectory(src)
# Tests
add_subdirectory(test)