From 0e5b5bf5d9a33e1f44d0dbb876b0b26c7be83cec Mon Sep 17 00:00:00 2001
From: Eidolon <furyhunter600@gmail.com>
Date: Thu, 14 Jul 2022 23:57:53 -0500
Subject: [PATCH] cmake: Set plist properties for macOS bundle

yay icon
---
 src/sdl/CMakeLists.txt | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/sdl/CMakeLists.txt b/src/sdl/CMakeLists.txt
index 11c0f83985..d369d11c03 100644
--- a/src/sdl/CMakeLists.txt
+++ b/src/sdl/CMakeLists.txt
@@ -92,6 +92,16 @@ if(${SDL2_FOUND})
 			${CORE_FOUNDATION_LIBRARY}
 		)
 		set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}")
+
+		# Configure the app bundle icon and plist properties
+		target_sources(SRB2SDL2 PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/macosx/Srb2mac.icns")
+		set_target_properties(SRB2SDL2 PROPERTIES
+			MACOSX_BUNDLE_ICON_FILE "Srb2mac"
+			MACOSX_BUNDLE_BUNDLE_NAME "Sonic Robo Blast 2"
+			MACOSX_BUNDLE_BUNDLE_VERSION ${SRB2_VERSION}
+
+			RESOURCE "${CMAKE_CURRENT_SOURCE_DIR}/macosx/Srb2mac.icns"
+		)
 	endif()
 
 	target_link_libraries(SRB2SDL2 PRIVATE
-- 
GitLab