From 296afdbde6675d570f5a2df095073ba4c8db659f Mon Sep 17 00:00:00 2001 From: Orazio <22700499+orazioedoardo@users.noreply.github.com> Date: Wed, 26 Jul 2023 12:08:59 +0200 Subject: [PATCH] Add CMake settings to build universal binary and find SDL in app bundle --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 27b1ca0..4d77ee6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,13 @@ if(MINGW) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static") endif() +if(APPLE) + set(MACOSX_RPATH) + set(CMAKE_BUILD_WITH_INSTALL_RPATH true) + set(CMAKE_INSTALL_RPATH "@executable_path/../Frameworks") + set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64") +endif() + # SDL2main is not needed set(SDL2_BUILDING_LIBRARY ON)