From 7ec4c99cc17e47657d1b66063a54e68dc1f37a6b Mon Sep 17 00:00:00 2001 From: xengineering Date: Thu, 28 Nov 2024 20:26:24 +0100 Subject: Refactor CMakeLists.txt There was some code duplication which is now removed. --- CMakeLists.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bc08e39..fd4bb85 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,23 +14,25 @@ set(formats foreach(icon ${icons}) foreach(format ${formats}) + set(source "${CMAKE_CURRENT_SOURCE_DIR}/icons/${icon}.svg") + set(sink "${CMAKE_CURRENT_BINARY_DIR}/icons/${icon}.${format}") add_custom_command( OUTPUT - ${CMAKE_CURRENT_BINARY_DIR}/icons/${icon}.${format} + ${sink} 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 + --export-filename=${sink} + ${source} DEPENDS - ${CMAKE_CURRENT_SOURCE_DIR}/icons/${icon}.svg + ${source} ) add_custom_target( "icon-${icon}-${format}" ALL DEPENDS - ${CMAKE_CURRENT_BINARY_DIR}/icons/${icon}.${format} + ${sink} ) endforeach() endforeach() -- cgit v1.2.3-70-g09d2