aboutsummaryrefslogtreecommitdiffstats
path: root/share/qbs/module-providers/Qt/setup-qt.js
diff options
context:
space:
mode:
Diffstat (limited to 'share/qbs/module-providers/Qt/setup-qt.js')
-rw-r--r--share/qbs/module-providers/Qt/setup-qt.js36
1 files changed, 26 insertions, 10 deletions
diff --git a/share/qbs/module-providers/Qt/setup-qt.js b/share/qbs/module-providers/Qt/setup-qt.js
index 5cf1bcb44..060ea7a0a 100644
--- a/share/qbs/module-providers/Qt/setup-qt.js
+++ b/share/qbs/module-providers/Qt/setup-qt.js
@@ -268,8 +268,14 @@ function getQtProperties(qmakeFilePath, qbs) {
(pathQueryValue(queryResult, "QT_INSTALL_DATA"), "mkspecs");
}
- if (Utilities.versionCompare(qtProps.qtVersion, "6") >= 0)
- qtProps.libExecPath = pathQueryValue(queryResult, "QT_INSTALL_LIBEXECS");
+ if (Utilities.versionCompare(qtProps.qtVersion, "6") >= 0) {
+ qtProps.libExecPath = pathQueryValue(queryResult, "QT_HOST_LIBEXECS")
+ || pathQueryValue(queryResult, "QT_INSTALL_LIBEXECS");
+ }
+
+ // QML tools were only moved in Qt 6.2.
+ qtProps.qmlLibExecPath = Utilities.versionCompare(qtProps.qtVersion, "6.2") >= 0
+ ? qtProps.libExecPath : qtProps.binaryPath
if (!File.exists(qtProps.mkspecBasePath))
throw "Cannot extract the mkspecs directory.";
@@ -567,11 +573,15 @@ function libraryBaseName(modInfo, qtProps, debugBuild) {
|| modInfo.name === "DataVisualization"
|| modInfo.name === "Phonon";
- var libName = !modInfo.modulePrefix && !libNameBroken ? "Qt" : modInfo.modulePrefix;
- if (qtProps.qtMajorVersion >= 5 && !isFramework(modInfo, qtProps) && !libNameBroken)
- libName += qtProps.qtMajorVersion;
+ var libName = "";
+ if (!modInfo.isExternal) {
+ libName += !modInfo.modulePrefix && !libNameBroken ? "Qt" : modInfo.modulePrefix;
+ if (qtProps.qtMajorVersion >= 5 && !isFramework(modInfo, qtProps) && !libNameBroken)
+ libName += qtProps.qtMajorVersion;
+ }
libName += moduleNameWithoutPrefix(modInfo);
- libName += qtProps.qtLibInfix;
+ if (!modInfo.isExternal)
+ libName += qtProps.qtLibInfix;
return libBaseName(modInfo, libName, debugBuild, qtProps);
}
@@ -967,7 +977,8 @@ function extractPaths(rhs, filePath) {
if (endIndex === -1)
endIndex = rhs.length;
}
- paths.push(FileInfo.cleanPath(rhs.slice(startIndex, endIndex)));
+ paths.push(FileInfo.cleanPath(rhs.slice(startIndex, endIndex)
+ .replace("$$PWD", FileInfo.path(filePath))));
startIndex = endIndex + 1;
}
return paths;
@@ -1061,17 +1072,21 @@ function allQt5Modules(qtProps, androidAbi) {
for (var i = 0; i < modulePriFiles.length; ++i) {
var priFileName = modulePriFiles[i];
var priFilePath = FileInfo.joinPaths(modulesDir, priFileName);
+ var genericFileNamePrefix = "qt_";
var moduleFileNamePrefix = "qt_lib_";
var pluginFileNamePrefix = "qt_plugin_";
var moduleFileNameSuffix = ".pri";
var fileHasPluginPrefix = priFileName.startsWith(pluginFileNamePrefix);
- if (!fileHasPluginPrefix && (!priFileName.startsWith(moduleFileNamePrefix))
+ if (!fileHasPluginPrefix && !priFileName.startsWith(genericFileNamePrefix)
|| !priFileName.endsWith(moduleFileNameSuffix)) {
continue;
}
var moduleInfo = makeQtModuleInfo();
moduleInfo.isPlugin = fileHasPluginPrefix;
- var fileNamePrefix = moduleInfo.isPlugin ? pluginFileNamePrefix : moduleFileNamePrefix;
+ moduleInfo.isExternal = !moduleInfo.isPlugin
+ && !priFileName.startsWith(moduleFileNamePrefix);
+ var fileNamePrefix = moduleInfo.isPlugin ? pluginFileNamePrefix : moduleInfo.isExternal
+ ? genericFileNamePrefix : moduleFileNamePrefix;
moduleInfo.qbsName = priFileName.slice(fileNamePrefix.length, -moduleFileNameSuffix.length);
if (moduleInfo.isPlugin) {
moduleInfo.name = moduleInfo.qbsName;
@@ -1344,6 +1359,7 @@ function replaceSpecialValues(content, module, qtProps, abi) {
installPath: ModUtils.toJSLiteral(qtProps.installPath),
libPath: ModUtils.toJSLiteral(qtProps.libraryPath),
libExecPath: ModUtils.toJSLiteral(qtProps.libExecPath),
+ qmlLibExecPath: ModUtils.toJSLiteral(qtProps.qmlLibExecPath),
pluginPath: ModUtils.toJSLiteral(qtProps.pluginPath),
incPath: ModUtils.toJSLiteral(qtProps.includePath),
docPath: ModUtils.toJSLiteral(qtProps.documentationPath),
@@ -1561,7 +1577,7 @@ function setupOneQt(qmakeFilePath, outputBaseDir, uniquify, location, qbs) {
copyTemplateFile("qml.js", qbsQtModuleDir, qtProps, androidAbis[a], location,
allFiles);
var qmlcacheStr = "qmlcache";
- if (File.exists(FileInfo.joinPaths(qtProps.binaryPath,
+ if (File.exists(FileInfo.joinPaths(qtProps.qmlLibExecPath,
"qmlcachegen" + exeSuffix(qbs)))) {
copyTemplateFile(qmlcacheStr + ".qbs",
FileInfo.joinPaths(qbsQtModuleBaseDir, qmlcacheStr), qtProps,