This repository has been archived by the owner on Jan 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
61 lines (47 loc) · 1.6 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
cmake_minimum_required(VERSION 3.13[..3.18])
# Get version from the file 'VERSION'
file(STRINGS "VERSION" PROJECT_VERSION LIMIT_COUNT 1)
project(
GameProject
LANGUAGES CXX
VERSION ${PROJECT_VERSION}
DESCRIPTION "Game Project - KMU Fall 2020"
HOMEPAGE_URL "https://github.com/Mathieu-Lala/game_project")
include(cmake/PreventInSourceBuilds.cmake)
include(cmake/StandardProjectSettings.cmake)
# Cache Compiler
include(cmake/Cache.cmake)
# Options to apply on targets
add_library(project_options INTERFACE)
target_compile_features(project_options INTERFACE cxx_std_20)
if(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
option(ENABLE_BUILD_WITH_TIME_TRACE "Enable -ftime-trace to generate time tracing .json files on clang" OFF)
if(ENABLE_BUILD_WITH_TIME_TRACE)
add_compile_definitions(project_options INTERFACE -ftime-trace)
endif()
endif()
# Warnings to apply on targets
add_library(project_warnings INTERFACE)
include(cmake/CompilerWarnings.cmake)
set_project_warnings(project_warnings)
# Debugging flags
include(cmake/Sanitizers.cmake)
enable_sanitizers(project_options)
# Compile time optimizer
add_library(project_pch INTERFACE)
option(ENABLE_PCH "Enable Precompiled Headers" OFF)
if(ENABLE_PCH)
target_precompile_headers(project_pch INTERFACE <vector> <string> <utility> <functional> <variant> <glm/glm.hpp>)
endif()
# Allow for static analysis options
include(cmake/StaticAnalyzers.cmake)
# External libaries
include(cmake/Conan.cmake)
run_conan()
# Our targets
add_subdirectory(src)
option(ENABLE_TESTING "Enable Test Builds" OFF)
if(ENABLE_TESTING)
enable_testing()
add_subdirectory(test)
endif()