Skip to content

Commit

Permalink
OSX Tiger: Fix icon
Browse files Browse the repository at this point in the history
OSX Tiger can only handle `icns` files with up to 256x256 icons.

Adds a file with 256x256, 128x128, 48x48, 32x32, and 16x16 icons.
  • Loading branch information
glebm committed Dec 10, 2024
1 parent 044d11d commit ac14530
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,6 @@ include(functions/set_relative_file_macro)
set_relative_file_macro(${BIN_TARGET})

if(APPLE)
set_source_files_properties("./Packaging/apple/AppIcon.icns" PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
set(MACOSX_BUNDLE_GUI_IDENTIFIER com.diasurgical.devilutionx)
set(MACOSX_BUNDLE_COPYRIGHT Unlicense)
set(MACOSX_BUNDLE_BUNDLE_NAME devilutionx)
Expand All @@ -399,7 +398,14 @@ if(APPLE)
set(MACOSX_BUNDLE_REQUIRED_PLATFORM Carbon)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.12.0")
endif()
set_target_properties(${BIN_TARGET} PROPERTIES MACOSX_BUNDLE_ICON_FILE "AppIcon.icns")
if(DARWIN_MAJOR_VERSION VERSION_LESS 9)
# OSX Tiger can only handle icns files with up to 256x256 icons.
set_source_files_properties("./Packaging/apple/AppIcon_256.icns" PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
set_target_properties(${BIN_TARGET} PROPERTIES MACOSX_BUNDLE_ICON_FILE "AppIcon_256.icns")
else()
set_source_files_properties("./Packaging/apple/AppIcon.icns" PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
set_target_properties(${BIN_TARGET} PROPERTIES MACOSX_BUNDLE_ICON_FILE "AppIcon.icns")
endif()
set_target_properties(${BIN_TARGET} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Packaging/apple/Info.plist")

install (TARGETS ${BIN_TARGET} DESTINATION ./)
Expand Down
Binary file added Packaging/apple/AppIcon_256.icns
Binary file not shown.

0 comments on commit ac14530

Please sign in to comment.