From 6c57af7269d32663cbdb36c5c8939d928bda983a Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 22 Mar 2022 15:58:26 +0100 Subject: Qt support: Consider QT_INSTALL_PREFIX when reading .prl files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... for gathering plugin dependencies with static builds. Task-number: QBS-1692 Change-Id: I57322da56c5145cec0250f204b4b06a3a9140bf6 Reviewed-by: Jörg Bornemann --- share/qbs/module-providers/Qt/setup-qt.js | 1 + share/qbs/module-providers/Qt/templates/core.qbs | 1 + share/qbs/module-providers/Qt/templates/qml.js | 3 ++- share/qbs/module-providers/Qt/templates/qml.qbs | 3 ++- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/share/qbs/module-providers/Qt/setup-qt.js b/share/qbs/module-providers/Qt/setup-qt.js index 6dd42312c..c7efef014 100644 --- a/share/qbs/module-providers/Qt/setup-qt.js +++ b/share/qbs/module-providers/Qt/setup-qt.js @@ -1425,6 +1425,7 @@ function replaceSpecialValues(content, module, qtProps, abi) { qtConfig: ModUtils.toJSLiteral(qtProps.qtConfigItems), binPath: ModUtils.toJSLiteral(qtProps.binaryPath), installPath: ModUtils.toJSLiteral(qtProps.installPath), + installPrefixPath: ModUtils.toJSLiteral(qtProps.installPrefixPath), libPath: ModUtils.toJSLiteral(qtProps.libraryPath), libExecPath: ModUtils.toJSLiteral(qtProps.libExecPath), qmlLibExecPath: ModUtils.toJSLiteral(qtProps.qmlLibExecPath), diff --git a/share/qbs/module-providers/Qt/templates/core.qbs b/share/qbs/module-providers/Qt/templates/core.qbs index 18ad5a2ab..fd81930ba 100644 --- a/share/qbs/module-providers/Qt/templates/core.qbs +++ b/share/qbs/module-providers/Qt/templates/core.qbs @@ -43,6 +43,7 @@ Module { property path installPath: @installPath@ property path incPath: @incPath@ property path libPath: @libPath@ + property path installPrefixPath: @installPrefixPath@ property path libExecPath: @libExecPath@ property path qmlLibExecPath: @qmlLibExecPath@ property path pluginPath: @pluginPath@ diff --git a/share/qbs/module-providers/Qt/templates/qml.js b/share/qbs/module-providers/Qt/templates/qml.js index a159aa907..36f60f8a3 100644 --- a/share/qbs/module-providers/Qt/templates/qml.js +++ b/share/qbs/module-providers/Qt/templates/qml.js @@ -39,7 +39,7 @@ function getPrlRhs(line) return line.split('=')[1].trim(); } -function getLibsForPlugin(pluginData, buildVariant, targetOS, toolchain, qtLibDir) +function getLibsForPlugin(pluginData, buildVariant, targetOS, toolchain, qtLibDir, qtDir) { if (!pluginData.path) return ""; @@ -74,6 +74,7 @@ function getLibsForPlugin(pluginData, buildVariant, targetOS, toolchain, qtLibDi otherLibsLine = otherLibsLine.replace(/-l([^ ]+)/g, "$1" + ".lib"); } otherLibsLine = otherLibsLine.replace(/\$\$\[QT_INSTALL_LIBS\]/g, qtLibDir); + otherLibsLine = otherLibsLine.replace(/\$\$\[QT_INSTALL_PREFIX\]/g, qtDir); otherLibs = otherLibs.concat(otherLibsLine.split(' ')); } } diff --git a/share/qbs/module-providers/Qt/templates/qml.qbs b/share/qbs/module-providers/Qt/templates/qml.qbs index 88e973141..747558f10 100644 --- a/share/qbs/module-providers/Qt/templates/qml.qbs +++ b/share/qbs/module-providers/Qt/templates/qml.qbs @@ -174,7 +174,8 @@ QtModule { product.Qt.core.qtBuildVariant, product.qbs.targetOS, product.qbs.toolchain, - product.Qt.core.libPath); + product.Qt.core.libPath, + product.Qt.core.installPrefixPath); for (var i = 0; i < libs.length; ++i) { var lib = libs[i]; if (!lib.endsWith(product.cpp.objectSuffix) -- cgit v1.2.3