From 84c80c297fe0cc0e1018b379de76ee8cefc8db84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 18 Mar 2016 12:56:57 +0100 Subject: [PATCH] modules: CMake goes crazy when I'm using frameworks as imported targets. And the bug is closed as "wontfix". Dammit. https://cmake.org/Bug/view.php?id=13765 --- modules/FindSDL2.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/FindSDL2.cmake b/modules/FindSDL2.cmake index 60eba212b..afc8efdab 100644 --- a/modules/FindSDL2.cmake +++ b/modules/FindSDL2.cmake @@ -94,7 +94,14 @@ find_package_handle_standard_args("SDL2" DEFAULT_MSG if(NOT TARGET SDL2::SDL2) if(SDL2_LIBRARY_NEEDED) add_library(SDL2::SDL2 UNKNOWN IMPORTED) - set_property(TARGET SDL2::SDL2 PROPERTY IMPORTED_LOCATION ${SDL2_LIBRARY}) + + # Work around BUGGY framework support on OSX + # https://cmake.org/Bug/view.php?id=13765 + if(CORRADE_TARGET_APPLE AND ${SDL2_LIBRARY} MATCHES "\\.framework$") + set_property(TARGET SDL2::SDL2 PROPERTY IMPORTED_LOCATION ${SDL2_LIBRARY}/SDL2) + else() + set_property(TARGET SDL2::SDL2 PROPERTY IMPORTED_LOCATION ${SDL2_LIBRARY}) + endif() # Link frameworks on iOS if(CORRADE_TARGET_IOS)