CMakePM: Allow presets without buildDirectory

CMakePresets v3 relax the requirement of having the buildDirectory
specified.

This way Qt Creator should use its own mechanism of specifying the build
directory.

Change-Id: I6ba69e6a03cdc058e7b8fa540a6fc564356aba63
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Cristian Adam
2022-10-07 15:08:33 +02:00
parent 0e2409b0d6
commit f84bdee045
4 changed files with 30 additions and 20 deletions

View File

@@ -1956,19 +1956,8 @@ CMakeBuildConfigurationFactory::CMakeBuildConfigurationFactory()
// Skip the default shadow build directories for build types if we have presets
const CMakeConfigItem presetItem = CMakeConfigurationKitAspect::cmakePresetConfigItem(k);
if (!presetItem.isNull()) {
const QString presetName = presetItem.expandedValue(k);
const auto project = qobject_cast<CMakeProject *>(SessionManager::startupProject());
PresetsDetails::ConfigurePreset configurePreset
= Utils::findOrDefault(project->presetsData().configurePresets,
[&presetName] (const PresetsDetails::ConfigurePreset &preset) {
return preset.name == presetName;
});
if (configurePreset.binaryDir)
return result;
}
if (!presetItem.isNull())
return result;
for (int type = BuildTypeDebug; type != BuildTypeLast; ++type) {
BuildInfo info = createBuildInfo(BuildType(type));