Some desktop environment, like KDE, need more rastered sizes and cannot make use of the SVG.tags/v1.12.90
set(ICON_SIZES 16 22 24 32 48) | |||||
set(ICON_SIZES 16 22 24 32 48 64 128) | |||||
find_program(CONVERT_EXECUTABLE convert) | find_program(CONVERT_EXECUTABLE convert) | ||||
add_custom_target(icons DEPENDS ${ICON_FILES}) | add_custom_target(icons DEPENDS ${ICON_FILES}) | ||||
foreach(SIZE ${ICON_SIZES}) | foreach(SIZE ${ICON_SIZES}) | ||||
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tigervnc_${SIZE}.svg) | |||||
set(ICON_SRC_FILE ${CMAKE_CURRENT_SOURCE_DIR}/tigervnc_${SIZE}.svg) | |||||
else() | |||||
set(ICON_SRC_FILE ${CMAKE_CURRENT_SOURCE_DIR}/tigervnc_48.svg) | |||||
endif() | |||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/icons/tigervnc_${SIZE}.png | add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/icons/tigervnc_${SIZE}.png | ||||
COMMAND ${CONVERT_EXECUTABLE} -depth 8 -background transparent | COMMAND ${CONVERT_EXECUTABLE} -depth 8 -background transparent | ||||
${CMAKE_CURRENT_SOURCE_DIR}/tigervnc_${SIZE}.svg | |||||
-size ${SIZE}x${SIZE} ${ICON_SRC_FILE} | |||||
${CMAKE_CURRENT_SOURCE_DIR}/icons/tigervnc_${SIZE}.png | ${CMAKE_CURRENT_SOURCE_DIR}/icons/tigervnc_${SIZE}.png | ||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tigervnc_${SIZE}.svg | |||||
DEPENDS ${ICON_SRC_FILE} | |||||
COMMENT "Generating icons/tigervnc_${SIZE}.png") | COMMENT "Generating icons/tigervnc_${SIZE}.png") | ||||
endforeach() | endforeach() | ||||
endif() | endif() |
add_custom_target(appstream ALL DEPENDS org.tigervnc.vncviewer.metainfo.xml) | add_custom_target(appstream ALL DEPENDS org.tigervnc.vncviewer.metainfo.xml) | ||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.tigervnc.vncviewer.metainfo.xml DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/metainfo) | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.tigervnc.vncviewer.metainfo.xml DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/metainfo) | ||||
foreach(res 16 22 24 32 48) | |||||
foreach(res 16 22 24 32 48 64 128) | |||||
install(FILES ../media/icons/tigervnc_${res}.png DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/icons/hicolor/${res}x${res}/apps RENAME tigervnc.png) | install(FILES ../media/icons/tigervnc_${res}.png DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/icons/hicolor/${res}x${res}/apps RENAME tigervnc.png) | ||||
endforeach() | endforeach() | ||||
install(FILES ../media/icons/tigervnc.svg DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/icons/hicolor/scalable/apps) | install(FILES ../media/icons/tigervnc.svg DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/icons/hicolor/scalable/apps) |
Fl_Window::default_icons(lg, sm); | Fl_Window::default_icons(lg, sm); | ||||
#elif ! defined(__APPLE__) | #elif ! defined(__APPLE__) | ||||
const int icon_sizes[] = {48, 32, 24, 16}; | |||||
const int icon_sizes[] = {128, 64, 48, 32, 24, 22, 16}; | |||||
Fl_PNG_Image *icons[sizeof(icon_sizes)/sizeof(icon_sizes[0])]; | Fl_PNG_Image *icons[sizeof(icon_sizes)/sizeof(icon_sizes[0])]; | ||||
int count; | int count; |