summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2024-11-28 20:52:47 +0100
committerxengineering <me@xengineering.eu>2024-11-28 20:52:47 +0100
commitce503eaa13cf5d81a5710a45af0357156e11cfa0 (patch)
treeaac150ddd60c65f5646152e068ea418ed0c89982
parentab0449005c357126907f56ebf4512d53351544ef (diff)
downloadgraphics-inkscape-ce503eaa13cf5d81a5710a45af0357156e11cfa0.tar
graphics-inkscape-ce503eaa13cf5d81a5710a45af0357156e11cfa0.tar.zst
graphics-inkscape-ce503eaa13cf5d81a5710a45af0357156e11cfa0.zip
Add support for *.ico format
This is intended to be used for website favicons. This commit embeds the image only in one size while the ico format can handle multiple of them.
-rw-r--r--CMakeLists.txt39
-rw-r--r--README.md2
2 files changed, 29 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index aa37a4e..341e7b4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,24 +10,39 @@ set(formats
pdf
svg
png
+ ico
)
foreach(icon ${icons})
foreach(format ${formats})
set(source "${CMAKE_CURRENT_SOURCE_DIR}/icons/${icon}.svg")
set(sink "${CMAKE_CURRENT_BINARY_DIR}/icons/${format}/${icon}.${format}")
- add_custom_command(
- OUTPUT
- ${sink}
- COMMAND
- SELF_CALL=xxx # https://gitlab.com/inkscape/inkscape/-/issues/4716
- inkscape
- --export-type=${format}
- --export-filename=${sink}
- ${source}
- DEPENDS
- ${source}
- )
+ if(format STREQUAL ico)
+ set(intermediate "${CMAKE_CURRENT_BINARY_DIR}/icons/png/${icon}.png")
+ add_custom_command(
+ OUTPUT
+ ${sink}
+ COMMAND
+ convert
+ ${intermediate}
+ ${sink}
+ DEPENDS
+ ${intermediate}
+ )
+ else()
+ add_custom_command(
+ OUTPUT
+ ${sink}
+ COMMAND
+ SELF_CALL=xxx # https://gitlab.com/inkscape/inkscape/-/issues/4716
+ inkscape
+ --export-type=${format}
+ --export-filename=${sink}
+ ${source}
+ DEPENDS
+ ${source}
+ )
+ endif()
add_custom_target(
"icon-${icon}-${format}"
ALL
diff --git a/README.md b/README.md
index 1f64306..3e34b06 100644
--- a/README.md
+++ b/README.md
@@ -20,6 +20,7 @@ output formats.
- [Inkscape][1]
- [CMake][2]
- [Ninja][3]
+- [ImageMagick][4]
## Usage
@@ -40,3 +41,4 @@ The results are placed inside the `build` folder.
[1]: https://inkscape.org
[2]: https://cmake.org
[3]: https://ninja-build.org
+[4]: https://imagemagick.org