-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
145 lines (124 loc) · 2.93 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
# CMake entry point
cmake_minimum_required (VERSION 2.6)
project (MDGFW)
OPTION(MAKE_WORKSPACE "Make MDGFW game application" ON)
find_package(OpenGL REQUIRED)
add_subdirectory (ExtLibs)
include_directories(
${CMAKE_SOURCE_DIR}/ExtLibs/glfw-3.2.1/include/GLFW
${CMAKE_SOURCE_DIR}/ExtLibs/glm-0.9.8.4
${CMAKE_SOURCE_DIR}/ExtLibs/glew-1.9.0/include/
${CMAKE_SOURCE_DIR}/ExtLibs/freetype2/include/
${CMAKE_SOURCE_DIR}/ExtLibs
${CMAKE_SOURCE_DIR}/MDGFW
${CMAKE_SOURCE_DIR}/.
)
link_directories(
${CMAKE_SOURCE_DIR}/ExtLibs/glfw-3.2.1/src
${CMAKE_SOURCE_DIR}/MDGFW
${CMAKE_SOURCE_DIR}/ExtLibs/freetype2/win32
)
set(ALL_GRAPHICS_LIBS
${OPENGL_LIBRARY}
MDGFW
glfw
GLEW_190
${CMAKE_SOURCE_DIR}/ExtLibs/freetype2/win32/freetype.lib
)
add_custom_target(CustomDlls
# todo: check if debug and release folder exist
# debug version
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/ExtLibs/freetype2/win32/freetype.dll ${CMAKE_BINARY_DIR}/Debug
# release version
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/ExtLibs/freetype2/win32/freetype.dll ${CMAKE_BINARY_DIR}/Release
# Output Message
COMMENT "Copying Custom .dll binaries from '${CMAKE_SOURCE_DIR}/ExtLibs/freetype2/win32/freetype.dll' to '${CMAKE_BINARY_DIR}'" VERBATIM
)
add_definitions(
-DTW_STATIC
-DTW_NO_LIB_PRAGMA
-DTW_NO_DIRECT3D
-DGLEW_STATIC
-D_CRT_SECURE_NO_WARNINGS
)
####################################################################
# libMDGFW.a #
####################################################################
add_library(MDGFW
MDGFW/camera.h
MDGFW/camera.cpp
MDGFW/renderer.h
MDGFW/renderer.cpp
MDGFW/sprite.h
MDGFW/sprite.cpp
MDGFW/Engine.cpp
MDGFW/Engine.h
MDGFW/MDGFWConfig.h
MDGFW/Shader.cpp
MDGFW/Shader.h
MDGFW/Scene.cpp
MDGFW/Scene.h
MDGFW/SceneManager.cpp
MDGFW/SceneManager.h
MDGFW/InputManager.cpp
MDGFW/InputManager.h
MDGFW/MDGTime.cpp
MDGFW/MDGTime.h
MDGFW/Entity.cpp
MDGFW/Entity.h
MDGFW/VectorX.h
MDGFW/PointX.h
MDGFW/Line.cpp
MDGFW/Line.h
MDGFW/color.h
MDGFW/Mathmatics.h
MDGFW/ResourceManager.cpp
MDGFW/ResourceManager.h
MDGFW/Texture.cpp
MDGFW/Texture.h
MDGFW/Text.cpp
MDGFW/Text.h
MDGFW/Canvas.cpp
MDGFW/Canvas.h
MDGFW/UIElement.cpp
MDGFW/UIElement.h
MDGFW/Mesh.cpp
MDGFW/Mesh.h
MDGFW/Skybox.cpp
MDGFW/Skybox.h
MDGFW/Animation.cpp
MDGFW/Animation.h
MDGFW/Animator.cpp
MDGFW/Animator.h
)
file(
COPY MDGFW/shaders
DESTINATION ${CMAKE_BINARY_DIR}
)
file(
COPY MDGFW/fonts
DESTINATION ${CMAKE_BINARY_DIR}
)
file(
COPY MDGFW/skyboxes
DESTINATION ${CMAKE_BINARY_DIR}
)
IF(MAKE_WORKSPACE)
add_executable(Workspace
Workspace/main.cpp
Workspace/Player.cpp
Workspace/Player.h
)
file(
COPY Workspace/assets
DESTINATION ${CMAKE_BINARY_DIR}
)
file(
COPY Workspace/fonts
DESTINATION ${CMAKE_BINARY_DIR}
)
target_link_libraries(Workspace
${ALL_GRAPHICS_LIBS}
)
add_dependencies(Workspace CustomDlls)
ENDIF()