Prevent cleaning of generated icons.

This commit is contained in:
Přemysl Eric Janouch 2011-01-23 13:26:00 +01:00
parent f5079833eb
commit ea3793589e
1 changed files with 9 additions and 5 deletions

View File

@ -63,23 +63,27 @@ if (CONVERT_EXECUTABLE AND NOT WIN32)
set (icon_size_list 16x16 32x32 48x48) set (icon_size_list 16x16 32x32 48x48)
set (icon_png_list) set (icon_png_list)
set (icon_symbolic_list)
foreach (icon_size ${icon_size_list}) foreach (icon_size ${icon_size_list})
set (icon_png_path ${icon_base}/${icon_size}/apps) set (icon_png_path ${icon_base}/${icon_size}/apps)
set (icon_png ${icon_png_path}/logdiag.png) set (icon_png ${icon_png_path}/logdiag.png)
list (APPEND icon_png_list ${icon_png}) list (APPEND icon_png_list ${icon_png})
set (icon_symbolic logdiag_icons_${icon_size})
list (APPEND icon_symbolic_list ${icon_symbolic})
add_custom_command (OUTPUT ${icon_png} add_custom_command (OUTPUT ${icon_symbolic}
COMMAND ${CMAKE_COMMAND} -E make_directory ${icon_png_path} COMMAND ${CMAKE_COMMAND} -E make_directory ${icon_png_path}
COMMAND ${CONVERT_EXECUTABLE} -background none COMMAND ${CONVERT_EXECUTABLE} -background none
-resize ${icon_size} ${icon_svg} ${icon_png} -resize ${icon_size} ${icon_svg} ${icon_png}
DEPENDS ${icon_svg}) DEPENDS ${icon_svg} VERBATIM)
set_source_files_properties (${icon_symbolic}
PROPERTIES SYMBOLIC TRUE)
endforeach (icon_size) endforeach (icon_size)
set (icon_ico ${CMAKE_CURRENT_SOURCE_DIR}/share/logdiag.ico) set (icon_ico ${CMAKE_CURRENT_SOURCE_DIR}/share/logdiag.ico)
add_custom_command (OUTPUT ${icon_ico} add_custom_target (logdiag_icons DEPENDS ${icon_symbolic_list}
COMMAND ${CONVERT_EXECUTABLE} ${icon_png_list} ${icon_ico} COMMAND ${CONVERT_EXECUTABLE} ${icon_png_list} ${icon_ico}
DEPENDS ${icon_png_list}) COMMENT "Generating logdiag.ico" VERBATIM)
add_custom_target (logdiag_icons DEPENDS ${icon_ico})
endif (CONVERT_EXECUTABLE AND NOT WIN32) endif (CONVERT_EXECUTABLE AND NOT WIN32)
# Dependencies # Dependencies