forked from qt-creator/qt-creator
QtSupport: Preserve case for modules
CMake needs to have the exact casing of Qt Modules e.g. Qt.MultimediaWidgets instead of Qt.multimediawidgets. For QMake and Qbs I've moved the module lowercasing to the `addDependencies` function call. Change-Id: I182da5870f7c7b2aae1dcad2e8bcadc48911e47f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -19,7 +19,7 @@
|
|||||||
{ "key": "isQObject", "value": "%{JS: [ 'QObject', 'QWidget', 'QMainWindow', 'QQuickItem'].indexOf(value('Base')) >= 0 }" },
|
{ "key": "isQObject", "value": "%{JS: [ 'QObject', 'QWidget', 'QMainWindow', 'QQuickItem'].indexOf(value('Base')) >= 0 }" },
|
||||||
{ "key": "GUARD", "value": "%{JS: Cpp.headerGuard(value('HdrFileName'))}" },
|
{ "key": "GUARD", "value": "%{JS: Cpp.headerGuard(value('HdrFileName'))}" },
|
||||||
{ "key": "SharedDataInit", "value": "%{JS: (value('IncludeQSharedData')) ? 'data(new %{CN}Data)' : '' }" },
|
{ "key": "SharedDataInit", "value": "%{JS: (value('IncludeQSharedData')) ? 'data(new %{CN}Data)' : '' }" },
|
||||||
{ "key": "Dependencies", "value": "%{JS: '' + (value('IncludeQObject') || value('IncludeQSharedData') || value('BaseCB') === 'QObject' ? ':Qt.core' : '') + (value('IncludeQWidget') || value('IncludeQMainWindow') || value('BaseCB') === 'QWidget' || value('BaseCB') === 'QMainWindow' ? ':Qt.widgets' : '') + (value('IncludeQQuickItem') || value('BaseCB') === 'QQuickItem' ? ':Qt.quick' : '')}"}
|
{ "key": "Dependencies", "value": "%{JS: '' + (value('IncludeQObject') || value('IncludeQSharedData') || value('BaseCB') === 'QObject' ? ':Qt.Core' : '') + (value('IncludeQWidget') || value('IncludeQMainWindow') || value('BaseCB') === 'QWidget' || value('BaseCB') === 'QMainWindow' ? ':Qt.Widgets' : '') + (value('IncludeQQuickItem') || value('BaseCB') === 'QQuickItem' ? ':Qt.Quick' : '')}"}
|
||||||
],
|
],
|
||||||
|
|
||||||
"pages":
|
"pages":
|
||||||
|
@@ -309,17 +309,22 @@ bool QbsBuildSystem::renameFiles(Node *context, const FilePairs &filesToRename,
|
|||||||
|
|
||||||
bool QbsBuildSystem::addDependencies(ProjectExplorer::Node *context, const QStringList &dependencies)
|
bool QbsBuildSystem::addDependencies(ProjectExplorer::Node *context, const QStringList &dependencies)
|
||||||
{
|
{
|
||||||
|
const QStringList lowercaseDeps = transform(dependencies, [](const QString &dep) -> QString {
|
||||||
|
QTC_ASSERT(dep.size() > 3, return dep);
|
||||||
|
return dep.left(3) + dep.mid(3).toLower();
|
||||||
|
});
|
||||||
|
|
||||||
if (session()->apiLevel() < 9)
|
if (session()->apiLevel() < 9)
|
||||||
return BuildSystem::addDependencies(context, dependencies);
|
return BuildSystem::addDependencies(context, lowercaseDeps);
|
||||||
|
|
||||||
if (auto *n = dynamic_cast<QbsGroupNode *>(context)) {
|
if (auto *n = dynamic_cast<QbsGroupNode *>(context)) {
|
||||||
const QbsProductNode * const prdNode = parentQbsProductNode(n);
|
const QbsProductNode * const prdNode = parentQbsProductNode(n);
|
||||||
QTC_ASSERT(prdNode, return false);
|
QTC_ASSERT(prdNode, return false);
|
||||||
return addDependenciesToProduct(dependencies, prdNode->productData(), n->groupData());
|
return addDependenciesToProduct(lowercaseDeps, prdNode->productData(), n->groupData());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (auto *n = dynamic_cast<QbsProductNode *>(context))
|
if (auto *n = dynamic_cast<QbsProductNode *>(context))
|
||||||
return addDependenciesToProduct(dependencies, n->productData(), n->mainGroup());
|
return addDependenciesToProduct(lowercaseDeps, n->productData(), n->mainGroup());
|
||||||
|
|
||||||
return BuildSystem::addDependencies(context, dependencies);
|
return BuildSystem::addDependencies(context, dependencies);
|
||||||
}
|
}
|
||||||
|
@@ -628,7 +628,7 @@ bool QmakePriFile::addDependencies(const QStringList &dependencies)
|
|||||||
return dep.length() > 3 && dep.startsWith("Qt.");
|
return dep.length() > 3 && dep.startsWith("Qt.");
|
||||||
});
|
});
|
||||||
qtDependencies = transform(qtDependencies, [](const QString &dep) {
|
qtDependencies = transform(qtDependencies, [](const QString &dep) {
|
||||||
return dep.mid(3);
|
return dep.mid(3).toLower();
|
||||||
});
|
});
|
||||||
if (qtDependencies.isEmpty())
|
if (qtDependencies.isEmpty())
|
||||||
return true;
|
return true;
|
||||||
|
@@ -310,7 +310,7 @@ QString QtVersion::moduleForHeader(const QString &headerFileName) const
|
|||||||
for (auto it = d->m_classesPerModule->cbegin(); it != d->m_classesPerModule->cend(); ++it) {
|
for (auto it = d->m_classesPerModule->cbegin(); it != d->m_classesPerModule->cend(); ++it) {
|
||||||
if (it.value().contains(headerFileName)) {
|
if (it.value().contains(headerFileName)) {
|
||||||
QTC_ASSERT(it.key().size() > 2, return it.key());
|
QTC_ASSERT(it.key().size() > 2, return it.key());
|
||||||
return it.key().left(2) + '.' + it.key().mid(2).toLower();
|
return it.key().left(2) + '.' + it.key().mid(2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
|
@@ -174,7 +174,7 @@ public:
|
|||||||
Utils::FilePath librarySearchPath() const;
|
Utils::FilePath librarySearchPath() const;
|
||||||
|
|
||||||
Utils::FilePaths directoriesToIgnoreInProjectTree() const;
|
Utils::FilePaths directoriesToIgnoreInProjectTree() const;
|
||||||
QString moduleForHeader(const QString &className) const; // Format is "Qt.core"
|
QString moduleForHeader(const QString &className) const; // Format is "Qt.Core"
|
||||||
|
|
||||||
QString qtNamespace() const;
|
QString qtNamespace() const;
|
||||||
QString qtLibInfix() const;
|
QString qtLibInfix() const;
|
||||||
|
Reference in New Issue
Block a user