Skip to content

Commit 73a3149

Browse files
glebmAJenbo
authored andcommitted
OSX Tiger: Fix icon
Finder on OSX Tiger can only handle `icns` files with up to 128x128 icons. Adds a file with 128x128, 48x48, 32x32, and 16x16 icons.
1 parent c47ff28 commit 73a3149

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

CMakeLists.txt

+9-3
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,6 @@ else()
343343
Source/main.cpp
344344
Packaging/windows/devilutionx.exe.manifest
345345
Packaging/windows/devilutionx.rc
346-
Packaging/apple/AppIcon.icns
347346
Packaging/apple/LaunchScreen.storyboard)
348347

349348
if(CMAKE_STRIP AND NOT DEVILUTIONX_DISABLE_STRIP)
@@ -382,7 +381,6 @@ include(functions/set_relative_file_macro)
382381
set_relative_file_macro(${BIN_TARGET})
383382

384383
if(APPLE)
385-
set_source_files_properties("./Packaging/apple/AppIcon.icns" PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
386384
set(MACOSX_BUNDLE_GUI_IDENTIFIER com.diasurgical.devilutionx)
387385
set(MACOSX_BUNDLE_COPYRIGHT Unlicense)
388386
set(MACOSX_BUNDLE_BUNDLE_NAME devilutionx)
@@ -399,7 +397,15 @@ if(APPLE)
399397
set(MACOSX_BUNDLE_REQUIRED_PLATFORM Carbon)
400398
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.12.0")
401399
endif()
402-
set_target_properties(${BIN_TARGET} PROPERTIES MACOSX_BUNDLE_ICON_FILE "AppIcon.icns")
400+
if(DARWIN_MAJOR_VERSION VERSION_LESS 9)
401+
# Finder on OSX Tiger can only handle icns files with up to 128x128 icons.
402+
set(_icon_file AppIcon_128)
403+
else()
404+
set(_icon_file AppIcon)
405+
endif()
406+
target_sources(${BIN_TARGET} PRIVATE "Packaging/apple/${_icon_file}.icns")
407+
set_source_files_properties("./Packaging/apple/${_icon_file}.icns" PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
408+
set_target_properties(${BIN_TARGET} PROPERTIES MACOSX_BUNDLE_ICON_FILE "${_icon_file}.icns")
403409
set_target_properties(${BIN_TARGET} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Packaging/apple/Info.plist")
404410

405411
install (TARGETS ${BIN_TARGET} DESTINATION ./)

Packaging/apple/AppIcon_128.icns

22 KB
Binary file not shown.

0 commit comments

Comments
 (0)