diff --git a/qrenderdoc/qrenderdoc.pro b/qrenderdoc/qrenderdoc.pro index b186a5981..b2943e17f 100644 --- a/qrenderdoc/qrenderdoc.pro +++ b/qrenderdoc/qrenderdoc.pro @@ -134,6 +134,10 @@ win32 { macx: { DEFINES += RENDERDOC_PLATFORM_POSIX RENDERDOC_PLATFORM_APPLE ICON = $$OSX_ICONFILE + + librd.files = $$files($$DESTDIR/librenderdoc.dylib) + librd.path = Contents/lib + QMAKE_BUNDLE_DATA += librd INFO_PLIST_PATH = $$shell_quote($$DESTDIR/$${TARGET}.app/Contents/Info.plist) QMAKE_POST_LINK += $$_PRO_FILE_PWD_/../util/set_plist_version.sh $${RENDERDOC_VERSION}.0 $${INFO_PLIST_PATH} diff --git a/renderdoc/CMakeLists.txt b/renderdoc/CMakeLists.txt index 5ae997bc9..47a0e3099 100644 --- a/renderdoc/CMakeLists.txt +++ b/renderdoc/CMakeLists.txt @@ -449,6 +449,14 @@ if(UNIX AND NOT ANDROID AND NOT APPLE) set_target_properties(renderdoc PROPERTIES LINK_FLAGS "-Wl,--undefined,force_include_libentry -Wl,--version-script,${CMAKE_CURRENT_SOURCE_DIR}/renderdoc.version -Wl,--no-undefined") endif() +# On macOS set the rpath so that linked libraries are relative to the executable, not absolute +if(APPLE) + set_target_properties(renderdoc PROPERTIES MACOSX_RPATH 1) + set_target_properties(renderdoc PROPERTIES INSTALL_RPATH "@executable_path/../lib") + set_target_properties(renderdoc PROPERTIES INSTALL_NAME_DIR "@executable_path/../lib") + set_target_properties(renderdoc PROPERTIES BUILD_WITH_INSTALL_RPATH 1) +endif() + if(ANDROID) set_target_properties(renderdoc PROPERTIES LINK_FLAGS "-Wl,--undefined,force_include_libentry -Wl,--build-id") # rename output library