Browse Source

Automatically generate macOS icon file

tags/v1.12.90
Pierre Ossman 1 year ago
parent
commit
1134641583
4 changed files with 19 additions and 2 deletions
  1. 18
    1
      media/CMakeLists.txt
  2. BIN
      media/icons/tigervnc.icns
  3. 1
    1
      release/makemacapp.in
  4. BIN
      release/tigervnc.icns

+ 18
- 1
media/CMakeLists.txt View File

set(LINUX_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) set(WINDOWS_ICON_SIZES 16 24 32 48 256)
set(MACOS_ICON_SIZES 16 32 128 256 512)


find_program(CONVERT_EXECUTABLE convert) find_program(CONVERT_EXECUTABLE convert)
find_program(PNG2ICNS_EXECUTABLE png2icns)


if(CONVERT_EXECUTABLE) if(CONVERT_EXECUTABLE)
set(ICON_FILES icons/tigervnc.ico) set(ICON_FILES icons/tigervnc.ico)
foreach(SIZE ${LINUX_ICON_SIZES}) foreach(SIZE ${LINUX_ICON_SIZES})
list(APPEND ICON_FILES ${CMAKE_CURRENT_SOURCE_DIR}/icons/tigervnc_${SIZE}.png) list(APPEND ICON_FILES ${CMAKE_CURRENT_SOURCE_DIR}/icons/tigervnc_${SIZE}.png)
endforeach() endforeach()
if(PNG2ICNS_EXECUTABLE)
list(APPEND ICON_FILES icons/tigervnc.icns)
endif()
add_custom_target(icons DEPENDS ${ICON_FILES}) add_custom_target(icons DEPENDS ${ICON_FILES})


foreach(SIZE ${LINUX_ICON_SIZES} ${WINDOWS_ICON_SIZES})
foreach(SIZE ${LINUX_ICON_SIZES} ${WINDOWS_ICON_SIZES} ${MACOS_ICON_SIZES})
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tigervnc_${SIZE}.svg) if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tigervnc_${SIZE}.svg)
set(ICON_SRC_FILE ${CMAKE_CURRENT_SOURCE_DIR}/tigervnc_${SIZE}.svg) set(ICON_SRC_FILE ${CMAKE_CURRENT_SOURCE_DIR}/tigervnc_${SIZE}.svg)
else() else()
${CMAKE_CURRENT_SOURCE_DIR}/icons/tigervnc.ico ${CMAKE_CURRENT_SOURCE_DIR}/icons/tigervnc.ico
DEPENDS ${ICO_DEPENDS} DEPENDS ${ICO_DEPENDS}
COMMENT "Generating icons/tigervnc.ico") COMMENT "Generating icons/tigervnc.ico")

if(PNG2ICNS_EXECUTABLE)
# FIXME: Should be a drop shadow here as well
foreach(SIZE ${MACOS_ICON_SIZES})
list(APPEND ICNS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/icons/tigervnc_${SIZE}.png)
endforeach()
add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/icons/tigervnc.icns
COMMAND ${PNG2ICNS_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/icons/tigervnc.icns ${ICNS_FILES}
DEPENDS ${ICNS_FILES}
COMMENT "Generating icons/tigervnc.icns")
endif()
endif() endif()

BIN
media/icons/tigervnc.icns View File


+ 1
- 1
release/makemacapp.in View File

mkdir -p "$APPROOT/Contents/Resources" mkdir -p "$APPROOT/Contents/Resources"


install -m 755 vncviewer/vncviewer "$APPROOT/Contents/MacOS/TigerVNC Viewer" install -m 755 vncviewer/vncviewer "$APPROOT/Contents/MacOS/TigerVNC Viewer"
install -m 644 $SRCDIR/release/tigervnc.icns "$APPROOT/Contents/Resources/"
install -m 644 $SRCDIR/media/icons/tigervnc.icns "$APPROOT/Contents/Resources/"
install -m 644 release/Info.plist "$APPROOT/Contents/" install -m 644 release/Info.plist "$APPROOT/Contents/"


for lang in `cat "$SRCDIR/po/LINGUAS"`; do for lang in `cat "$SRCDIR/po/LINGUAS"`; do

BIN
release/tigervnc.icns View File


Loading…
Cancel
Save