summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2024-11-24 20:27:22 +0100
committerxengineering <me@xengineering.eu>2024-11-24 20:27:22 +0100
commit3599a028ec7f94971892ef4243db839351332745 (patch)
treeea2f49623aab16b60cb13e2a217b35e1d2bc7ba4
parent285c5875fbe56b08d7d73e2c371f6f7f58dc8a0e (diff)
downloadgraphics-inkscape-3599a028ec7f94971892ef4243db839351332745.tar
graphics-inkscape-3599a028ec7f94971892ef4243db839351332745.tar.zst
graphics-inkscape-3599a028ec7f94971892ef4243db839351332745.zip
icons: Fix CMake dependencies
This commit avoids that Inkscape calls are repeated if the output file was already built and is up to date.
-rw-r--r--icons/CMakeLists.txt14
1 files changed, 10 insertions, 4 deletions
diff --git a/icons/CMakeLists.txt b/icons/CMakeLists.txt
index 97ff3bc..939786c 100644
--- a/icons/CMakeLists.txt
+++ b/icons/CMakeLists.txt
@@ -9,11 +9,9 @@ set(formats
foreach(icon ${icons})
foreach(format ${formats})
- add_custom_target("icon-${icon}-${format}" ALL)
add_custom_command(
- TARGET
- "icon-${icon}-${format}"
- POST_BUILD
+ OUTPUT
+ ${CMAKE_CURRENT_BINARY_DIR}/${icon}.${format}
COMMAND
SELF_CALL=xxx # https://gitlab.com/inkscape/inkscape/-/issues/4716
inkscape
@@ -22,6 +20,14 @@ foreach(icon ${icons})
${CMAKE_CURRENT_SOURCE_DIR}/${icon}.svg
WORKING_DIRECTORY
${CMAKE_CURRENT_SOURCE_DIR}
+ DEPENDS
+ ${CMAKE_CURRENT_SOURCE_DIR}/${icon}.svg
+ )
+ add_custom_target(
+ "icon-${icon}-${format}"
+ ALL
+ DEPENDS
+ ${CMAKE_CURRENT_BINARY_DIR}/${icon}.${format}
)
endforeach()
endforeach()