Mercurial > retraceit
comparison cmake/SvgToPng.cmake @ 0:147b08bc7d64
Initial commit of a basic Application framework.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Mon, 23 Mar 2015 12:41:52 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:147b08bc7d64 |
---|---|
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() |