-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
112 lines (102 loc) · 2.64 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
cmake_minimum_required(VERSION 3.14)
project(tankble
LANGUAGES CXX
VERSION 1.0.0
DESCRIPTION "Clone of action game named Battle City/Tank 1990."
HOMEPAGE_URL "https://github.com/przemek83/tankble")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
option(CODE_COVERAGE "Collect coverage" OFF)
if(CODE_COVERAGE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 --coverage")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 --coverage")
endif()
include(CMakeLists.txt.allegro)
set(ALLEGRO_SOURCE_DIR "${FETCHCONTENT_BASE_DIR}/allegro-src")
set(ALLEGRO_BINARY_DIR "${FETCHCONTENT_BASE_DIR}/allegro-build")
file(COPY image DESTINATION ${CMAKE_BINARY_DIR})
file(COPY levels DESTINATION ${CMAKE_BINARY_DIR})
set(${PROJECT_NAME}_SOURCES
src/Tank.cpp
src/Tank.h
src/Menu.cpp
src/Menu.h
src/Map.cpp
src/Map.h
src/Game.cpp
src/Game.h
src/Config.cpp
src/Config.h
src/Screen.h
src/Screen.cpp
src/Resources.h
src/Resources.cpp
src/ResourceType.h
src/Input.h
src/InputAction.h
src/TankType.h
src/Bullet.cpp
src/Bullet.h
src/Drawable.cpp
src/Drawable.h
src/Point.h
src/PointUtils.cpp
src/PointUtils.h
src/Direction.h
src/TankStats.h
src/Status.h
src/Status.cpp
src/MapUtils.h
src/MapUtils.cpp
src/Level.h
src/MenuItem.h
src/MenuItem.cpp
src/UserChoice.h
src/Display.h
src/Display.cpp
src/Utils.h
src/Utils.cpp
src/StandardInput.h
src/StandardInput.cpp
src/map/Water.cpp
src/map/Water.h
src/map/Steel.cpp
src/map/Steel.h
src/map/PowerUp.cpp
src/map/PowerUp.h
src/map/ShieldUp.cpp
src/map/ShieldUp.h
src/map/SpeedUp.cpp
src/map/SpeedUp.h
src/map/LifeUp.cpp
src/map/LifeUp.h
src/map/TierUp.cpp
src/map/TierUp.h
src/map/Plant.cpp
src/map/Plant.h
src/map/Tile.cpp
src/map/Tile.h
src/map/Ice.cpp
src/map/Ice.h
src/map/Plain.cpp
src/map/Plain.h
src/map/Brick.cpp
src/map/Brick.h
src/map/Base.cpp
src/map/Base.h
)
add_library(${PROJECT_NAME}-lib STATIC ${${PROJECT_NAME}_SOURCES})
target_link_libraries(${PROJECT_NAME}-lib allegro allegro_image allegro_font allegro_primitives)
target_include_directories(${PROJECT_NAME}-lib PUBLIC
${ALLEGRO_SOURCE_DIR}/include
${ALLEGRO_SOURCE_DIR}/addons/font
${ALLEGRO_SOURCE_DIR}/addons/image
${ALLEGRO_SOURCE_DIR}/addons/primitives
${ALLEGRO_BINARY_DIR}/include
)
add_executable(${CMAKE_PROJECT_NAME} src/main.cpp)
target_link_libraries(${PROJECT_NAME} ${PROJECT_NAME}-lib)
enable_testing()
include(Tests.cmake)
add_subdirectory(tests)