diff --git a/media/CMakeLists.txt b/media/CMakeLists.txt index 248e2213d1..28e09d1a85 100644 --- a/media/CMakeLists.txt +++ b/media/CMakeLists.txt @@ -1,16 +1,21 @@ set(LINUX_ICON_SIZES 16 22 24 32 48 64 128) 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(PNG2ICNS_EXECUTABLE png2icns) if(CONVERT_EXECUTABLE) set(ICON_FILES icons/tigervnc.ico) foreach(SIZE ${LINUX_ICON_SIZES}) list(APPEND ICON_FILES ${CMAKE_CURRENT_SOURCE_DIR}/icons/tigervnc_${SIZE}.png) endforeach() + if(PNG2ICNS_EXECUTABLE) + list(APPEND ICON_FILES icons/tigervnc.icns) + endif() 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) set(ICON_SRC_FILE ${CMAKE_CURRENT_SOURCE_DIR}/tigervnc_${SIZE}.svg) else() @@ -37,4 +42,16 @@ if(CONVERT_EXECUTABLE) ${CMAKE_CURRENT_SOURCE_DIR}/icons/tigervnc.ico DEPENDS ${ICO_DEPENDS} 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() diff --git a/media/icons/tigervnc.icns b/media/icons/tigervnc.icns new file mode 100644 index 0000000000..3c1385d831 Binary files /dev/null and b/media/icons/tigervnc.icns differ diff --git a/release/makemacapp.in b/release/makemacapp.in index acdfa2080c..7f195eda19 100644 --- a/release/makemacapp.in +++ b/release/makemacapp.in @@ -42,7 +42,7 @@ mkdir -p "$APPROOT/Contents/MacOS" mkdir -p "$APPROOT/Contents/Resources" 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/" for lang in `cat "$SRCDIR/po/LINGUAS"`; do diff --git a/release/tigervnc.icns b/release/tigervnc.icns deleted file mode 100644 index 22bb1c3e88..0000000000 Binary files a/release/tigervnc.icns and /dev/null differ