-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
275 lines (219 loc) · 6.74 KB
/
CMakeLists.txt
File metadata and controls
275 lines (219 loc) · 6.74 KB
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
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# CMakeLists.txt
cmake_minimum_required(VERSION 3.10)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum macOS deployment target")
project(toast)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
IF (MSVC)
message(FATAL_ERROR "Compiling with MSVC is not supported. Please use GCC or Clang instead")
ENDIF()
set(SOURCES
src/BuildDate.cpp
ext/imgui/imgui.cpp
ext/imgui/imgui_demo.cpp
ext/imgui/imgui_draw.cpp
ext/imgui/imgui_tables.cpp
ext/imgui/imgui_widgets.cpp
ext/imgui/backends/imgui_impl_glfw.cpp
ext/imgui/backends/imgui_impl_opengl3.cpp
ext/rg-etc1/rg_etc1.cpp
ext/tinyfiledialogs/tinyfiledialogs.c
src/App/Actions.cpp
src/App/PopupHandler.cpp
src/App/Shortcuts.cpp
src/App/popups/SheetRepackFailed.cpp
src/App/popups/EditAnimationName.cpp
src/App/popups/EditPartName.cpp
src/App/popups/SpritesheetManager.cpp
src/App/popups/SwapAnimation.cpp
src/App/popups/WaitForModifiedTexture.cpp
src/App/popups/ModifiedTextureSize.cpp
src/App/popups/MInterpolateKeys.cpp
src/App/popups/MOptimizeGlobal.cpp
src/App/popups/MPadRegion.cpp
src/App/popups/MTransformAnimation.cpp
src/App/popups/MTransformArrangement.cpp
src/App/popups/MTransformCellanim.cpp
src/App/popups/NewWizard.cpp
src/archive/Archive.cpp
src/archive/DARCH.cpp
src/archive/SARC.cpp
src/BIN/fontdata/FontAwesome.cpp
src/BIN/fontdata/NotoSans.cpp
src/BIN/fontdata/NotoSansJP.cpp
src/BIN/image/sheetDefault.png.cpp
src/BIN/image/toastIcon_title.png.cpp
src/BIN/image/toastIcon.png.cpp
src/cellanim/CellAnim.cpp
src/cellanim/CellAnimRenderer.cpp
src/compression/Yaz0/Compress.cpp
src/compression/Yaz0/Window.cpp
src/compression/NZlib.cpp
src/compression/Yaz0.cpp
src/manager/AsyncTaskManager.cpp
src/manager/ConfigManager.cpp
src/manager/MainThreadTaskManager.cpp
src/manager/PlayerManager.cpp
src/manager/PromptPopupManager.cpp
src/manager/SessionManager.cpp
src/manager/ThemeManager.cpp
src/stb/stb_dxt_impl.cpp
src/stb/stb_image_impl.cpp
src/stb/stb_image_resize2_impl.cpp
src/stb/stb_image_write_impl.cpp
src/stb/stb_rect_pack_impl.cpp
src/task/AsyncTask.cpp
src/task/AsyncTaskExportSession.cpp
src/task/AsyncTaskOptimizeCellanim.cpp
src/task/AsyncTaskPushSession.cpp
src/texture/APNGHack.cpp
src/texture/CTPK.cpp
src/texture/CtrImageConvert.cpp
src/texture/RvlImageConvert.cpp
src/texture/RvlPalette.cpp
src/texture/Texture.cpp
src/texture/TextureEx.cpp
src/texture/TPL.cpp
src/util/AnimLabelHeaderUtil.cpp
src/util/ArrangePartMatchUtil.cpp
src/util/BezierUtil.cpp
src/util/CxxDemangleUtil.cpp
src/util/FileUtil.cpp
src/util/MyPathUtil.cpp
src/util/ShiftJISUtil.cpp
src/util/SpritesheetFixUtil.cpp
src/util/TweenAnimUtil.cpp
src/util/UIUtil.cpp
src/window/WindowInspector/LvlAnimation.cpp
src/window/WindowInspector/LvlArrangement.cpp
src/window/WindowInspector/LvlKey.cpp
src/window/WindowAbout.cpp
src/window/WindowCanvas.cpp
src/window/WindowCellQuickSel.cpp
src/window/WindowConfig.cpp
src/window/WindowHybridList.cpp
src/window/WindowImGuiDemo.cpp
src/window/WindowInspector.cpp
src/window/WindowRoot.cpp
src/window/WindowSpritesheet.cpp
src/window/WindowTimeline.cpp
src/EditorDataPackage.cpp
src/Logging.cpp
src/ConsoleSplash.cpp
src/main.cpp
src/SelectionState.cpp
src/Session.cpp
src/TerminateHandler.cpp
src/Toast.cpp
)
IF (APPLE)
add_executable (toast MACOSX_BUNDLE ${SOURCES})
ELSE()
add_executable (toast ${SOURCES})
ENDIF()
target_compile_definitions(toast PRIVATE
IMGUI_DISABLE_OBSOLETE_FUNCTIONS
IMGUI_ENABLE_OSX_DEFAULT_CLIPBOARD_FUNCTIONS
IMGUI_DISABLE_DEFAULT_FONT
IMGUI_DEFINE_MATH_OPERATORS
)
IF (CMAKE_BUILD_TYPE MATCHES "Debug")
target_compile_definitions(toast PRIVATE RG_ETC1_BUILD_DEBUG)
ENDIF()
IF (WIN32)
target_compile_definitions(toast PRIVATE GLEW_STATIC)
ENDIF()
# Include directories
target_include_directories(toast PRIVATE
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/ext/imgui
${CMAKE_SOURCE_DIR}/ext/imgui/backends
${CMAKE_SOURCE_DIR}/ext/tinyfiledialogs
${CMAKE_SOURCE_DIR}/ext/rg-etc1
${CMAKE_SOURCE_DIR}/ext/cparse
${CMAKE_SOURCE_DIR}/libs/glfw/include
)
# Link directories
IF (APPLE) # macOS
target_include_directories(toast PRIVATE
libs/glfw3-apple/include
)
target_link_directories(toast PRIVATE
libs/glfw3-apple/lib-universal
)
ELSEIF (WIN32) # Windows
target_include_directories(toast PRIVATE
libs/glfw3-win64/include
libs/glew-2.2.0-win/include
)
target_link_directories(toast PRIVATE
libs/glfw3-win64/lib-mingw-w64
libs/glew-2.2.0-win/lib/Release/x64
)
ENDIF()
# Link directory for Linux
IF (UNIX AND NOT APPLE) # Linux
target_link_directories(toast PRIVATE
/usr/lib/x86_64-linux-gnu/
)
ENDIF()
# Link libraries
IF (WIN32) # Windows
target_link_libraries(toast PRIVATE
glfw3
glew32s
opengl32
comdlg32
ole32
-static
)
ELSEIF (APPLE) # macOS
target_link_libraries(toast PRIVATE
glfw3
"-framework OpenGL"
"-framework Cocoa"
"-framework IOKit"
"-framework CoreFoundation"
"-framework ApplicationServices"
iconv
)
ELSE() # Generic
target_link_libraries(toast PRIVATE
GL
GLEW
glfw
dl
pthread
m
X11
)
ENDIF()
IF (APPLE)
set_target_properties(toast PROPERTIES
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/Info.plist"
)
ENDIF()
# disable building of zlib-ng tests
set(ZLIB_ENABLE_TESTS OFF CACHE BOOL "Disable zlib-ng tests" FORCE)
set(ZLIBNG_ENABLE_TESTS OFF CACHE BOOL "Disable zlib-ng specific tests" FORCE)
# these optimizations are not supported on some CPUs and cause crashes when
# initializing zlib-ng
set(WITH_AVX2 OFF CACHE BOOL "Disable zlib-ng AVX2 optimizations" FORCE)
set(WITH_AVX512 OFF CACHE BOOL "Disable zlib-ng AVX512 optimizations" FORCE)
set(WITH_AVX512VNNI OFF CACHE BOOL "Disable zlig-ng AVX512VNNI optimizations" FORCE)
add_subdirectory(ext/zlib-ng)
target_link_libraries(toast PRIVATE zlibstatic)
# JSON library
add_subdirectory(ext/nlohmann.json)
target_link_libraries(toast PRIVATE nlohmann_json::nlohmann_json)
# Logging library
add_subdirectory(ext/spdlog)
target_link_libraries(toast PRIVATE spdlog::spdlog)
# Flags
target_compile_options(toast PRIVATE -O3)
# Apple "deprecated" OpenGL but never removed it lol
IF (APPLE)
target_compile_definitions(toast PRIVATE
GL_SILENCE_DEPRECATION
)
ENDIF()
set_property(TARGET toast PROPERTY CXX_STANDARD 20)