diff --git a/source/blender/editors/datafiles/CMakeLists.txt b/source/blender/editors/datafiles/CMakeLists.txt index c2a192cf0c6..7cf5df467d9 100644 --- a/source/blender/editors/datafiles/CMakeLists.txt +++ b/source/blender/editors/datafiles/CMakeLists.txt @@ -155,7 +155,7 @@ if(WITH_BLENDER) if(NOT WITH_HEADLESS) # Blender UI only. - set(SVG_SRC + set(SVG_FILENAMES_NOEXT action action_tweak add @@ -862,14 +862,23 @@ if(WITH_BLENDER) zoom_previous zoom_selected ) - set(SVGHCONTENTS ) - set(SVGCCCONTENTS ) - foreach(svg ${SVG_SRC}) + set(SVG_CONTENTS_H) + set(SVG_CONTENTS_C) + foreach(svg ${SVG_FILENAMES_NOEXT}) data_to_c_simple(../../../../release/datafiles/icons_svg/${svg}.svg SRC) string(TOUPPER ${svg} svg_name_upper) - set(SVGHCONTENTS "${SVGHCONTENTS}extern const char datatoc_${svg}_svg[];\n") - set(SVGCCCONTENTS "${SVGCCCONTENTS}case ICON_${svg_name_upper}: return datatoc_${svg}_svg;\n") + list(APPEND SVG_CONTENTS_H + "extern const char datatoc_${svg}_svg[]\;\n" + ) + list(APPEND SVG_CONTENTS_C + "case ICON_${svg_name_upper}: return datatoc_${svg}_svg\;\n" + ) endforeach() + unset(svg_name_upper) + + list(JOIN SVG_CONTENTS_C "" SVG_CONTENTS_C) + list(JOIN SVG_CONTENTS_H "" SVG_CONTENTS_H) + configure_file( "svg_icons.h.in" "${CMAKE_CURRENT_BINARY_DIR}/svg_icons.h" @@ -882,6 +891,7 @@ if(WITH_BLENDER) ESCAPE_QUOTES @ONLY ) + list(APPEND SRC ${CMAKE_CURRENT_BINARY_DIR}/svg_icons.h) list(APPEND SRC ${CMAKE_CURRENT_BINARY_DIR}/svg_icons.cc) # Blend files. @@ -892,6 +902,10 @@ if(WITH_BLENDER) # Images. data_to_c_simple(../../../../release/datafiles/splash.png SRC) + unset(SVG_CONTENTS_H) + unset(SVG_CONTENTS_C) + unset(SVG_FILENAMES_NOEXT) + endif() data_to_c_simple(../../../../release/datafiles/startup.blend SRC) diff --git a/source/blender/editors/datafiles/svg_icons.cc.in b/source/blender/editors/datafiles/svg_icons.cc.in index 3be933b7fd2..2831af544f4 100644 --- a/source/blender/editors/datafiles/svg_icons.cc.in +++ b/source/blender/editors/datafiles/svg_icons.cc.in @@ -5,8 +5,8 @@ const char *blf_get_icon_svg(int icon) { switch (icon) { - @SVGCCCONTENTS@ + @SVG_CONTENTS_C@ default: return datatoc_none_svg; } -} \ No newline at end of file +} diff --git a/source/blender/editors/datafiles/svg_icons.h.in b/source/blender/editors/datafiles/svg_icons.h.in index 2252893b49b..d72bfefbf95 100644 --- a/source/blender/editors/datafiles/svg_icons.h.in +++ b/source/blender/editors/datafiles/svg_icons.h.in @@ -6,8 +6,8 @@ extern "C" { const char *blf_get_icon_svg(int icon); -@SVGHCONTENTS@ +@SVG_CONTENTS_H@ #ifdef __cplusplus } -#endif \ No newline at end of file +#endif