summaryrefslogtreecommitdiff
path: root/engine-ocean/CMakeLists.txt
blob: 17de338c1a2b08213b847894ed59937c42330928 (plain)
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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
#Sets minimum cmake version 
cmake_minimum_required(VERSION 3.14)

#Sets project name to CS1950UEngine
project(simulation-ocean)

find_package(OpenGL REQUIRED)

#Tells compiler to use c++ 20
set(CMAKE_CXX_STANDARD 20)
#Makes c++ 20 required
set(CMAKE_CXX_STANDARD_REQUIRED ON)

#Setting path macros
set(GLFW_SOURCE_DIR "External/glfw-3.3.8")
set(GLEW_SOURCE_DIR "External/glew")
set(GLM_SOURCE_DIR "External/glm-master")
set(STB_SOURCE_DIR "External/stb")
set(FREETYPE_SOURCE_DIR "External/freetype")

#GLFW settings
set(BUILD_SHARED_LIBS OFF CACHE BOOL "")
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "")
set(GLFW_BUILD_TESTS OFF CACHE BOOL "")
set(GLFW_BUILD_DOCS OFF CACHE BOOL "")
set(GLFW_INSTALL OFF CACHE BOOL "")

#freetype settings
set(FT_DISABLE_ZLIB TRUE)
set(FT_DISABLE_BZIP2 TRUE)
set(FT_DISABLE_PNG TRUE)
set(FT_DISABLE_HARFBUZZ TRUE)
set(FT_DISABLE_BROTLI TRUE)


add_subdirectory(${GLFW_SOURCE_DIR})
add_subdirectory(${GLM_SOURCE_DIR})
add_subdirectory(${FREETYPE_SOURCE_DIR})

add_library(StaticGLEW STATIC ${GLEW_SOURCE_DIR}/src/glew.c)

include_directories(${GLFW_SOURCE_DIR}/include
                    ${GLFW_SOURCE_DIR}/deps
                    ${GLEW_SOURCE_DIR}/include
                    ${STB_SOURCE_DIR}
                    ${FREETYPE_SOURCE_DIR}/include
                    ${PROJECT_SOURCE_DIR}
                    )

