From 285ee488075615c05a8ae8291e5b90f43bb593e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 26 Sep 2015 21:34:12 +0200 Subject: [PATCH] modules: fix finding of SDL2 on OSX. See the file comment for details. --- modules/FindSDL2.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/FindSDL2.cmake b/modules/FindSDL2.cmake index d7e08dd43..aa95cbf12 100644 --- a/modules/FindSDL2.cmake +++ b/modules/FindSDL2.cmake @@ -37,7 +37,13 @@ if(CORRADE_TARGET_EMSCRIPTEN) set(_SDL2_PATH_SUFFIXES SDL) else() - find_library(SDL2_LIBRARY SDL2 + find_library(SDL2_LIBRARY + # Compiling SDL2 from scratch on OSX creates dead libSDL2.so symlink + # which CMake somehow prefers before the SDL2-2.0.dylib file. Making + # the dylib first so it is preferred. + NAMES SDL2-2.0 SDL2 + + # Precompiled libraries for Windows are in x86/x64 subdirectories PATH_SUFFIXES lib/x86 lib/x64) set(SDL2_LIBRARY_NEEDED SDL2_LIBRARY) set(_SDL2_PATH_SUFFIXES SDL2)