/usr/share/dune/cmake/modules/UseInkscape.cmake is in libdune-common-dev 2.5.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | # Module that provides conversion routines using inkscape
#
# .. cmake_function:: inkscape_generate_png_from_svg
#
# .. cmake_param:: OUTPUT_DIR
# :single:
#
# The output directory for the generated png files.
# Defaults to the current build directory.
#
# .. cmake_param:: pngfiles
# :single:
# :positional:
# :required:
#
# The files that should be converted.
#
# .. cmake_param:: DPI
# :single:
#
# dpi value for the generated image (default: 90)
#
# TODO Switch to named arguments!
#
include(CMakeParseArguments)
function(inkscape_generate_png_from_svg)
if(NOT INKSCAPE)
return()
endif(NOT INKSCAPE)
cmake_parse_arguments(INKSCAPE "" "OUTPUT_DIR;DPI" "" ${ARGN})
if(NOT INKSCAPE_OUTPUT_DIR)
set(INKSCAPE_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
endif(NOT INKSCAPE_OUTPUT_DIR)
if(NOT INKSCAPE_DPI)
set(INKSCAPE_DPI 90)
endif(NOT INKSCAPE_DPI)
foreach(pic ${INKSCAPE_UNPARSED_ARGUMENTS})
string(REGEX REPLACE "\\.[a-zA-Z]+" ".svg" input ${pic})
add_custom_command(OUTPUT ${pic}
COMMAND ${INKSCAPE} --export-dpi=${INKSCAPE_DPI} -e ${pic} ${CMAKE_CURRENT_SOURCE_DIR}/${input}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${input}
COMMENT "Generating ${INKSCAPE_OUTPUT_DIR}/${pic} from ${CMAKE_CURRENT_SOURCE_DIR}/${input}"
WORKING_DIRECTORY ${INKSCAPE_OUTPUT_DIR})
endforeach(pic)
endfunction(inkscape_generate_png_from_svg)
function(inkscape_generate_eps_from_svg)
cmake_parse_arguments(INKSCAPE "" "INPUT_DIR;OUTPUT_DIR;DPI" "" ${ARGN})
if(NOT INKSCAPE_INPUT_DIR)
set(INKSCAPE_INPUT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
endif(NOT INKSCAPE_INPUT_DIR)
if(NOT INKSCAPE_INPUT_DIR)
set(INKSCAPE_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
endif(NOT INKSCAPE_INPUT_DIR)
foreach(_pic ${INKSCAPE_UNPARSED_ARGUMENTS})
string(REGEX REPLACE "\\.[a-zA-Z]+" ".png" input "${_pic}")
string(REGEX REPLACE "\\.[a-zA-Z]+" ".svg" svginput "${_pic}")
add_custom_target(${input}
COMMAND ${INKSCAPE} --export-dpi=${INKSCAPE_DPI} -e ${input} ${CMAKE_CURRENT_SOURCE_DIR}/${svginput}
COMMENT "Generating ${INKSCAPE_OUTPUT_DIR}/${svginput} from ${CMAKE_CURRENT_SOURCE_DIR}/${input}")
add_custom_command(OUTPUT ${_pic}
COMMAND ${CONVERT} ${INKSCAPE_OUTPUT_DIR}/${input} EPS:${_pic}
DEPENDS ${input}
COMMENT "Converting ${INKSCAPE_OUTPUT_DIR}/${input} to ${INKSCAPE_OUTPUT_DIR}/${_pic}"
WORKING_DIRECTORY ${INKSCAPE_OUTPUT_DIR})
endforeach(_pic ${INKSCAPE_UNPARSED_ARGUMENTS})
endfunction(inkscape_generate_eps_from_svg)
|