Skip to content

Commit 910bcc8

Browse files
committed
Merge pull request #80 from vonagam/fix_rpath_for_os_x
Fix rpath for OS X
2 parents 9f4c4ab + 448949e commit 910bcc8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cmake/Macros.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ macro(csfml_add_library target)
5656
# link the target to its external dependencies (C++ SFML libraries)
5757
target_link_libraries(${target} ${THIS_DEPENDS})
5858

59+
# build dylibs
60+
if(SFML_OS_MACOSX AND BUILD_SHARED_LIBS)
61+
# adapt install directory to allow distributing dylibs in user’s application bundle
62+
set_target_properties(${target} PROPERTIES
63+
BUILD_WITH_INSTALL_RPATH 1
64+
INSTALL_NAME_DIR "@rpath")
65+
endif()
66+
5967
# add the install rule
6068
install(TARGETS ${target}
6169
RUNTIME DESTINATION bin COMPONENT bin

0 commit comments

Comments
 (0)