-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
executable file
·186 lines (166 loc) · 6.09 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
# +------------------------------------------------------------------+
# | Projects Settings |
# +------------------------------------------------------------------+
cmake_minimum_required (VERSION 2.8)
project(GLITTER)
# +------------------------------------------------------------------+
# | Test system endian type |
# +------------------------------------------------------------------+
include (TestBigEndian)
TEST_BIG_ENDIAN(IS_BIG_ENDIAN)
if(IS_BIG_ENDIAN)
add_definitions(-DIS_BIG_ENDIAN)
else()
add_definitions(-DIS_LITTLE_ENDIAN)
endif()
# +------------------------------------------------------------------+
# | Compilation flags |
# +------------------------------------------------------------------+
set (CMAKE_CXX_STANDARD 11)
add_definitions(-Wall -Wextra)
add_definitions(-DRESOURCE_DIR=\"${CMAKE_SOURCE_DIR}\")
# +------------------------------------------------------------------+
# | Load libraries |
# +------------------------------------------------------------------+
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
include(external)
# +------------------------------------------------------------------+
# | Internal API library |
# +------------------------------------------------------------------+
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/)
set(UTILS_SRC src/glApi.hpp
src/glApi.cpp
src/Application.hpp
src/Application.cpp
src/ObjLoader.hpp
src/ObjLoader.cpp
src/Image.hpp
src/SimpleMaterial.hpp
src/utils.hpp
src/utils.cpp
src/Serialize.hpp
src/Serialize.cpp
src/AttributeProperties.hpp)
add_library(utils ${UTILS_SRC})
# +------------------------------------------------------------------+
# | glitter executable |
# +------------------------------------------------------------------+
file(GLOB GLSLFiles shaders/*.glsl)
add_executable(glitter
examples/main.cpp
examples/PA1Application.hpp
examples/PA1Application.cpp
examples/PA2Application.hpp
examples/PA2Application.cpp
examples/PA3Application.hpp
examples/PA3Application.cpp
examples/PA4Application.hpp
examples/PA4Application.cpp
examples/PA5Application.hpp
examples/PA5Application.cpp
${GLSLFiles}
)
target_link_libraries(glitter utils ${GLFW3_LIBRARIES} ${GLEW_LIBRARIES})
# +------------------------------------------------------------------+
# | rubik's cube |
# +------------------------------------------------------------------+
add_executable(rubik
rubik/main.cpp
rubik/RubikApplication.hpp
rubik/RubikApplication.cpp
rubik/RubikRenderer.hpp
rubik/RubikRenderer.cpp
rubik/RubikLogic.hpp
rubik/RubikLogic.cpp
rubik/GameStage.hpp
rubik/GameStage.cpp
rubik/TextPrinter.hpp
rubik/TextPrinter.cpp
rubik/rubik.v.glsl
rubik/rubik.f.glsl
rubik/font.v.glsl
rubik/font.f.glsl
rubik/hud.v.glsl
rubik/hud.f.glsl
)
target_link_libraries(rubik utils ${GLFW3_LIBRARIES} ${GLEW_LIBRARIES})
# +------------------------------------------------------------------+
# | conquerer game |
# +------------------------------------------------------------------+
add_executable(conquerer
conquerer/main.cpp
conquerer/FullScreenApplication.hpp
conquerer/FullScreenApplication.cpp
conquerer/ConquererApplication.hpp
conquerer/ConquererApplication.cpp
conquerer/GameStage.hpp
conquerer/StartStage.hpp
conquerer/StartStage.cpp
conquerer/EndStage.hpp
conquerer/EndStage.cpp
conquerer/PlayingStage.hpp
conquerer/PlayingStage.cpp
conquerer/AbstractRenderObject.hpp
conquerer/Mesh.hpp
conquerer/Mesh.cpp
conquerer/RenderObjectConqueror.hpp
conquerer/RenderObjectConqueror.cpp
conquerer/BasicObjects.hpp
conquerer/BasicObjects.cpp
conquerer/AbstractGameObject.hpp
conquerer/AbstractGameObject.cpp
conquerer/PlayerObject.hpp
conquerer/PlayerObject.cpp
conquerer/AsteroidObject.hpp
conquerer/AsteroidObject.cpp
conquerer/PlanetObject.hpp
conquerer/PlanetObject.cpp
conquerer/ProjectileObject.hpp
conquerer/ProjectileObject.cpp
conquerer/TextPrinter.hpp
conquerer/TextPrinter.cpp
conquerer/BackgroundRenderer.hpp
conquerer/BackgroundRenderer.cpp
conquerer/Camera.hpp
conquerer/Camera.cpp
conquerer/GameOverlay.hpp
conquerer/GameOverlay.cpp
conquerer/Renderer.hpp
conquerer/Renderer.cpp
conquerer/CollisionShapes.hpp
conquerer/GameLogic.hpp
conquerer/GameLogic.cpp
conquerer/GameStage.cpp
conquerer/2d.v.glsl
conquerer/2d.f.glsl
conquerer/3d.v.glsl
conquerer/3d.f.glsl
conquerer/font.v.glsl
conquerer/font.f.glsl
conquerer/texture.v.glsl
conquerer/texture.f.glsl
)
target_link_libraries(conquerer utils ${GLFW3_LIBRARIES} ${GLEW_LIBRARIES})
# +------------------------------------------------------------------+
# | obj2glitter file converter |
# +------------------------------------------------------------------+
add_executable(obj2glitter
examples/obj2glitter.cpp
)
target_link_libraries(obj2glitter utils ${GLEW_LIBRARIES})
# +------------------------------------------------------------------+
# | Doxygen Generation |
# +------------------------------------------------------------------+
option(GLITTER_BUILD_DOCUMENTATION "Build the Doxygen documentation" ON)
if (GLITTER_BUILD_DOCUMENTATION)
find_package(Doxygen)
if (GLITTER_BUILD_DOCUMENTATION AND DOXYGEN_FOUND)
configure_file(${GLITTER_SOURCE_DIR}/docs/Doxyfile.in
${GLITTER_BINARY_DIR}/docs/Doxyfile @ONLY)
add_custom_target( doc_doxygen
COMMAND ${DOXYGEN_EXECUTABLE} ${GLITTER_BINARY_DIR}/docs/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen"
VERBATIM )
endif()
endif()