diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2021-05-03 09:07:06 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2021-05-03 10:39:27 +0000 |
commit | 14b897863f6d9d28bde00a49c297c0dafd803e45 (patch) | |
tree | 28c6dddb491ead79cea26d140619fab67a3973f8 /share/qbs/module-providers | |
parent | d5ba955c0bc01db387da64541811fe0d48ff7166 (diff) |
Qt Support: Consider "external" modules
... in the module provider.
The mkspecs/modules directory can contain third-party modules, e.g. from
KDE.
Change-Id: I5c0bc789d748299c3542c8f9814bdb1035d43e68
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Diffstat (limited to 'share/qbs/module-providers')
-rw-r--r-- | share/qbs/module-providers/Qt/setup-qt.js | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/share/qbs/module-providers/Qt/setup-qt.js b/share/qbs/module-providers/Qt/setup-qt.js index c23d51d1b..7785bc5dc 100644 --- a/share/qbs/module-providers/Qt/setup-qt.js +++ b/share/qbs/module-providers/Qt/setup-qt.js @@ -569,11 +569,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); } @@ -969,7 +973,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; @@ -1063,17 +1068,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; |