From 6b9805310181bdcfda512800748819fb967ecf07 Mon Sep 17 00:00:00 2001 From: Marco Antognini Date: Thu, 4 Aug 2011 00:38:35 +0200 Subject: [PATCH] Improved OSX/Cmake and dylibs' execution path --- cmake/Macros.cmake | 8 +++++++- src/SFML/Graphics/CMakeLists.txt | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cmake/Macros.cmake b/cmake/Macros.cmake index 482b9dcb3..d94f4b070 100644 --- a/cmake/Macros.cmake +++ b/cmake/Macros.cmake @@ -142,7 +142,13 @@ macro(sfml_add_library target) if(THIS_EXTERNAL_LIBS) if(BUILD_SHARED_LIBS) # in shared build, we use the regular linker commands - target_link_libraries(${target} ${THIS_EXTERNAL_LIBS}) + target_link_libraries(${target} ${THIS_EXTERNAL_LIBS}) + + if (MACOSX) + set_target_properties(${target} PROPERTIES + BUILD_WITH_INSTALL_RPATH 1 + INSTALL_NAME_DIR "@executable_path/../Frameworks") + endif() else() # in static build there's no link stage, but with some compilers it is possible to force # the generated static library to directly contain the symbols from its dependencies diff --git a/src/SFML/Graphics/CMakeLists.txt b/src/SFML/Graphics/CMakeLists.txt index edddc4576..09daa851d 100644 --- a/src/SFML/Graphics/CMakeLists.txt +++ b/src/SFML/Graphics/CMakeLists.txt @@ -83,7 +83,7 @@ if(BUILD_SHARED_LIBS) set(GRAPHICS_EXT_LIBS ${GRAPHICS_EXT_LIBS} ${X11_LIBRARIES}) elseif(MACOSX) # We use static version of freetype so we need to link against zlib. - set(GRAPHICS_EXT_LIBS ${GRAPHICS_EXT_LIBS} ${ZLIB_LIBRARIES} "-framework AGL") + set(GRAPHICS_EXT_LIBS ${GRAPHICS_EXT_LIBS} ${ZLIB_LIBRARIES}) endif() endif()