From 3320f2a5b999d88dfde60fb155ea739af0b808d2 Mon Sep 17 00:00:00 2001 From: Chris Anderson Date: Mon, 9 Sep 2024 19:48:23 -0400 Subject: [PATCH] Use CMAKE_FIND_FRAMEWORK ONLY for OpenGL on MacOS --- CMakeLists.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 411f3e4681..ef4dc79915 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -235,7 +235,16 @@ if(MSVC) endif() # Dependencies -find_package(OpenGL REQUIRED) +if (APPLE) + # Force CMake to use the installed version of OpenGL on macOS + set(_SAVE_CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK}) + set(CMAKE_FIND_FRAMEWORK ONLY) + find_package(OpenGL REQUIRED) + set(CMAKE_FIND_FRAMEWORK ${_SAVE_CMAKE_FIND_FRAMEWORK}) + unset(_SAVE_CMAKE_FIND_FRAMEWORK) +else() + find_package(OpenGL REQUIRED) +endif() find_package(LZ4 REQUIRED)