aboutsummaryrefslogtreecommitdiffstats
path: root/media/CMakeLists.txt
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2022-05-11 12:42:18 +0200
committerPierre Ossman <ossman@cendio.se>2022-05-11 13:06:27 +0200
commit1134641583b8612b3e6ec73388f0c4b929d36fd6 (patch)
treec29698150b5adb76facbaccf0c85fbcea80597ee /media/CMakeLists.txt
parentdf8eddfae66e3ead8ed0707cb5a6bdc97a319d75 (diff)
downloadtigervnc-1134641583b8612b3e6ec73388f0c4b929d36fd6.tar.gz
tigervnc-1134641583b8612b3e6ec73388f0c4b929d36fd6.zip
Automatically generate macOS icon file
Diffstat (limited to 'media/CMakeLists.txt')
-rw-r--r--media/CMakeLists.txt19
1 files changed, 18 insertions, 1 deletions
diff --git a/media/CMakeLists.txt b/media/CMakeLists.txt
index 248e2213..28e09d1a 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()