summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2024-12-26 11:41:13 +0100
committerxengineering <me@xengineering.eu>2024-12-26 11:41:13 +0100
commita53478e99a6f6b90ff727c723c137ffc09d4e428 (patch)
treec111830d331c6e5cfaf8624014466a7d0e46e4e5
parent00ab31053f71944a577ff802a503d73b8c08a247 (diff)
downloadgraphics-inkscape-a53478e99a6f6b90ff727c723c137ffc09d4e428.tar
graphics-inkscape-a53478e99a6f6b90ff727c723c137ffc09d4e428.tar.zst
graphics-inkscape-a53478e99a6f6b90ff727c723c137ffc09d4e428.zip
icons: Move build system code hereHEADmain
The decision to license the whole repository based on CC-BY-SA 4.0 removes the restriction to store build system code in a separate directory. Thus it is more straight forward to store the icon related CMake code in the icons directory.
-rw-r--r--CMakeLists.txt51
-rw-r--r--icons/CMakeLists.txt50
2 files changed, 51 insertions, 50 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 15a3455..bc6123a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,53 +2,4 @@ cmake_minimum_required(VERSION 3.10)
project(graphics-inkscape LANGUAGES NONE)
-file(GLOB icon_files "${CMAKE_CURRENT_SOURCE_DIR}/icons/*.svg")
-
-set(formats
- pdf
- svg
- png
- ico
-)
-
-find_program(imagemagick magick convert)
-
-foreach(icon_file ${icon_files})
- get_filename_component(icon ${icon_file} NAME_WE)
- foreach(format ${formats})
- set(source "${CMAKE_CURRENT_SOURCE_DIR}/icons/${icon}.svg")
- set(sink "${CMAKE_CURRENT_BINARY_DIR}/icons/${format}/${icon}.${format}")
- if(format STREQUAL ico)
- set(intermediate "${CMAKE_CURRENT_BINARY_DIR}/icons/png/${icon}.png")
- add_custom_command(
- OUTPUT
- ${sink}
- COMMAND
- ${imagemagick}
- ${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-${format}-${icon}"
- ALL
- DEPENDS
- ${sink}
- )
- endforeach()
-endforeach()
+add_subdirectory(icons)
diff --git a/icons/CMakeLists.txt b/icons/CMakeLists.txt
new file mode 100644
index 0000000..5c17877
--- /dev/null
+++ b/icons/CMakeLists.txt
@@ -0,0 +1,50 @@
+file(GLOB icon_files "${CMAKE_CURRENT_SOURCE_DIR}/*.svg")
+
+set(formats
+ pdf
+ svg
+ png
+ ico
+)
+
+find_program(imagemagick magick convert)
+
+foreach(icon_file ${icon_files})
+ get_filename_component(icon ${icon_file} NAME_WE)
+ foreach(format ${formats})
+ set(source "${CMAKE_CURRENT_SOURCE_DIR}/${icon}.svg")
+ set(sink "${CMAKE_CURRENT_BINARY_DIR}/${format}/${icon}.${format}")
+ if(format STREQUAL ico)
+ set(intermediate "${CMAKE_CURRENT_BINARY_DIR}/png/${icon}.png")
+ add_custom_command(
+ OUTPUT
+ ${sink}
+ COMMAND
+ ${imagemagick}
+ ${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-${format}-${icon}"
+ ALL
+ DEPENDS
+ ${sink}
+ )
+ endforeach()
+endforeach()