-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
60 lines (50 loc) · 1.46 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
cmake_minimum_required(VERSION 3.5)
set(CMAKE_BUILD_TYPE Release)
#set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# When in debug mode, we run Address Sanitizer to find memory errors
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Werror -fmax-errors=1 -Wno-unused-parameter")
# set(CMAKE_CXX_FLAGS_DEBUG "-g -fsanitize=address")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
# list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
# include(cmake/clang-format.cmake)
# include(cmake/sfml.cmake)
include(cmake/glad_glfw.cmake)
include(cmake/utils.cmake)
include(cmake/gtest.cmake)
include(cmake/freetype.cmake)
include_directories(include)
set(PROJECT_NAME fortress-commander)
project(${PROJECT_NAME})
set(SRC_FILES
src/Game.cpp
src/Unit.cpp
src/Enemy.cpp
src/World.cpp
src/Tile.cpp
src/Path.cpp
src/Region.cpp
src/GameState.cpp
src/Components.cpp
src/Systems/MoveSystem.cpp
src/Structure.cpp
src/Particles.cpp
src/Graphics/Shader.cpp
src/Graphics/ResourceManager.cpp
src/ECS/Manager.cpp
glad/src/glad.c
)
if(TEST)
set(PROJECT_NAME "${PROJECT_NAME}_TEST")
add_executable(${PROJECT_NAME} src/Test.cpp ${SRC_FILES})
setup_gtest(${PROJECT_NAME})
else(TEST)
add_executable(${PROJECT_NAME} src/main.cpp ${SRC_FILES})
endif(TEST)
setup_glad_glfw(${PROJECT_NAME})
setup_freetype(${PROJECT_NAME})
# copy over resources
copy_to_bin_dir(fonts shaders textures)