CMake: Use non translatable names for build directory names

The CMake build types names are translated, which is fine in UI,
but we shouldn't use the translations in the directory name.

Debug/Release/RelMinSize/RelWithDebInfo are known in CMake world,
and don't cause any problems with MSVC when having translations
for Russian / Japanese.

Fixes: QTCREATORBUG-19984
Change-Id: Ia19326f0ca5d277b549f1b82bc569518f7b5c441
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Cristian Adam
2019-10-09 18:36:17 +02:00
parent 8205eadeb1
commit 84756c69e9

View File

@@ -644,10 +644,9 @@ QList<BuildInfo> CMakeBuildConfigurationFactory::availableBuilds(const Kit *k,
for (int type = BuildTypeDebug; type != BuildTypeLast; ++type) {
BuildInfo info = createBuildInfo(k, path.toString(), BuildType(type));
if (forSetup) {
info.displayName = info.typeName;
info.buildDirectory = CMakeBuildConfiguration::shadowBuildDirectory(projectPath,
k,
info.displayName,
info.typeName,
info.buildType);
}
result << info;
@@ -668,26 +667,28 @@ BuildInfo CMakeBuildConfigurationFactory::createBuildInfo(const Kit *k,
CMakeConfigItem buildTypeItem;
switch (buildType) {
case BuildTypeNone:
info.typeName = tr("Build");
info.typeName = "Build";
info.displayName = tr("Build");
info.buildType = BuildConfiguration::Unknown;
break;
case BuildTypeDebug:
buildTypeItem = {CMakeConfigItem("CMAKE_BUILD_TYPE", "Debug")};
info.typeName = tr("Debug");
info.typeName = "Debug";
info.displayName = tr("Debug");
info.buildType = BuildConfiguration::Debug;
break;
case BuildTypeRelease:
buildTypeItem = {CMakeConfigItem("CMAKE_BUILD_TYPE", "Release")};
info.typeName = tr("Release");
info.typeName = "Release";
info.displayName = tr("Release");
info.buildType = BuildConfiguration::Release;
break;
case BuildTypeMinSizeRel:
buildTypeItem = {CMakeConfigItem("CMAKE_BUILD_TYPE", "MinSizeRel")};
info.typeName = tr("Minimum Size Release");
info.typeName = "MinSizeRel";
info.displayName = tr("Minimum Size Release");
info.buildType = BuildConfiguration::Release;
break;
case BuildTypeRelWithDebInfo:
buildTypeItem = {CMakeConfigItem("CMAKE_BUILD_TYPE", "RelWithDebInfo")};
info.typeName = tr("Release with Debug Information");
info.typeName = "RelWithDebInfo";
info.displayName = tr("Release with Debug Information");
info.buildType = BuildConfiguration::Profile;
break;
default:
@@ -695,6 +696,8 @@ BuildInfo CMakeBuildConfigurationFactory::createBuildInfo(const Kit *k,
break;
}
buildTypeItem = {CMakeConfigItem("CMAKE_BUILD_TYPE", info.typeName.toUtf8())};
if (!buildTypeItem.isNull())
extra.configuration.append(buildTypeItem);