diff --git a/qbs/imports/QtcTool.qbs b/qbs/imports/QtcTool.qbs index 9000f76b1e2..4870a65815a 100644 --- a/qbs/imports/QtcTool.qbs +++ b/qbs/imports/QtcTool.qbs @@ -1,10 +1,19 @@ -import qbs 1.0 +import qbs +import qbs.FileInfo QtcProduct { type: "application" // no Mac app bundle installDir: project.ide_libexec_path - cpp.rpaths: qbs.targetOS.contains("osx") - ? ["@executable_path/../" + project.ide_library_path] - : ["$ORIGIN/../" + project.ide_library_path] + cpp.rpaths: { + var relativePathToLibs + = FileInfo.relativePath(project.ide_libexec_path, project.ide_library_path); + var relativePathToPlugins + = FileInfo.relativePath(project.ide_libexec_path, project.ide_plugin_path); + var prefix = qbs.targetOS.contains("osx") ? "@executable_path" : "$ORIGIN"; + return [ + FileInfo.joinPaths(prefix, relativePathToLibs), + FileInfo.joinPaths(prefix, relativePathToPlugins) + ]; + } } diff --git a/src/plugins/cpaster/frontend/frontend.qbs b/src/plugins/cpaster/frontend/frontend.qbs index d42265ad574..552ac573751 100644 --- a/src/plugins/cpaster/frontend/frontend.qbs +++ b/src/plugins/cpaster/frontend/frontend.qbs @@ -10,11 +10,6 @@ QtcTool { Depends { name: "Core" } Depends { name: "CppTools" } - cpp.rpaths: [ - "$ORIGIN/../" + project.libDirName + "/qtcreator", - "$ORIGIN/../" + project.libDirName + "/qtcreator/plugins", - ] - Group { name: "Frontend Sources" files: [ diff --git a/src/qtcreatortool.pri b/src/qtcreatortool.pri index 3fb262ad1d8..2d33df626cd 100644 --- a/src/qtcreatortool.pri +++ b/src/qtcreatortool.pri @@ -1,5 +1,4 @@ include(../qtcreator.pri) -include(rpath.pri) TEMPLATE = app @@ -7,5 +6,15 @@ CONFIG += console CONFIG -= app_bundle DESTDIR = $$IDE_LIBEXEC_PATH +REL_PATH_TO_LIBS = $$relative_path($$IDE_LIBRARY_PATH, $$IDE_LIBEXEC_PATH) +REL_PATH_TO_PLUGINS = $$relative_path($$IDE_PLUGIN_PATH, $$IDE_LIBEXEC_PATH) +osx { + QMAKE_LFLAGS += -Wl,-rpath,@executable_path/$$REL_PATH_TO_LIBS,-rpath,@executable_path/$$REL_PATH_TO_PLUGINS +} else { + QMAKE_RPATHDIR += \$\$ORIGIN/$$REL_PATH_TO_LIBS + QMAKE_RPATHDIR += \$\$ORIGIN/$$REL_PATH_TO_PLUGINS +} +include(rpath.pri) + target.path = $$QTC_PREFIX/$$relative_path($$IDE_LIBEXEC_PATH, $$IDE_BUILD_TREE) INSTALLS += target