QmlProjectManager: Add new cmake generator

Automatic cmake generation can now be enabled by setting
the qmlproject property enableCMakeGeneration to true

Change-Id: I98523a9479d0cd812e43a9bd0b700120358260f6
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Burak Hancerli <burak.hancerli@qt.io>
This commit is contained in:
Knud Dollereder
2024-02-01 15:17:58 +01:00
parent c58efc4310
commit 8b97598011
27 changed files with 818 additions and 2 deletions

View File

@@ -77,6 +77,7 @@ void updateMcuBuildStep(Target *target, bool mcuEnabled)
QmlBuildSystem::QmlBuildSystem(Target *target)
: BuildSystem(target)
, m_cmakeGen(new GenerateCmake::CMakeGenerator(this, this))
{
// refresh first - project information is used e.g. to decide the default RC's
refresh(RefreshOptions::Project);
@@ -86,10 +87,12 @@ QmlBuildSystem::QmlBuildSystem(Target *target)
connect(target->project(), &Project::activeTargetChanged, this, [this](Target *target) {
refresh(RefreshOptions::NoFileRefresh);
m_cmakeGen->initialize(qmlProject());
updateMcuBuildStep(target, qtForMCUs());
});
connect(target->project(), &Project::projectFileIsDirty, this, [this]() {
refresh(RefreshOptions::Project);
m_cmakeGen->initialize(qmlProject());
updateMcuBuildStep(project()->activeTarget(), qtForMCUs());
});
@@ -220,6 +223,13 @@ void QmlBuildSystem::initProjectItem()
&QmlProjectItem::qmlFilesChanged,
this,
&QmlBuildSystem::refreshFiles);
connect(m_projectItem.get(),
&QmlProjectItem::qmlFilesChanged,
m_cmakeGen,
&GenerateCmake::CMakeGenerator::update);
m_cmakeGen->setEnabled(m_projectItem->enableCMakeGeneration());
}
void QmlBuildSystem::parseProjectFiles()