diff options
author | Pierre Ossman <ossman@cendio.se> | 2022-05-11 12:39:58 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2022-05-11 13:06:27 +0200 |
commit | df8eddfae66e3ead8ed0707cb5a6bdc97a319d75 (patch) | |
tree | 3f7208a479dfd6b99f1640321e789120ede37fda | |
parent | e28bf7ae8e7e3f9796ae0dd0bc5d5644eb022044 (diff) | |
download | tigervnc-df8eddfae66e3ead8ed0707cb5a6bdc97a319d75.tar.gz tigervnc-df8eddfae66e3ead8ed0707cb5a6bdc97a319d75.zip |
Automatically generate Windows icon file
-rw-r--r-- | media/CMakeLists.txt | 22 | ||||
-rw-r--r-- | media/icons/tigervnc.ico | bin | 0 -> 46788 bytes | |||
-rwxr-xr-x | media/tigervnc.ico | bin | 25214 -> 0 bytes | |||
-rw-r--r-- | vncviewer/vncviewer.rc.in | 2 |
4 files changed, 20 insertions, 4 deletions
diff --git a/media/CMakeLists.txt b/media/CMakeLists.txt index 4bed4b6b..248e2213 100644 --- a/media/CMakeLists.txt +++ b/media/CMakeLists.txt @@ -1,14 +1,16 @@ -set(ICON_SIZES 16 22 24 32 48 64 128) +set(LINUX_ICON_SIZES 16 22 24 32 48 64 128) +set(WINDOWS_ICON_SIZES 16 24 32 48 256) find_program(CONVERT_EXECUTABLE convert) if(CONVERT_EXECUTABLE) - foreach(SIZE ${ICON_SIZES}) + set(ICON_FILES icons/tigervnc.ico) + foreach(SIZE ${LINUX_ICON_SIZES}) list(APPEND ICON_FILES ${CMAKE_CURRENT_SOURCE_DIR}/icons/tigervnc_${SIZE}.png) endforeach() add_custom_target(icons DEPENDS ${ICON_FILES}) - foreach(SIZE ${ICON_SIZES}) + foreach(SIZE ${LINUX_ICON_SIZES} ${WINDOWS_ICON_SIZES}) if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tigervnc_${SIZE}.svg) set(ICON_SRC_FILE ${CMAKE_CURRENT_SOURCE_DIR}/tigervnc_${SIZE}.svg) else() @@ -21,4 +23,18 @@ if(CONVERT_EXECUTABLE) DEPENDS ${ICON_SRC_FILE} COMMENT "Generating icons/tigervnc_${SIZE}.png") endforeach() + + foreach(SIZE ${WINDOWS_ICON_SIZES}) + if(${SIZE} LESS_EQUAL 32) + list(APPEND ICO_LEGACY \\\( ${CMAKE_CURRENT_SOURCE_DIR}/icons/tigervnc_${SIZE}.png -depth 4 -colors 16 \\\)) + list(APPEND ICO_LEGACY \\\( ${CMAKE_CURRENT_SOURCE_DIR}/icons/tigervnc_${SIZE}.png -depth 8 -colors 256 \\\)) + endif() + list(APPEND ICO_NORMAL \\\( ${CMAKE_CURRENT_SOURCE_DIR}/icons/tigervnc_${SIZE}.png \\\)) + list(APPEND ICO_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/icons/tigervnc_${SIZE}.png) + endforeach() + add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/icons/tigervnc.ico + COMMAND ${CONVERT_EXECUTABLE} ${ICO_LEGACY} ${ICO_NORMAL} + ${CMAKE_CURRENT_SOURCE_DIR}/icons/tigervnc.ico + DEPENDS ${ICO_DEPENDS} + COMMENT "Generating icons/tigervnc.ico") endif() diff --git a/media/icons/tigervnc.ico b/media/icons/tigervnc.ico Binary files differnew file mode 100644 index 00000000..97aa02a2 --- /dev/null +++ b/media/icons/tigervnc.ico diff --git a/media/tigervnc.ico b/media/tigervnc.ico Binary files differdeleted file mode 100755 index b86033b7..00000000 --- a/media/tigervnc.ico +++ /dev/null diff --git a/vncviewer/vncviewer.rc.in b/vncviewer/vncviewer.rc.in index c87a5400..9fec92f3 100644 --- a/vncviewer/vncviewer.rc.in +++ b/vncviewer/vncviewer.rc.in @@ -70,7 +70,7 @@ END // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -IDI_ICON ICON DISCARDABLE "@CMAKE_SOURCE_DIR@/media/tigervnc.ico" +IDI_ICON ICON DISCARDABLE "@CMAKE_SOURCE_DIR@/media/icons/tigervnc.ico" #endif // English (U.K.) resources ///////////////////////////////////////////////////////////////////////////// |