cmake: Add option to disable subfolders

An option is added to change the default behavior that
would create subfolders inside source groups for files
based on their location on disk.

When disabling the option, files will be added directly
under their respective source group.

The virtual folders <build-folder> and <other-files>
is also omitted when the option is disabled.

Fixes: QTCREATORBUG-27432
Change-Id: Id78e178011c5299d4f7257bf855a5d791eebf91c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Marcus Tillmanns
2022-07-04 08:54:24 +02:00
parent df26d12b73
commit 6431932569
3 changed files with 22 additions and 3 deletions

View File

@@ -72,6 +72,11 @@ CMakeSpecificSettings::CMakeSpecificSettings()
askBeforeReConfigureInitialParams.setDefaultValue(true);
askBeforeReConfigureInitialParams.setLabelText(tr("Ask before re-configuring with "
"initial parameters"));
registerAspect(&showSourceSubFolders);
showSourceSubFolders.setSettingsKey("ShowSourceSubFolders");
showSourceSubFolders.setDefaultValue(true);
showSourceSubFolders.setLabelText(tr("Show subfolders inside source group folders"));
}
// CMakeSpecificSettingsPage
@@ -93,6 +98,7 @@ CMakeSpecificSettingsPage::CMakeSpecificSettingsPage(CMakeSpecificSettings *sett
},
s.packageManagerAutoSetup,
s.askBeforeReConfigureInitialParams,
s.showSourceSubFolders,
Stretch(),
}.attachTo(widget);
});