diff --git a/CMakeLists.txt b/CMakeLists.txt index 06c42438f..a7c4d77b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -414,8 +414,39 @@ if(UNIX AND APPLE) endif() # Add the icon - install(FILES ${Launcher_Branding_ICNS} DESTINATION ${RESOURCES_DEST_DIR} RENAME ${Launcher_Name}.icns) - install(FILES ${Launcher_Branding_macos_ASSETSCAR} DESTINATION ${RESOURCES_DEST_DIR} ) + 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}") + + add_custom_command( + OUTPUT "${GENERATED_ASSETS_CAR}" "${GENERATED_LAUNCHER_ICNS}" + COMMAND ${ACTOOL_EXE} "${ICON_SOURCE}" + --compile "${ASSETS_OUT_DIR}" + --output-partial-info-plist /dev/null + --app-icon PrismLauncher + --include-all-app-icons + --enable-on-demand-resources NO + --target-device mac + --minimum-deployment-target 10.13 + --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}" + ) + else() + message(FATAL_ERROR "actool not found. Cannot compile macOS app icons.\n" + "Install Xcode command line tools: 'xcode-select --install'") + endif() + elseif(UNIX) include(KDEInstallDirs) diff --git a/program_info/Assets.car b/program_info/Assets.car deleted file mode 100644 index 5a52f3b80..000000000 Binary files a/program_info/Assets.car and /dev/null differ diff --git a/program_info/CMakeLists.txt b/program_info/CMakeLists.txt index f8a8d604c..a248192d8 100644 --- a/program_info/CMakeLists.txt +++ b/program_info/CMakeLists.txt @@ -30,8 +30,7 @@ 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_ICNS "program_info/prismlauncher.icns" PARENT_SCOPE) -set(Launcher_Branding_macos_ASSETSCAR "program_info/Assets.car" PARENT_SCOPE) +set(Launcher_Branding_macos_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) diff --git a/program_info/PrismLauncher.icon/Assets/block.svg b/program_info/PrismLauncher.icon/Assets/block.svg new file mode 100644 index 000000000..08a80d8bd --- /dev/null +++ b/program_info/PrismLauncher.icon/Assets/block.svg @@ -0,0 +1,91 @@ + + + Prism Launcher Logo + + + + + + + + + + + + + Prism Launcher Logo + 19/10/2022 + + + Prism Launcher + + + + + AutiOne, Boba, ely, Fulmine, gon sawa, Pankakes, tobimori, Zeke + + + https://github.com/PrismLauncher/PrismLauncher + + + Prism Launcher + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/program_info/PrismLauncher.icon/Assets/rainbow.svg b/program_info/PrismLauncher.icon/Assets/rainbow.svg new file mode 100644 index 000000000..d47bb615a --- /dev/null +++ b/program_info/PrismLauncher.icon/Assets/rainbow.svg @@ -0,0 +1,95 @@ + + + Prism Launcher Logo + + + + + + + + + + + + + + + Prism Launcher Logo + 19/10/2022 + + + Prism Launcher + + + + + AutiOne, Boba, ely, Fulmine, gon sawa, Pankakes, tobimori, Zeke + + + https://github.com/PrismLauncher/PrismLauncher + + + Prism Launcher + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/program_info/PrismLauncher.icon/icon.json b/program_info/PrismLauncher.icon/icon.json new file mode 100644 index 000000000..131c7de4c --- /dev/null +++ b/program_info/PrismLauncher.icon/icon.json @@ -0,0 +1,72 @@ +{ + "color-space-for-untagged-svg-colors" : "display-p3", + "fill" : { + "solid" : "extended-gray:1.00000,1.00000" + }, + "groups" : [ + { + "layers" : [ + { + "image-name" : "block.svg", + "name" : "block", + "position" : { + "scale" : 19.28, + "translation-in-points" : [ + 0, + 0 + ] + } + } + ], + "shadow" : { + "kind" : "neutral", + "opacity" : 0.5 + }, + "translucency" : { + "enabled" : true, + "value" : 0.5 + } + }, + { + "blur-material-specializations" : [ + { + "value" : 0.5 + }, + { + "appearance" : "dark", + "value" : null + } + ], + "layers" : [ + { + "blend-mode" : "normal", + "fill" : "automatic", + "glass" : true, + "hidden" : false, + "image-name" : "rainbow.svg", + "name" : "rainbow", + "position" : { + "scale" : 19.28, + "translation-in-points" : [ + 0, + 0 + ] + } + } + ], + "shadow" : { + "kind" : "neutral", + "opacity" : 0.5 + }, + "translucency" : { + "enabled" : false, + "value" : 0.5 + } + } + ], + "supported-platforms" : { + "squares" : [ + "macOS" + ] + } +} \ No newline at end of file