mac icon added

This commit is contained in:
2025-12-10 19:53:11 +01:00
parent 1e97b3cfa3
commit 5a755e9995
2 changed files with 40 additions and 1 deletions

View File

@ -61,7 +61,15 @@ set(TETRIS_SOURCES
)
if(APPLE)
add_executable(tetris MACOSX_BUNDLE ${TETRIS_SOURCES})
set(APP_ICON "${CMAKE_SOURCE_DIR}/assets/favicon/AppIcon.icns")
if(EXISTS "${APP_ICON}")
add_executable(tetris MACOSX_BUNDLE ${TETRIS_SOURCES} "${APP_ICON}")
set_source_files_properties("${APP_ICON}" PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
set_target_properties(tetris PROPERTIES MACOSX_BUNDLE_ICON_FILE "AppIcon.icns")
else()
message(WARNING "App icon not found at ${APP_ICON}; bundle will use default icon")
add_executable(tetris MACOSX_BUNDLE ${TETRIS_SOURCES})
endif()
else()
add_executable(tetris ${TETRIS_SOURCES})
endif()