From 769f7ebe8b1164a0958c85b8a1f51769a735c281 Mon Sep 17 00:00:00 2001 From: Alex Grant Benedict Date: Mon, 22 Nov 2021 17:41:02 -0700 Subject: [PATCH] Some minor changes to build files to get this to build and run on macOS. --- CMakeLists.txt | 5 +++++ cmake/modules/FindSDL2.cmake | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0f88c137c..3414f623f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -643,6 +643,11 @@ endif() set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH}) +if(APPLE) +list(APPEND CMAKE_PREFIX_PATH /opt/homebrew/) +endif() + + find_package(Lua51 REQUIRED) find_package(PNG REQUIRED) find_package(SDL2 REQUIRED) diff --git a/cmake/modules/FindSDL2.cmake b/cmake/modules/FindSDL2.cmake index 926dd0526..cbfd8aa97 100644 --- a/cmake/modules/FindSDL2.cmake +++ b/cmake/modules/FindSDL2.cmake @@ -42,9 +42,9 @@ if(SDL2_LIBRARY_TEMP) # I think it has something to do with the CACHE STRING. # So I use a temporary variable until the end so I can set the # "real" variable in one-shot. - if(APPLE) - set(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} "-framework Cocoa") - endif() + #if(APPLE) + # set(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} "-framework Cocoa") + #endif() # For threads, as mentioned Apple doesn't need this. # In fact, there seems to be a problem if I used the Threads package