add_executable(${PROJECT_NAME}
    main.cpp

    Engine/core.h
    Engine/core.cpp
    Engine/window.h
    Engine/window.cpp

    Game/Application.h
    Game/Application.cpp
    Game/Screen.h
    Game/Screen.cpp
    Game/MenuScreen.h
    Game/MenuScreen.cpp
    Game/GameplayScreen.h
    Game/GameplayScreen.cpp
    Game/GameWorld.h
    Game/GameWorld.cpp

    Game/TypeMap.h


    Game/Components/Component.h
    Game/Components/Component.cpp

    Game/Components/DrawComponent.h
    Game/Components/DrawComponent.cpp
    Game/Components/TransformComponent.h
    Game/Components/TransformComponent.cpp
    Game/Components/PlayerControlComponent.h
    Game/Components/PlayerControlComponent.cpp
    Game/Components/PathfindComponent.h
    Game/Components/PathfindComponent.cpp

    Game/Components/CollisionComponents/CollisionComponent.h
    Game/Components/CollisionComponents/CollisionComponent.cpp
    Game/Components/CollisionComponents/CylinderCollider.h
    Game/Components/CollisionComponents/CylinderCollider.cpp
    Game/Components/CollisionComponents/BoundingShape.h
    Game/Components/CollisionComponents/BoundingShape.cpp

    Game/GameObjects/GameObject.h
    Game/GameObjects/GameObject.cpp

    Game/Systems/system.h
    Game/Systems/system.cpp
    Game/Systems/drawsystem.h
    Game/Systems/drawsystem.cpp
    Game/Systems/camerasystem.h
    Game/Systems/camerasystem.cpp
    Game/Systems/charactercontrollersystem.h
    Game/Systems/charactercontrollersystem.cpp
    Game/Systems/physicssystem.h
    Game/Systems/physicssystem.cpp
    Game/Systems/CollisionSystems/environmentcollisiondetectionsystem.h
    Game/Systems/CollisionSystems/environmentcollisiondetectionsystem.cpp

    Game/Systems/objectcreationsystem.h
    Game/Systems/objectcreationsystem.cpp
    Game/Systems/Inventory/inventorysystem.h
    Game/Systems/Inventory/inventorysystem.cpp
    Game/Systems/Inventory/inventoryitem.h
    Game/Systems/Inventory/inventoryitem.cpp

    Graphics/tiny_obj_loader.h

    Game/Systems/CollisionSystems/collisionsystem.h
    Game/Systems/CollisionSystems/collisionsystem.cpp
    Game/Systems/CollisionSystems/ellipsoidtrianglecollisionsystem.h
    Game/Systems/CollisionSystems/ellipsoidtrianglecollisionsystem.cpp
    Game/Systems/CollisionSystems/accelerationsystem.h
    Game/Systems/CollisionSystems/accelerationsystem.cpp
    Game/Systems/CollisionSystems/BVH/bvhtree.h
    Game/Systems/CollisionSystems/BVH/bvhtree.cpp
    Game/Systems/CollisionSystems/UniformGrid/uniformgrid.h
    Game/Systems/CollisionSystems/UniformGrid/uniformgrid.cpp


    Game/Components/CollisionComponents/BoundingEllipsoid.h
    Game/Components/CollisionComponents/BoundingEllipsoid.cpp
    Game/Components/CollisionComponents/BoundingTriangle.h
    Game/Components/CollisionComponents/BoundingTriangle.cpp

    Game/Components/CollisionComponents/BoundingDynamicMesh.h
    Game/Components/CollisionComponents/BoundingDynamicMesh.cpp

    Game/Systems/Pathfinding/pathfinder.h
    Game/Systems/Pathfinding/pathfinder.cpp

    Game/Systems/Pathfinding/aimovementsystem.h
    Game/Systems/Pathfinding/aimovementsystem.cpp



    Game/Systems/AI/Actions/btaction.h
    Game/Systems/AI/Actions/btaction.cpp
    Game/Systems/AI/Conditions/btcondition.h
    Game/Systems/AI/Conditions/btcondition.cpp
    Game/Systems/AI/Actions/walkaction.h
    Game/Systems/AI/Actions/walkaction.cpp
    Game/Systems/AI/Conditions/proximitycondition.h
    Game/Systems/AI/Conditions/proximitycondition.cpp

    Game/Systems/AI/btnode.h
    Game/Systems/AI/btnode.cpp

    Game/Systems/AI/btselector.h
    Game/Systems/AI/btselector.cpp

    Game/Systems/AI/btsequence.h
    Game/Systems/AI/btsequence.cpp
    Game/Systems/aisystem.h
    Game/Systems/aisystem.cpp
    Game/Systems/AI/aibehaviorcomponent.h
    Game/Systems/AI/aibehaviorcomponent.cpp

    Game/Environment/environmentsystem.h
    Game/Environment/environmentsystem.cpp

    Game/Environment/grassenvironment.h
    Game/Environment/grassenvironment.cpp
    Game/Environment/skyboxenvironment.h
    Game/Environment/skyboxenvironment.cpp

    Game/Environment/water.h
    Game/Environment/water.cpp

    Game/Environment/Environment.h
    Game/Environment/Environment.cpp

    Game/Systems/UI/uisystem.h
    Game/Systems/UI/uisystem.cpp

    Game/Systems/UI/UITextures/uitexture.h
    Game/Systems/UI/UITextures/uitexture.cpp

    Game/Systems/UI/UITextures/uibutton.h
    Game/Systems/UI/UITextures/uibutton.cpp
    Game/Systems/UI/UITextures/uidisplay.h
    Game/Systems/UI/UITextures/uidisplay.cpp

    Game/Systems/UI/uielement.h
    Game/Systems/UI/uielement.cpp
    Game/Systems/UI/ButtonAction/buttonaction.h
    Game/Systems/UI/ButtonAction/buttonaction.cpp
    Game/Systems/UI/ButtonAction/showwindowaction.h
    Game/Systems/UI/ButtonAction/showwindowaction.cpp

    Game/Ocean/ocean.h
    Game/Ocean/ocean.cpp










    Graphics/graphics.h
    Graphics/graphics.cpp
    Graphics/global.h
    Graphics/debug.h
    Graphics/camera.h
    Graphics/camera.cpp
    Graphics/shaderloader.h
    Graphics/material.h
    Graphics/material.cpp
    Graphics/shapedata.h
    Graphics/shape.h
    Graphics/shape.cpp
    Graphics/modeltransform.h
    Graphics/modeltransform.cpp
    Graphics/light.h
    Graphics/light.cpp
    Graphics/font.h
    Graphics/font.cpp
    Graphics/textrenderer.h
    Graphics/textrenderer.cpp
    Graphics/GLWrappers/shader.h
    Graphics/GLWrappers/shader.cpp
    Graphics/GLWrappers/texture.h
    Graphics/GLWrappers/texture.cpp
    Graphics/GLWrappers/vbo.h
    Graphics/GLWrappers/vbo.cpp
    Graphics/GLWrappers/vao.h
    Graphics/GLWrappers/vao.cpp
)

target_link_libraries(${PROJECT_NAME} glfw StaticGLEW glm freetype ${OPENGL_LIBRARIES})

file( COPY ${CMAKE_CURRENT_SOURCE_DIR}/Resources DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )

if (WIN32)
  add_compile_definitions(GLEW_STATIC)
  target_link_libraries(${PROJECT_NAME}
      opengl32
      glu32
  )
endif()

if (UNIX AND NOT APPLE)
  target_link_libraries(${PROJECT_NAME}
      GL
  )
endif()