-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
371 lines (339 loc) · 10.2 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
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
set(IMG_SOURCE_animate_mode_off_icon animate_mode_icons 0)
set(IMG_SOURCE_animate_mode_on_icon animate_mode_icons 1)
set(IMG_SOURCE_interpolation_type_tcb_icon interpolation_type_icons 1)
set(IMG_SOURCE_interpolation_type_linear_icon interpolation_type_icons 2)
set(IMG_SOURCE_interpolation_type_ease_icon interpolation_type_icons 3)
set(IMG_SOURCE_interpolation_type_const_icon interpolation_type_icons 4)
set(IMG_SOURCE_interpolation_type_clamped_icon interpolation_type_icons 5)
# set(IMG_SOURCE_interpolation_type_unknown_icon interpolation_type_icons 6)
set(IMG_SOURCE_valuenode_forbidanimation_icon interpolation_type_icons 7)
set(IMG_SOURCE_action_doc_new_icon action_doc_icons 1)
set(IMG_SOURCE_action_doc_open_icon action_doc_icons 2)
set(IMG_SOURCE_action_doc_save_icon action_doc_icons 3)
set(IMG_SOURCE_action_doc_saveas_icon action_doc_icons 4)
set(IMG_SOURCE_action_doc_saveall_icon action_doc_icons 5)
set(IMG_SOURCE_action_doc_undo_icon action_doc_icons 6)
set(IMG_SOURCE_action_doc_redo_icon action_doc_icons 7)
set(IMG_SOURCE_canvas_icon canvas_and_importimage_icons 2)
set(IMG_SOURCE_layer_other_importimage_icon canvas_and_importimage_icons 1)
set(IMG_SOURCE_animate_seek_next_keyframe_icon framedial_icons 0)
set(IMG_SOURCE_animate_seek_prev_keyframe_icon framedial_icons 1)
set(IMG_SOURCE_animate_seek_next_frame_icon framedial_icons 2)
set(IMG_SOURCE_animate_seek_prev_frame_icon framedial_icons 3)
set(IMG_SOURCE_animate_seek_begin_icon framedial_icons 4)
set(IMG_SOURCE_animate_seek_end_icon framedial_icons 5)
set(IMG_SOURCE_animate_play_icon framedial_icons 6)
set(IMG_SOURCE_animate_stop_icon framedial_icons 7)
set(IMG_SOURCE_animate_pause_icon framedial_icons 8)
set(IMG_SOURCE_animate_loop_icon framedial_icons 9)
set(IMG_SOURCE_animate_bounds_icon framedial_icons 10)
set(IMG_SOURCE_animate_bound_lower_icon framedial_icons 11)
set(IMG_SOURCE_animate_bound_upper_icon framedial_icons 12)
set(IMG_SOURCE_keyframe_lock_past_on_icon keyframe_lock_icons 0)
set(IMG_SOURCE_keyframe_lock_past_off_icon keyframe_lock_icons 1)
set(IMG_SOURCE_keyframe_lock_future_on_icon keyframe_lock_icons 2)
set(IMG_SOURCE_keyframe_lock_future_off_icon keyframe_lock_icons 3)
set(IMG_SOURCE_tangent_merge_icon tangent_merge_split_icons 0)
set(IMG_SOURCE_tangent_split_icon tangent_merge_split_icons 1)
set(IMG_SOURCE_utils_chain_link_on_icon utils_chain_link_icons 0)
set(IMG_SOURCE_utils_chain_link_off_icon utils_chain_link_icons 1)
set(ICONS
animate_mode_off_icon
animate_mode_on_icon
interpolation_type_tcb_icon
interpolation_type_linear_icon
interpolation_type_ease_icon
interpolation_type_const_icon
interpolation_type_clamped_icon
valuenode_forbidanimation_icon
action_doc_new_icon
action_doc_open_icon
action_doc_save_icon
action_doc_saveas_icon
action_doc_saveall_icon
action_doc_undo_icon
action_doc_redo_icon
canvas_icon
animate_seek_next_keyframe_icon
animate_seek_prev_keyframe_icon
animate_seek_next_frame_icon
animate_seek_prev_frame_icon
animate_seek_end_icon
animate_seek_begin_icon
animate_play_icon
animate_stop_icon
animate_pause_icon
animate_loop_icon
animate_bounds_icon
animate_bound_lower_icon
animate_bound_upper_icon
keyframe_lock_past_on_icon
keyframe_lock_past_off_icon
keyframe_lock_future_on_icon
keyframe_lock_future_off_icon
tangent_merge_icon
tangent_split_icon
utils_chain_link_on_icon
utils_chain_link_off_icon
action_add_to_set_icon
action_export_icon
action_flat_interpolation_icon
action_interpolate_interpolation_icon
action_peak_interpolation_icon
action_offpeak_interpolation_icon
action_remove_from_set_icon
action_rounded_interpolation_icon
action_innerrounded_interpolation_icon
action_set_layer_description_icon
action_squared_interpolation_icon
action_unexport_icon
clear_redo_icon
clear_undo_icon
decr_resolution_icon
duck_angle_icon
duck_position_icon
duck_radius_icon
duck_tangent_icon
duck_vertex_icon
duck_width_icon
duplicate_icon
graphs_icon
group_icon
history_icon
incr_resolution_icon
info_icon
jack_icon
keyframe_icon
layer_blur_blur_icon
layer_blur_motion_icon
layer_blur_radial_icon
layer_distortion_curvewarp_icon
layer_distortion_insideout_icon
layer_distortion_noise_icon
layer_distortion_skeletondeformation_icon
layer_distortion_spherize_icon
layer_distortion_stretch_icon
layer_distortion_twirl_icon
layer_distortion_warp_icon
layer_example_metaballs_icon
layer_example_simplecircle_icon
layer_filter_chromakey_icon
layer_filter_clamp_icon
layer_filter_colorcorrect_icon
layer_filter_halftone2_icon
layer_filter_halftone3_icon
layer_filter_lumakey_icon
layer_fractal_julia_icon
layer_fractal_mandelbrot_icon
layer_geometry_advanced_outline_icon
layer_geometry_checkerboard_icon
layer_geometry_circle_icon
layer_geometry_outline_icon
layer_geometry_polygon_icon
layer_geometry_rectangle_icon
layer_geometry_region_icon
layer_geometry_solidcolor_icon
layer_geometry_star_icon
layer_gradient_conical_icon
layer_gradient_curve_icon
layer_gradient_linear_icon
layer_gradient_noise_icon
layer_gradient_radial_icon
layer_gradient_spiral_icon
layer_icon
layer_other_duplicate_icon
layer_other_filtergroup_icon
layer_other_group_icon
layer_other_ghostgroup_icon
layer_other_importimage_icon
layer_other_plant_icon
layer_other_skeleton_icon
layer_other_sound_icon
layer_other_freetime_icon
layer_other_stroboscope_icon
layer_other_supersample_icon
layer_other_switch_icon
layer_other_text_icon
layer_other_timeloop_icon
layer_other_xorpattern_icon
layer_stylize_bevel_icon
layer_stylize_shade_icon
layer_transform_rotate_icon
layer_transform_scale_icon
layer_transform_translate_icon
layer_transform_zoom_icon
library_icon
meta_data_icon
navigator_icon
onion_skin_icon
palette_icon
parameters_icon
preview_options_icon
background_rendering_icon
rename_icon
render_options_icon
reset_colors_icon
resize_disabled_icon
resize_up_left_icon
resize_up_icon
resize_up_right_icon
resize_left_icon
resize_right_icon
resize_down_left_icon
resize_down_icon
resize_down_right_icon
resize_transparent_icon
select_all_child_layers_icon
set_fill_color_icon
set_icon
set_outline_color_icon
show_grid_icon
show_guideline_icon
sif_icon
snap_grid_icon
snap_guideline_icon
sound_icon
swap_colors_icon
time_track_icon
tool_brush_icon
tool_circle_icon
tool_cutout_icon
tool_draw_icon
tool_eyedrop_icon
tool_fill_icon
tool_gradient_icon
tool_mirror_icon
tool_normal_icon
tool_polyline_icon
tool_rectangle_icon
tool_rotate_icon
tool_scale_icon
tool_sketch_icon
tool_smooth_move_icon
tool_spline_icon
tool_skeleton_icon
tool_star_icon
tool_text_icon
tool_width_icon
tool_zoom_icon
type_angle_icon
type_bool_icon
type_canvas_icon
type_color_icon
type_gradient_icon
type_integer_icon
type_list_icon
type_real_icon
type_segment_icon
type_splinepoint_icon
type_string_icon
type_time_icon
type_vector_icon
utils_timetrack_align_icon
valuenode_icon
)
set(IMAGES
about_icon
logo
synfig_icon
${ICONS}
)
set(THEME_DIR ${SYNFIG_BUILD_ROOT}/share/synfig/icons/classic)
set(PIXMAPS_DIR ${THEME_DIR}/128x128)
file(MAKE_DIRECTORY ${PIXMAPS_DIR})
## TODO: configure icon size
#
# Implement icon sizes after Synfig Studio uses Gtk::IconTheme
# For now just render to the default document size like Autotools does
#
# Note to potential future contributors:
# Not all icons are of aspect 1:1, eg- toggle button chain link
# so the below code is faulty and needs to be corrected
#
#foreach (ICON IN ITEMS ${ICONS})
# set(IMG_SIZE_${ICON} 32 32)
#endforeach()
foreach (IMAGE IN ITEMS ${IMAGES})
if (IMG_SOURCE_${IMAGE})
list(GET IMG_SOURCE_${IMAGE} 0 SRC)
list(GET IMG_SOURCE_${IMAGE} 1 TIME)
else()
set(SRC ${IMAGE})
set(TIME 0)
endif()
# Wait for Gtk::IconTheme
# if (IMG_SIZE_${IMAGE})
# list(GET IMG_SIZE_${IMAGE} 0 W)
# list(GET IMG_SIZE_${IMAGE} 1 H)
# else()
# set(W 0)
# set(H 0)
# endif()
add_custom_command(
OUTPUT ${PIXMAPS_DIR}/${IMAGE}.png
# Wait for Gtk::IconTheme
# COMMAND synfig_bin ${SRC}.sif -o ${PIXMAPS_DIR}/${IMAGE}.png --time ${TIME}f -w ${W} -h ${H} --quiet
COMMAND synfig_bin ${SRC}.sif -o ${PIXMAPS_DIR}/${IMAGE}.png --time ${TIME}f --quiet
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${SRC}.sif synfig_bin
)
list(APPEND PIXMAPS ${PIXMAPS_DIR}/${IMAGE}.png)
install(
FILES ${PIXMAPS_DIR}/${IMAGE}.png
DESTINATION share/synfig/icons/classic/128x128
)
endforeach()
# Scalable Icon
file(
COPY ${CMAKE_CURRENT_SOURCE_DIR}/org.synfig.SynfigStudio.svg
DESTINATION ${SYNFIG_BUILD_ROOT}/share/icons/hicolor/scalable/apps
)
install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.synfig.SynfigStudio.svg
DESTINATION share/icons/hicolor/scalable/apps
)
# index.theme
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/index.theme ${SYNFIG_BUILD_ROOT}/share/synfig/icons/classic/index.theme COPYONLY)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/index.theme DESTINATION share/synfig/icons/classic)
# Synfig Splash Screen
if(${CMAKE_BUILD_TYPE} MATCHES Debug)
set(SYNFIG_SPLASH_SCREEN ${CMAKE_CURRENT_BINARY_DIR}/splash_screen_development.sif)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/splash_screen_development.sif.in
${SYNFIG_SPLASH_SCREEN}
@ONLY
)
set(LOGO_ICON ${CMAKE_CURRENT_SOURCE_DIR}/logo.sif)
file(COPY ${LOGO_ICON} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
else()
set(SYNFIG_SPLASH_SCREEN ${CMAKE_CURRENT_SOURCE_DIR}/splash_screen.sif)
endif()
set(SPLASH_SCREEN_DIR ${SYNFIG_BUILD_ROOT}/share/synfig/images)
file(MAKE_DIRECTORY ${SPLASH_SCREEN_DIR})
add_custom_command(
OUTPUT ${SPLASH_SCREEN_DIR}/splash_screen.png
COMMAND synfig_bin ${SYNFIG_SPLASH_SCREEN} -o ${SPLASH_SCREEN_DIR}/splash_screen.png --time 0f --quiet
DEPENDS ${SYNFIG_SPLASH_SCREEN} synfig_bin
)
list(APPEND PIXMAPS ${SPLASH_SCREEN_DIR}/splash_screen.png)
install(
FILES ${SPLASH_SCREEN_DIR}/splash_screen.png
DESTINATION share/synfig/images
)
# WIN32 Icon
if(WIN32)
add_custom_command(
OUTPUT ${THEME_DIR}/synfig_icon.ico
COMMAND synfig_bin ${CMAKE_CURRENT_SOURCE_DIR}/synfig_icon.sif -o ${THEME_DIR}/synfig_icon.ico --time 0f --quiet
DEPENDS ${SYNFIG_SPLASH_SCREEN} synfig_bin
)
list(APPEND PIXMAPS ${THEME_DIR}/synfig_icon.ico)
install(
FILES ${THEME_DIR}/synfig_icon.ico
DESTINATION share/pixmaps/synfigstudio
)
endif()
add_custom_target(
build_images
DEPENDS synfig_bin ${PIXMAPS}
)