diff --git a/CMakeLists.txt b/CMakeLists.txt index a7c4d77b1..36573ed17 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -414,15 +414,16 @@ if(UNIX AND APPLE) endif() # Add the icon + install(FILES ${Launcher_Branding_ICNS} DESTINATION ${RESOURCES_DEST_DIR} RENAME ${Launcher_Name}.icns) + find_program(ACTOOL_EXE actool DOC "Path to the apple asset catalog compiler") if(ACTOOL_EXE) set(ASSETS_OUT_DIR "${CMAKE_BINARY_DIR}/program_info") set(GENERATED_ASSETS_CAR "${ASSETS_OUT_DIR}/Assets.car") - set(GENERATED_LAUNCHER_ICNS "${ASSETS_OUT_DIR}/${Launcher_Name}.icns") - set(ICON_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/${Launcher_Branding_macos_ICON}") + set(ICON_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/${Launcher_Branding_MAC_ICON}") add_custom_command( - OUTPUT "${GENERATED_ASSETS_CAR}" "${GENERATED_LAUNCHER_ICNS}" + OUTPUT "${GENERATED_ASSETS_CAR}" COMMAND ${ACTOOL_EXE} "${ICON_SOURCE}" --compile "${ASSETS_OUT_DIR}" --output-partial-info-plist /dev/null @@ -430,18 +431,14 @@ if(UNIX AND APPLE) --include-all-app-icons --enable-on-demand-resources NO --target-device mac - --minimum-deployment-target 10.13 + --minimum-deployment-target ${CMAKE_OSX_DEPLOYMENT_TARGET} --platform macosx - > /dev/null DEPENDS "${ICON_SOURCE}" COMMENT "Compiling asset catalog (${ICON_SOURCE})" VERBATIM ) - add_custom_target(compile_assets ALL DEPENDS "${GENERATED_ASSETS_CAR}" "${GENERATED_LAUNCHER_ICNS}") - install( - FILES "${GENERATED_ASSETS_CAR}" "${GENERATED_LAUNCHER_ICNS}" - DESTINATION "${RESOURCES_DEST_DIR}" - ) + add_custom_target(compile_assets ALL DEPENDS "${GENERATED_ASSETS_CAR}") + install(FILES "${GENERATED_ASSETS_CAR}" DESTINATION "${RESOURCES_DEST_DIR}") else() message(FATAL_ERROR "actool not found. Cannot compile macOS app icons.\n" "Install Xcode command line tools: 'xcode-select --install'") diff --git a/program_info/CMakeLists.txt b/program_info/CMakeLists.txt index a248192d8..f46aba871 100644 --- a/program_info/CMakeLists.txt +++ b/program_info/CMakeLists.txt @@ -30,7 +30,8 @@ set(Launcher_Desktop "program_info/${Launcher_AppID}.desktop" PARENT_SCOPE) set(Launcher_mrpack_MIMEInfo "program_info/modrinth-mrpack-mime.xml" PARENT_SCOPE) set(Launcher_MetaInfo "program_info/${Launcher_AppID}.metainfo.xml" PARENT_SCOPE) set(Launcher_SVG "program_info/${Launcher_SVGFileName}" PARENT_SCOPE) -set(Launcher_Branding_macos_ICON "program_info/PrismLauncher.icon" PARENT_SCOPE) +set(Launcher_Branding_ICNS "program_info/prismlauncher.icns" PARENT_SCOPE) +set(Launcher_Branding_MAC_ICON "program_info/PrismLauncher.icon" PARENT_SCOPE) set(Launcher_Branding_ICO "program_info/prismlauncher.ico") set(Launcher_Branding_ICO "${Launcher_Branding_ICO}" PARENT_SCOPE) set(Launcher_Branding_WindowsRC "program_info/prismlauncher.rc" PARENT_SCOPE)