diff --git a/cmake/Macros.cmake b/cmake/Macros.cmake index 482b9dcb..d94f4b07 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 edddc457..09daa851 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()