From ce5a1ed05477d0e89e3658ba6acaba7b5490a609 Mon Sep 17 00:00:00 2001 From: dob205 Date: Thu, 7 Oct 2021 10:00:11 +0200 Subject: [PATCH] Fixes for library search on macOS Fixes the screenshot function on macOS if the user installed libpng via homebrew. Previously it would link to older libraries if those were installed, while at runtime it decided to run the version installed by homebrew. --- src/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a2bead497..47cb558db 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -63,6 +63,11 @@ if(MINGW) set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" ".dll.a") endif() +if(APPLE) + # Force using the newest library if it's installed by homebrew + set(CMAKE_FIND_FRAMEWORK LAST) +endif() + find_package(Freetype REQUIRED) include_directories(${FREETYPE_INCLUDE_DIRS})