From 3599a028ec7f94971892ef4243db839351332745 Mon Sep 17 00:00:00 2001 From: xengineering Date: Sun, 24 Nov 2024 20:27:22 +0100 Subject: icons: Fix CMake dependencies This commit avoids that Inkscape calls are repeated if the output file was already built and is up to date. --- icons/CMakeLists.txt | 14 ++++++++++---- 1 file 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() -- cgit v1.2.3-70-g09d2