diff --git a/CMakeLists.txt b/CMakeLists.txt index 117af1ace..4ac5b1288 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -174,6 +174,12 @@ else() POST_BUILD COMMAND cp -r ${PROJECT_SOURCE_DIR}/include/SFML/* SFML.framework/Versions/2.0.0/Headers) + # adapt install directory to allow distributing dylibs/frameworks in user’s frameworks/application bundle + # NOTE : it's not required to link agains SFML.framework + set_target_properties(SFML PROPERTIES + BUILD_WITH_INSTALL_RPATH 1 + INSTALL_NAME_DIR "@executable_path/../Frameworks") + # install rule install(TARGETS SFML FRAMEWORK DESTINATION ${CMAKE_INSTALL_FRAMEWORK_PREFIX} diff --git a/cmake/Macros.cmake b/cmake/Macros.cmake index 83be942e2..348c918e6 100644 --- a/cmake/Macros.cmake +++ b/cmake/Macros.cmake @@ -150,7 +150,7 @@ macro(sfml_add_library target) MACOSX_FRAMEWORK_BUNDLE_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) endif() - # adapt install directory to allow distributing dylibs/frameworks in user’s frameworks + # adapt install directory to allow distributing dylibs/frameworks in user’s frameworks/application bundle set_target_properties(${target} PROPERTIES BUILD_WITH_INSTALL_RPATH 1 INSTALL_NAME_DIR "@executable_path/../Frameworks")