From 285c5875fbe56b08d7d73e2c371f6f7f58dc8a0e Mon Sep 17 00:00:00 2001 From: xengineering Date: Sun, 24 Nov 2024 18:27:55 +0100 Subject: icons: Add SVG output format Inkscape provides also SVG output. While the source file is also an SVG the output SVG file e.g. has a correct docname in the file matching the file name. This also adds a CMake target for the output SVG. --- icons/CMakeLists.txt | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/icons/CMakeLists.txt b/icons/CMakeLists.txt index a66c305..97ff3bc 100644 --- a/icons/CMakeLists.txt +++ b/icons/CMakeLists.txt @@ -2,19 +2,26 @@ set(icons example ) +set(formats + pdf + svg +) + foreach(icon ${icons}) - add_custom_target("icon-${icon}-pdf" ALL) - add_custom_command( - TARGET - "icon-${icon}-pdf" - POST_BUILD - COMMAND - SELF_CALL=xxx # https://gitlab.com/inkscape/inkscape/-/issues/4716 - inkscape - --export-type=pdf - --export-filename=${CMAKE_CURRENT_BINARY_DIR}/${icon}.pdf - ${CMAKE_CURRENT_SOURCE_DIR}/${icon}.svg - WORKING_DIRECTORY - ${CMAKE_CURRENT_SOURCE_DIR} - ) + foreach(format ${formats}) + add_custom_target("icon-${icon}-${format}" ALL) + add_custom_command( + TARGET + "icon-${icon}-${format}" + POST_BUILD + COMMAND + SELF_CALL=xxx # https://gitlab.com/inkscape/inkscape/-/issues/4716 + inkscape + --export-type=${format} + --export-filename=${CMAKE_CURRENT_BINARY_DIR}/${icon}.${format} + ${CMAKE_CURRENT_SOURCE_DIR}/${icon}.svg + WORKING_DIRECTORY + ${CMAKE_CURRENT_SOURCE_DIR} + ) + endforeach() endforeach() -- cgit v1.2.3-70-g09d2