1
# Copyright (C) 2013 Christian Dywan
2
# Copyright (C) 2013 Olivier Duchateau
4
find_program (RSVG_CONVERT rsvg-convert)
7
set (CONVERT_FOUND TRUE)
8
macro (SVG2PNG filename install_destination)
9
string(REPLACE "/" "_" target ${filename})
10
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${filename}")
11
add_custom_target ("${target}.png" ALL
12
${RSVG_CONVERT} --keep-aspect-ratio --format=png "${CMAKE_CURRENT_SOURCE_DIR}/${filename}.svg"
13
--output "${CMAKE_CURRENT_BINARY_DIR}/${filename}.png"
15
install (FILES "${CMAKE_CURRENT_BINARY_DIR}/${filename}.png"
16
DESTINATION ${install_destination})
17
endmacro (SVG2PNG filename)