-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
199 lines (167 loc) · 5.05 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
cmake_minimum_required(VERSION 3.12)
project(SDL_Framework)
# Find the SDL2 package
find_package(SDL2 REQUIRED)
# Add source files
set(SOURCES
src/main.cpp
src/shapes/vector2D.cpp
# graphics and utility files
src/utils/utilities.cpp
src/utils/filecommandloader.cpp
src/graphics/color.cpp
src/graphics/screenbuffer.cpp
src/graphics/screen.cpp
src/graphics/bmpimage.cpp
src/graphics/spritesheet.cpp
src/graphics/bmpfont.cpp
src/graphics/animation.cpp
src/graphics/animationplayer.cpp
src/graphics/animatedsprite.cpp
# shapes files
src/shapes/line2D.cpp
src/shapes/shape.cpp
src/shapes/triangle.cpp
src/shapes/rectangle.cpp
src/shapes/circle.cpp
# app files
src/app/app.cpp
src/app/button.cpp
# game files
src/games/excluder.cpp
src/games/actor.cpp
src/games/game.cpp
# scene files
src/scenes/buttonoptionsScene.cpp
src/scenes/notimplementedScene.cpp
src/scenes/arcadeScene.cpp
src/scenes/gameScene.cpp
src/scenes/pacmanstartScene.cpp
src/scenes/tetrisstartScene.cpp
src/scenes/asteroidstartScene.cpp
src/scenes/breakoutstartScene.cpp
# input files
src/input/gamecontroller.cpp
src/input/inputcontroller.cpp
# breakout files
src/games/breakout/breakout.cpp
src/games/breakout/paddle.cpp
src/games/breakout/ball.cpp
src/games/breakout/levelboundary.cpp
src/games/breakout/block.cpp
src/games/breakout/bgamelevel.cpp
# pacman files
src/games/pacman/pacmanlevel.cpp
src/games/pacman/pacmangameutils.cpp
src/games/pacman/pacmanactor.cpp
src/games/pacman/pacmanplayer.cpp
src/games/pacman/pacmanghost.cpp
src/games/pacman/pacmanghostai.cpp
src/games/pacman/pacman.cpp
# tetris files
src/games/tetris/tetris.cpp
src/games/tetris/tetrisblock.cpp
src/games/tetris/tetrislevel.cpp
# asteroids files
src/games/asteroids/asteroids.cpp
src/games/asteroids/asteroidsactor.cpp
src/games/asteroids/asteroidsgame.cpp
src/games/asteroids/asteroidsmissile.cpp
src/games/asteroids/asteroidsplayer.cpp
)
# Add header files
set(HEADERS
header/shapes/vector2D.h
# graphics and utility headers
header/utils/utilities.h
header/utils/constants.h
header/utils/filecommandloader.h
header/graphics/color.h
header/graphics/screenbuffer.h
header/graphics/screen.h
header/graphics/bmpimage.h
header/graphics/spritesheet.h
header/graphics/bmpfont.h
header/graphics/animation.h
header/graphics/animationplayer.h
header/graphics/animatedsprite.h
# shape headers
header/shapes/line2D.h
header/shapes/shape.h
header/shapes/triangle.h
header/shapes/rectangle.h
header/shapes/circle.h
# game headers
header/games/game.h
header/games/excluder.h
header/games/actor.h
# app headers
header/app/app.h
header/app/button.h
# scene headers
header/scenes/buttonoptionsScene.h
header/scenes/notimplementedScene.h
header/scenes/scene.h
header/scenes/arcadeScene.h
header/scenes/gameScene.h
header/scenes/pacmanstartScene.h
header/scenes/tetrisstartScene.h
header/scenes/asteroidstartScene.h
header/scenes/breakoutstartScene.h
# input headers
header/input/inputaction.h
header/input/gamecontroller.h
header/input/inputcontroller.h
# breakout game headers
header/games/breakout/breakout.h
header/games/breakout/boundaryedge.h
header/games/breakout/paddle.h
header/games/breakout/ball.h
header/games/breakout/levelboundary.h
header/games/breakout/block.h
header/games/breakout/bgamelevel.h
# pacman headers
header/games/pacman/pacmanlevel.h
header/games/pacman/pacmangameutils.h
header/games/pacman/pacmanactor.h
header/games/pacman/pacmanplayer.h
header/games/pacman/pacmanghost.h
header/games/pacman/pacmanghostai.h
header/games/pacman/pacman.h
#tetris headers
header/games/tetris/tetrisblock.h
header/games/tetris/tetrislevel.h
header/games/tetris/tetris.h
# asteroids files
header/games/asteroids/asteroids.h
header/games/asteroids/asteroidsactor.h
header/games/asteroids/asteroidsgame.h
header/games/asteroids/asteroidsmissile.h
header/games/asteroids/asteroidsplayer.h
)
# Create an executable target
add_executable(${PROJECT_NAME} ${SOURCES})
target_include_directories(${PROJECT_NAME} PRIVATE
header
header/utils
header/games
header/games/breakout
header/games/pacman
header/games/tetris
header/games/asteroids
header/graphics
header/shapes
header/scenes
header/input
header/app
)
# Link SDL2 libraries
target_link_libraries(${PROJECT_NAME} PRIVATE SDL2::SDL2)
# Post-build task
add_custom_command(
TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/src/assets
${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/Assets
COMMENT "Copying Assets folder to build directory"
)