-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
356 lines (340 loc) · 10.1 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
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
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
# cxx_std_20 added in 3.12
cmake_minimum_required(VERSION 3.12)
project(Animera
VERSION 0.2.0
DESCRIPTION "A cross-platform Qt tool for making pixel-art animations for games"
HOMEPAGE_URL "https://github.com/indianakernick/Animera"
LANGUAGES CXX
)
add_executable(Animera
Animera.rc
"src/abstract export params.cpp"
"src/abstract export params.hpp"
"src/animation file.cpp"
"src/animation file.hpp"
src/animation.cpp
src/animation.hpp
src/animation.moc
src/application.cpp
src/application.hpp
src/application.moc
"src/atlas generator.cpp"
"src/atlas generator.hpp"
"src/basic atlas generator.cpp"
"src/basic atlas generator.hpp"
"src/brush tool.cpp"
"src/brush tool.hpp"
"src/cel array.cpp"
"src/cel array.hpp"
"src/cel painter.cpp"
"src/cel painter.hpp"
src/cel.cpp
src/cel.hpp
"src/chunk io.cpp"
"src/chunk io.hpp"
"src/cli export.cpp"
"src/cli export.hpp"
"src/cli info.cpp"
"src/cli info.hpp"
"src/cli new.cpp"
"src/cli new.hpp"
src/cli.cpp
src/cli.hpp
"src/color convert.cpp"
"src/color convert.hpp"
"src/color graph widget.cpp"
"src/color graph widget.hpp"
"src/color graph widget.moc"
"src/color handle.cpp"
"src/color handle.hpp"
"src/color picker impl.cpp"
"src/color picker impl.hpp"
"src/color picker impl.moc"
"src/color picker widget.cpp"
"src/color picker widget.hpp"
"src/color picker widget.moc"
"src/color slider widget.cpp"
"src/color slider widget.hpp"
"src/color slider widget.moc"
"src/combo box widget.cpp"
"src/combo box widget.hpp"
"src/combo box widget.moc"
src/composite.cpp
src/composite.hpp
"src/config colors.hpp"
"src/config geometry.hpp"
"src/config keys.hpp"
src/connect.hpp
"src/cpp atlas generator.cpp"
"src/cpp atlas generator.hpp"
"src/current tool.cpp"
"src/current tool.hpp"
src/dialog.cpp
src/dialog.hpp
"src/docopt helpers.cpp"
"src/docopt helpers.hpp"
"src/drag paint tools.cpp"
"src/drag paint tools.hpp"
"src/editor widget.cpp"
"src/editor widget.hpp"
"src/editor widget.moc"
"src/enum operators.hpp"
"src/error dialog.cpp"
"src/error dialog.hpp"
src/error.hpp
"src/export dialog.cpp"
"src/export dialog.hpp"
"src/export dialog.moc"
"src/export params.cpp"
"src/export params.hpp"
"src/export png.cpp"
"src/export png.hpp"
"src/export sprite sheet.cpp"
"src/export sprite sheet.hpp"
"src/export texture atlas.cpp"
"src/export texture atlas.hpp"
"src/file input widget.cpp"
"src/file input widget.hpp"
"src/file input widget.moc"
"src/file io error.hpp"
"src/file io.cpp"
"src/file io.hpp"
"src/flood fill tool.cpp"
"src/flood fill tool.hpp"
src/geometry.hpp
"src/global font.cpp"
"src/global font.hpp"
"src/gradient tool.cpp"
"src/gradient tool.hpp"
"src/graphics convert.hpp"
"src/group array.cpp"
"src/group array.hpp"
"src/hex input widget.cpp"
"src/hex input widget.hpp"
"src/hex input widget.moc"
"src/icon push button widget.cpp"
"src/icon push button widget.hpp"
"src/icon radio button widget.cpp"
"src/icon radio button widget.hpp"
src/image.cpp
src/image.hpp
"src/init canvas dialog.cpp"
"src/init canvas dialog.hpp"
"src/init canvas dialog.moc"
"src/int range.hpp"
"src/json atlas generator.cpp"
"src/json atlas generator.hpp"
"src/keys dialog.cpp"
"src/keys dialog.hpp"
"src/label widget.cpp"
"src/label widget.hpp"
src/main.cpp
src/main.moc
src/math.hpp
#"src/native mac.hpp"
#"src/native mac.mm"
"src/number input widget.cpp"
"src/number input widget.hpp"
"src/number input widget.moc"
"src/paint params.hpp"
src/painting.cpp
src/painting.hpp
"src/palette span.hpp"
"src/palette widget.cpp"
"src/palette widget.hpp"
"src/palette widget.moc"
src/palette.cpp
src/palette.hpp
src/palette.moc
"src/picker impl gray.cpp"
"src/picker impl gray.hpp"
"src/picker impl rgba.cpp"
"src/picker impl rgba.hpp"
"src/png atlas generator.cpp"
"src/png atlas generator.hpp"
src/png.cpp
src/png.hpp
"src/quit dialog.cpp"
"src/quit dialog.hpp"
"src/quit dialog.moc"
"src/radio button widget.cpp"
"src/radio button widget.hpp"
"src/resize canvas dialog.cpp"
"src/resize canvas dialog.hpp"
"src/resize canvas dialog.moc"
src/resources.cpp
"src/sample object.cpp"
"src/sample object.hpp"
"src/sample object.moc"
"src/scope time.cpp"
"src/scope time.hpp"
"src/scroll bar widget.cpp"
"src/scroll bar widget.hpp"
"src/select tools.cpp"
"src/select tools.hpp"
"src/separator widget.cpp"
"src/separator widget.hpp"
src/settings.cpp
src/settings.hpp
"src/sprite name.cpp"
"src/sprite name.hpp"
"src/sprite packer.cpp"
"src/sprite packer.hpp"
"src/status bar widget.cpp"
"src/status bar widget.hpp"
"src/status bar widget.moc"
"src/status msg.cpp"
"src/status msg.hpp"
"src/status object.cpp"
"src/status object.hpp"
"src/status object.moc"
src/strings.hpp
"src/surface factory.hpp"
"src/text input widget.cpp"
"src/text input widget.hpp"
"src/text input widget.moc"
"src/text push button widget.cpp"
"src/text push button widget.hpp"
"src/timeline cels widget.cpp"
"src/timeline cels widget.hpp"
"src/timeline cels widget.moc"
"src/timeline controls widget.cpp"
"src/timeline controls widget.hpp"
"src/timeline controls widget.moc"
"src/timeline frames widget.cpp"
"src/timeline frames widget.hpp"
"src/timeline frames widget.moc"
"src/timeline layers widget.cpp"
"src/timeline layers widget.hpp"
"src/timeline layers widget.moc"
"src/timeline painting.cpp"
"src/timeline painting.hpp"
"src/timeline widget.cpp"
"src/timeline widget.hpp"
"src/timeline widget.moc"
src/timeline.cpp
src/timeline.hpp
src/timeline.moc
"src/tool colors widget.cpp"
"src/tool colors widget.hpp"
"src/tool colors widget.moc"
"src/tool param bar widget.cpp"
"src/tool param bar widget.hpp"
"src/tool param widget.cpp"
"src/tool param widget.hpp"
"src/tool select widget.cpp"
"src/tool select widget.hpp"
"src/tool select widget.moc"
"src/tool widgets.cpp"
"src/tool widgets.hpp"
src/tool.cpp
src/tool.hpp
src/tool.moc
"src/transform tools.cpp"
"src/transform tools.hpp"
"src/undo object.cpp"
"src/undo object.hpp"
"src/undo object.moc"
src/undo.cpp
src/undo.hpp
"src/widget painting.cpp"
"src/widget painting.hpp"
"src/widget rect.hpp"
src/window.cpp
src/window.hpp
src/window.moc
src/zlib.hpp
third_party/stb/stb_rect_pack.c
third_party/stb/stb_rect_pack.h
)
target_compile_features(Animera
PRIVATE
cxx_std_20
)
# stop the command prompt window from showing
target_link_options(Animera
PRIVATE
/SUBSYSTEM:WINDOWS
)
target_include_directories(Animera
PRIVATE
src
third_party/Graphics/include
third_party/span/include
third_party/stb
)
# There's a problem with std::regex on Windows.
# Uncomment this if the CLI becomes sufficiently complex.
# set(USE_BOOST_REGEX ON CACHE BOOL "Use boost-regex")
# set(WITH_STATIC ON)
add_subdirectory(third_party/docopt EXCLUDE_FROM_ALL)
find_package(libpng CONFIG REQUIRED)
find_package(Qt5Core CONFIG REQUIRED)
find_package(Qt5Gui CONFIG REQUIRED)
find_package(Qt5Widgets CONFIG REQUIRED)
target_link_libraries(Animera
PRIVATE
docopt_s
png
Qt5::Core
Qt5::CorePrivate
Qt5::WinMain
Qt5::Gui
Qt5::GuiPrivate
Qt5::Widgets
Qt5::WidgetsPrivate
)
install(
DIRECTORY "${CMAKE_BINARY_DIR}/$<CONFIGURATION>/"
DESTINATION "bin"
FILES_MATCHING
PATTERN "*.dll"
PATTERN "qt.conf"
)
install(
TARGETS Animera
DESTINATION "bin"
)
install(
FILES COPYING
DESTINATION "."
)
set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
include(InstallRequiredSystemLibraries)
set(CPACK_PACKAGE_NAME "Animera")
set(CPACK_PACKAGE_VENDOR "Indiana Kernick")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Animera")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
set(CPACK_STRIP_FILES ON)
set(CPACK_GENERATOR "NSIS64")
set(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/Resources/Logo/appicon.ico")
set(CPACK_NSIS_MUI_UNIICON "${CMAKE_SOURCE_DIR}/Resources/Logo/appicon.ico")
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
# Control panel
set(CPACK_NSIS_DISPLAY_NAME "Animera")
set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\Animera.exe")
set(CPACK_NSIS_URL_INFO_ABOUT "${CMAKE_PROJECT_HOMEPAGE_URL}")
# Start menu
set(CPACK_PACKAGE_EXECUTABLES "Animera;Animera")
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
WriteRegStr HKCR '.animera' '' 'Animera.File'
WriteRegStr HKCR 'Animera.File' '' 'Animera Animation'
WriteRegStr HKCR 'Animera.File\\\\shell' '' 'open'
WriteRegStr HKCR 'Animera.File\\\\shell\\\\open\\\\command' '' '\\\"\$INSTDIR\\\\bin\\\\Animera.exe\\\" open \\\"%1\\\"'
WriteRegStr HKCR 'Animera.File\\\\shell\\\\edit\\\\command' '' '\\\"\$INSTDIR\\\\bin\\\\Animera.exe\\\" open \\\"%1\\\"'
WriteRegStr HKCR 'Animera.File\\\\DefaultIcon' '' '\$INSTDIR\\\\bin\\\\Animera.exe,1'
WriteRegStr HKCR '.png\\\\OpenWithProgids' 'Animera.PNG' ''
WriteRegStr HKCR 'Animera.PNG\\\\shell' '' 'open'
WriteRegStr HKCR 'Animera.PNG\\\\shell\\\\open\\\\command' '' '\\\"\$INSTDIR\\\\bin\\\\Animera.exe\\\" open \\\"%1\\\"'
; These are required for some reason
WriteRegStr HKCR 'Animera.PNG\\\\Application' 'ApplicationName' 'Animera'
WriteRegStr HKCR 'Animera.PNG\\\\Application' 'ApplicationCompany' 'Indiana Kernick'
WriteRegStr HKCR 'Animera.PNG\\\\Application' 'ApplicationIcon' '\$INSTDIR\\\\bin\\\\Animera.exe'
")
set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "
DeleteRegKey HKCR '.animera' ''
DeleteRegKey HKCR 'Animera.File' ''
DeleteRegValue HKCR '.png\\\\OpenWithProgids' 'Animera.PNG'
DeleteRegKey HKCR 'Animera.PNG' ''
")
include(CPack)