summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2024-11-28 19:42:35 +0100
committerxengineering <me@xengineering.eu>2024-11-28 19:42:35 +0100
commit8a8d8af76578970651738ccd6d141333a82ca9d0 (patch)
treec6cdde8234806cf460cef3a45b52a5e13eca3046 /CMakeLists.txt
parent25666da52598e9993392835ad87fd3cd2fcd4af4 (diff)
downloadgraphics-inkscape-8a8d8af76578970651738ccd6d141333a82ca9d0.tar
graphics-inkscape-8a8d8af76578970651738ccd6d141333a82ca9d0.tar.zst
graphics-inkscape-8a8d8af76578970651738ccd6d141333a82ca9d0.zip
Switch to dual-licensing with CC BY-SA and MPL 2.0
This repository mixes art and code. Since it is hard to find a suitable license for both dual-licensing is an obvious choice to fix that problem.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt47
1 files changed, 46 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1d9bc93..bb6758f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,4 +2,49 @@ cmake_minimum_required(VERSION 3.10)
project(art-inkscape LANGUAGES NONE)
-add_subdirectory(icons)
+set(icons
+ example
+)
+
+set(formats
+ pdf
+ svg
+ png
+ jpg
+)
+
+foreach(icon ${icons})
+ foreach(format ${formats})
+ if(format STREQUAL jpg)
+ add_custom_command(
+ OUTPUT
+ ${CMAKE_CURRENT_BINARY_DIR}/icons/${icon}.${format}
+ COMMAND
+ magick
+ ${CMAKE_CURRENT_BINARY_DIR}/icons/${icon}.png
+ ${CMAKE_CURRENT_BINARY_DIR}/icons/${icon}.${format}
+ DEPENDS
+ ${CMAKE_CURRENT_BINARY_DIR}/icons/${icon}.png
+ )
+ else()
+ add_custom_command(
+ OUTPUT
+ ${CMAKE_CURRENT_BINARY_DIR}/icons/${icon}.${format}
+ COMMAND
+ SELF_CALL=xxx # https://gitlab.com/inkscape/inkscape/-/issues/4716
+ inkscape
+ --export-type=${format}
+ --export-filename=${CMAKE_CURRENT_BINARY_DIR}/icons/${icon}.${format}
+ ${CMAKE_CURRENT_SOURCE_DIR}/icons/${icon}.svg
+ DEPENDS
+ ${CMAKE_CURRENT_SOURCE_DIR}/icons/${icon}.svg
+ )
+ endif()
+ add_custom_target(
+ "icon-${icon}-${format}"
+ ALL
+ DEPENDS
+ ${CMAKE_CURRENT_BINARY_DIR}/icons/${icon}.${format}
+ )
+ endforeach()
+endforeach()