view cmake/SvgToPng.cmake @ 38:5354cbda7188

Fix HTML Layout. Support multiple formats at once. More handling. This commit is a bad mix of multiple changes. It addresses: - HTML Width is now relative and should fix some pdf creation problems. - Format is now taken from the extension of the file names provided. - Multiple file names are accepted at once. - Parser now handles missing values in Multiple choice answers - Parser now handles unfilled multiple choice values
author Andre Heinecke <andre.heinecke@intevation.de>
date Fri, 15 Apr 2016 15:19:04 +0200
parents 49cd5cc0b072
children
line wrap: on
line source
macro(svg_to_png
      file_from
      file_to
      dpi
      size
      list_to_add)

# remove ../'s
get_filename_component(_file_from ${CMAKE_CURRENT_SOURCE_DIR}/${file_from} REALPATH)
get_filename_component(_file_to   ${CMAKE_CURRENT_SOURCE_DIR}/${file_to}   REALPATH)

list(APPEND ${list_to_add} ${_file_to})

find_program(INKSCAPE_EXE inkscape)
mark_as_advanced(INKSCAPE_EXE)

if(INKSCAPE_EXE)
   add_custom_command(
      OUTPUT  ${_file_to}
      COMMAND ${INKSCAPE_EXE} ${_file_from} --export-width=${size} --export-height=${size} --export-dpi=${dpi}  --without-gui --export-png=${_file_to}
      DEPENDS ${_file_from} ${INKSCAPE_EXE}
   )
else()
   message(WARNING "Inkscape not found, could not re-generate ${_file_to} from ${_file_from}!")
endif()

unset(_file_from)
unset(_file_to)
endmacro()
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)