set(icons example ) foreach(icon ${icons}) add_custom_target("icon-${icon}-pdf" ALL) add_custom_command( TARGET "icon-${icon}-pdf" POST_BUILD COMMAND inkscape --export-type=pdf --export-filename=${CMAKE_CURRENT_BINARY_DIR}/${icon}.pdf ${CMAKE_CURRENT_SOURCE_DIR}/${icon}.svg WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) endforeach()