CMakePM: Make "Build type" aspect visible

For single configuration projects if you change the build type
aspect you will change the CMAKE_BUILD_TYPE variable.

When switching the build directory the existing CMAKE_BUILD_TYPE
will be set as build type aspect.

Fixes: QTCREATORBUG-25451
Change-Id: I13519e95c316c556cc1348fba6121637d2fd4275
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Cristian Adam
2021-03-18 14:20:02 +01:00
parent 8eaf24a694
commit 637d45c66a
6 changed files with 77 additions and 18 deletions

View File

@@ -76,16 +76,6 @@ BuildDirParameters::BuildDirParameters(CMakeBuildConfiguration *bc)
buildDirectory = bc->buildDirectory();
cmakeBuildType = bc->cmakeBuildType();
if (cmakeBuildType.isEmpty()) {
// The empty build type might be just a case of loading of an existing project
// that doesn't have the "CMake.Build.Type" aspect saved
const CMakeConfig config = CMakeConfigItem::itemsFromArguments(initialCMakeArguments);
if (!config.isEmpty()) {
cmakeBuildType = QString::fromLatin1(CMakeConfigItem::valueOf("CMAKE_BUILD_TYPE", config));
if (!cmakeBuildType.isEmpty())
bc->setCMakeBuildType(cmakeBuildType);
}
}
environment = bc->environment();
// Disable distributed building for configuration runs. CMake does not do those in parallel,