fixed bundlle

This commit is contained in:
2025-12-10 20:37:31 +01:00
parent afcc1dd77d
commit 9e0e1b2873
2 changed files with 9 additions and 7 deletions

View File

@ -65,10 +65,16 @@ if(APPLE)
if(EXISTS "${APP_ICON}") if(EXISTS "${APP_ICON}")
add_executable(tetris MACOSX_BUNDLE ${TETRIS_SOURCES} "${APP_ICON}") add_executable(tetris MACOSX_BUNDLE ${TETRIS_SOURCES} "${APP_ICON}")
set_source_files_properties("${APP_ICON}" PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") set_source_files_properties("${APP_ICON}" PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
set_target_properties(tetris PROPERTIES MACOSX_BUNDLE_ICON_FILE "AppIcon") set_target_properties(tetris PROPERTIES
MACOSX_BUNDLE_ICON_FILE "AppIcon"
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/cmake/MacBundleInfo.plist.in"
)
else() else()
message(WARNING "App icon not found at ${APP_ICON}; bundle will use default icon") message(WARNING "App icon not found at ${APP_ICON}; bundle will use default icon")
add_executable(tetris MACOSX_BUNDLE ${TETRIS_SOURCES}) add_executable(tetris MACOSX_BUNDLE ${TETRIS_SOURCES})
set_target_properties(tetris PROPERTIES
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/cmake/MacBundleInfo.plist.in"
)
endif() endif()
else() else()
add_executable(tetris ${TETRIS_SOURCES}) add_executable(tetris ${TETRIS_SOURCES})
@ -80,12 +86,6 @@ if (WIN32)
target_sources(tetris PRIVATE src/app_icon.rc) target_sources(tetris PRIVATE src/app_icon.rc)
endif() endif()
if(APPLE)
set_target_properties(tetris PROPERTIES
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/cmake/MacBundleInfo.plist.in"
)
endif()
if (WIN32) if (WIN32)
# Ensure favicon.ico is available in the build directory for the resource compiler # Ensure favicon.ico is available in the build directory for the resource compiler
set(FAVICON_SRC "${CMAKE_SOURCE_DIR}/assets/favicon/favicon.ico") set(FAVICON_SRC "${CMAKE_SOURCE_DIR}/assets/favicon/favicon.ico")

View File

@ -18,6 +18,8 @@
<string>1.0</string> <string>1.0</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.0</string> <string>1.0</string>
<key>CFBundleIconFile</key>
<string>AppIcon</string>
<key>LSMinimumSystemVersion</key> <key>LSMinimumSystemVersion</key>
<string>12.0</string> <string>12.0</string>
<key>NSHighResolutionCapable</key> <key>NSHighResolutionCapable</key>