andre@0: macro(svg_to_png andre@0: file_from andre@0: file_to andre@0: dpi andre@0: size andre@0: list_to_add) andre@0: andre@0: # remove ../'s andre@0: get_filename_component(_file_from ${CMAKE_CURRENT_SOURCE_DIR}/${file_from} REALPATH) andre@0: get_filename_component(_file_to ${CMAKE_CURRENT_SOURCE_DIR}/${file_to} REALPATH) andre@0: andre@0: list(APPEND ${list_to_add} ${_file_to}) andre@0: andre@0: find_program(INKSCAPE_EXE inkscape) andre@0: mark_as_advanced(INKSCAPE_EXE) andre@0: andre@0: if(INKSCAPE_EXE) andre@0: add_custom_command( andre@0: OUTPUT ${_file_to} andre@0: COMMAND ${INKSCAPE_EXE} ${_file_from} --export-width=${size} --export-height=${size} --export-dpi=${dpi} --without-gui --export-png=${_file_to} andre@0: DEPENDS ${_file_from} ${INKSCAPE_EXE} andre@0: ) andre@0: else() andre@0: message(WARNING "Inkscape not found, could not re-generate ${_file_to} from ${_file_from}!") andre@0: endif() andre@0: andre@0: unset(_file_from) andre@0: unset(_file_to) andre@0: endmacro()