~midori/midori/trunk

« back to all changes in this revision

Viewing changes to cmake/FindConvert.cmake

  • Committer: André Stösel
  • Date: 2013-09-28 14:13:22 UTC
  • mfrom: (6419 midori)
  • mto: This revision was merged to the branch mainline in revision 6427.
  • Revision ID: andre@stoesel.de-20130928141322-8g2nadq5gnm30gkh
merge lp:midori

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (C) 2013 Christian Dywan
 
2
# Copyright (C) 2013 Olivier Duchateau
 
3
 
 
4
find_program (RSVG_CONVERT rsvg-convert)
 
5
 
 
6
if (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"
 
14
        )
 
15
        install (FILES "${CMAKE_CURRENT_BINARY_DIR}/${filename}.png"
 
16
            DESTINATION ${install_destination})
 
17
    endmacro (SVG2PNG filename)
 
18
endif ()
 
19