comparison cmake/SvgToPng.cmake @ 0:49cd5cc0b072

Initial commit of project template (based on RetraceIT)
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 07 Mar 2016 17:35:09 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:49cd5cc0b072
1 macro(svg_to_png
2 file_from
3 file_to
4 dpi
5 size
6 list_to_add)
7
8 # remove ../'s
9 get_filename_component(_file_from ${CMAKE_CURRENT_SOURCE_DIR}/${file_from} REALPATH)
10 get_filename_component(_file_to ${CMAKE_CURRENT_SOURCE_DIR}/${file_to} REALPATH)
11
12 list(APPEND ${list_to_add} ${_file_to})
13
14 find_program(INKSCAPE_EXE inkscape)
15 mark_as_advanced(INKSCAPE_EXE)
16
17 if(INKSCAPE_EXE)
18 add_custom_command(
19 OUTPUT ${_file_to}
20 COMMAND ${INKSCAPE_EXE} ${_file_from} --export-width=${size} --export-height=${size} --export-dpi=${dpi} --without-gui --export-png=${_file_to}
21 DEPENDS ${_file_from} ${INKSCAPE_EXE}
22 )
23 else()
24 message(WARNING "Inkscape not found, could not re-generate ${_file_to} from ${_file_from}!")
25 endif()
26
27 unset(_file_from)
28 unset(_file_to)
29 endmacro()
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)