Skip to content
Snippets Groups Projects
Commit 9c0f2fd7 authored by Simon Praetorius's avatar Simon Praetorius
Browse files

Merge branch 'issue/not-regenerate-images' into 'master'

Improve inkscape_generate_png_from_svg

See merge request !1058
parents 8c7637c3 65c45e8a
No related branches found
No related tags found
1 merge request!1058Improve inkscape_generate_png_from_svg
Pipeline #41595 passed
Pipeline: Dune Nightly Test

#41598

    ......@@ -36,16 +36,28 @@ function(inkscape_generate_png_from_svg)
    set(INKSCAPE_DPI 90)
    endif()
    message(STATUS "Generate PNG from SVG in ${INKSCAPE_OUTPUT_DIR}")
    set(_converted 0)
    foreach(pic ${INKSCAPE_UNPARSED_ARGUMENTS})
    string(REGEX REPLACE "\\.[a-zA-Z]+" ".svg" input ${pic})
    if( INKSCAPE_NEW_VERSION )
    execute_process(
    COMMAND ${INKSCAPE} --export-dpi=${INKSCAPE_DPI} --export-type=png --export-filename=${pic} ${CMAKE_CURRENT_SOURCE_DIR}/${input}
    WORKING_DIRECTORY ${INKSCAPE_OUTPUT_DIR})
    else()
    execute_process(
    COMMAND ${INKSCAPE} -z --export-dpi=${INKSCAPE_DPI} -e ${pic} ${CMAKE_CURRENT_SOURCE_DIR}/${input}
    WORKING_DIRECTORY ${INKSCAPE_OUTPUT_DIR})
    if(NOT EXISTS ${INKSCAPE_OUTPUT_DIR}/${pic})
    set(_converted 1)
    if(INKSCAPE_NEW_VERSION)
    execute_process(
    COMMAND ${INKSCAPE} --export-dpi=${INKSCAPE_DPI} --export-type=png --export-filename=${pic} ${CMAKE_CURRENT_SOURCE_DIR}/${input}
    WORKING_DIRECTORY ${INKSCAPE_OUTPUT_DIR}
    OUTPUT_QUIET)
    else()
    execute_process(
    COMMAND ${INKSCAPE} -z --export-dpi=${INKSCAPE_DPI} -e ${pic} ${CMAKE_CURRENT_SOURCE_DIR}/${input}
    WORKING_DIRECTORY ${INKSCAPE_OUTPUT_DIR}
    OUTPUT_QUIET)
    endif()
    endif()
    endforeach()
    if(_converted)
    message(STATUS "Generate PNG from SVG in ${INKSCAPE_OUTPUT_DIR} - done")
    else()
    message(STATUS "Generate PNG from SVG in ${INKSCAPE_OUTPUT_DIR} - skipped")
    endif()
    endfunction()
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment