-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
93 lines (70 loc) · 2.44 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Set up the minimum version of cmake
cmake_minimum_required(VERSION 3.10.0)
# Set the project name and version
set(PROJECT_NAME "Engine")
set(PROJECT_VERSION_MAJOR 1)
set(PROJECT_VERSION_MINOR 0)
set(PROJECT_VERSION_REVISION 0)
project(${PROJECT_NAME})
message("Building ${PROJECT_NAME}...")
option(BUILD_TESTS "Building the engine tests" OFF)
# Set the C++ standard to be used
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# Add customs Flags
set(CMAKE_CXX_FLAGS_DEBUG_INIT "-Werror -Wfatal-errors -O0 -g -rdynamic")
set(CMAKE_CXX_FLAGS_RELEASE_INIT "-Werror -Wfatal-errors -O3 -s -fexpensive-optimizations")
# CMake options
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
# Set default build type explicitly to Release
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build type." FORCE)
endif(NOT CMAKE_BUILD_TYPE)
set(SOURCES
sources/Common/Maths.cpp
sources/Common/String.cpp
sources/Geometry/Bounds.cpp
sources/Geometry/Collision.cpp
sources/Geometry/Geometry.cpp
sources/Geometry/Vector2.cpp
sources/Geometry/Vertices2.cpp
sources/Benchmark/BlockData.cpp
sources/Benchmark/Performance.cpp
sources/Benchmark/Recorder.cpp
sources/Corpses/Circle.cpp
sources/Corpses/Corpse.cpp
sources/Corpses/Polygon.cpp
sources/Constraints/Constraint.cpp
sources/Constraints/Link.cpp
sources/Structures/QuadTree.cpp
sources/Structures/QuadNode.cpp
sources/Structures/System.cpp
)
set(HEADERS
include/Common/Maths.hpp
include/Common/String.hpp
include/Geometry/Bounds.hpp
include/Geometry/Collision.hpp
include/Geometry/Geometry.hpp
include/Geometry/Vector2.hpp
include/Geometry/Vertices2.hpp
include/Benchmark/BlockData.hpp
include/Benchmark/Performance.hpp
include/Benchmark/Recorder.hpp
include/Corpses/Circle.hpp
include/Corpses/Corpse.hpp
include/Corpses/Polygon.hpp
include/Constraints/Constraint.hpp
include/Constraints/Link.hpp
include/Structures/QuadTree.hpp
include/Structures/QuadNode.hpp
include/Structures/System.hpp
)
configure_file("${PROJECT_SOURCE_DIR}/Config.hpp.in" "${PROJECT_BINARY_DIR}/Config.hpp")
include_directories("${PROJECT_BINARY_DIR}")
add_library(${PROJECT_NAME} STATIC ${SOURCES} ${HEADERS})
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
if(BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
endif()