cmake_minimum_required(VERSION 3.10) project(art-inkscape LANGUAGES NONE) set(icons example ) set(formats pdf svg png ) 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 ${sink} COMMAND SELF_CALL=xxx # https://gitlab.com/inkscape/inkscape/-/issues/4716 inkscape --export-type=${format} --export-filename=${sink} ${source} DEPENDS ${source} ) add_custom_target( "icon-${icon}-${format}" ALL DEPENDS ${sink} ) endforeach() endforeach()