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_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_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
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_remove_from_set_icon
action_rounded_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_spherize_icon
layer_distortion_stretch_icon
layer_distortion_twirl_icon
layer_distortion_warp_icon
layer_example_metaballs_icon
layer_example_simplecircle_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_group_icon
layer_other_plant_icon
layer_other_skeleton_icon
layer_other_sound_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
select_all_child_layers_icon
set_fill_color
set_icon
set_outline_color
show_grid_icon
show_guideline_icon
sif_icon
snap_grid_icon
snap_guideline_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_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
splash_screen
synfig_icon
${ICONS}
)
## TODO: don't run this if files are up to date
add_custom_target(build_images)
## TODO: configure icon size
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()
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(
TARGET build_images POST_BUILD
COMMAND synfig ${SRC}.sif --time ${TIME}f -w ${W} -h ${H} --quiet
COMMAND mv ${SRC}.png ${CMAKE_CURRENT_BINARY_DIR}/${IMAGE}.png
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${SRC}.sif
)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/${IMAGE}.png
DESTINATION share/pixmaps
)
endforeach()