forked from qt-creator/qt-creator
CMakePM: Remove support for extra generators
They are marked as obsolete in CMake 3.27 and will be removed in a future version of CMake. Fixes: QTCREATORBUG-29603 Change-Id: I6e5d36441d05b87ee4467d13781f53d4269636ad Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -388,14 +388,10 @@ private:
|
||||
|
||||
m_changeButton->setEnabled(m_currentTool);
|
||||
const QString generator = CMakeGeneratorKitAspect::generator(kit());
|
||||
const QString extraGenerator = CMakeGeneratorKitAspect::extraGenerator(kit());
|
||||
const QString platform = CMakeGeneratorKitAspect::platform(kit());
|
||||
const QString toolset = CMakeGeneratorKitAspect::toolset(kit());
|
||||
|
||||
QStringList messageLabel;
|
||||
if (!extraGenerator.isEmpty())
|
||||
messageLabel << extraGenerator << " - ";
|
||||
|
||||
messageLabel << generator;
|
||||
|
||||
if (!platform.isEmpty())
|
||||
@@ -424,7 +420,6 @@ private:
|
||||
cmakeLabel->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
|
||||
|
||||
auto generatorCombo = new QComboBox;
|
||||
auto extraGeneratorCombo = new QComboBox;
|
||||
auto platformEdit = new QLineEdit;
|
||||
auto toolsetEdit = new QLineEdit;
|
||||
|
||||
@@ -436,10 +431,6 @@ private:
|
||||
layout->addWidget(new QLabel(Tr::tr("Generator:")), row, 0);
|
||||
layout->addWidget(generatorCombo, row, 1);
|
||||
|
||||
++row;
|
||||
layout->addWidget(new QLabel(Tr::tr("Extra generator:")), row, 0);
|
||||
layout->addWidget(extraGeneratorCombo, row, 1);
|
||||
|
||||
++row;
|
||||
layout->addWidget(new QLabel(Tr::tr("Platform:")), row, 0);
|
||||
layout->addWidget(platformEdit, row, 1);
|
||||
@@ -463,19 +454,13 @@ private:
|
||||
for (auto it = generatorList.constBegin(); it != generatorList.constEnd(); ++it)
|
||||
generatorCombo->addItem(it->name);
|
||||
|
||||
auto updateDialog = [&generatorList, generatorCombo, extraGeneratorCombo,
|
||||
auto updateDialog = [&generatorList, generatorCombo,
|
||||
platformEdit, toolsetEdit](const QString &name) {
|
||||
const auto it = std::find_if(generatorList.constBegin(), generatorList.constEnd(),
|
||||
[name](const CMakeTool::Generator &g) { return g.name == name; });
|
||||
QTC_ASSERT(it != generatorList.constEnd(), return);
|
||||
generatorCombo->setCurrentText(name);
|
||||
|
||||
extraGeneratorCombo->clear();
|
||||
extraGeneratorCombo->addItem(Tr::tr("<none>"), QString());
|
||||
for (const QString &eg : std::as_const(it->extraGenerators))
|
||||
extraGeneratorCombo->addItem(eg, eg);
|
||||
extraGeneratorCombo->setEnabled(extraGeneratorCombo->count() > 1);
|
||||
|
||||
platformEdit->setEnabled(it->supportsPlatform);
|
||||
toolsetEdit->setEnabled(it->supportsToolset);
|
||||
};
|
||||
@@ -483,7 +468,6 @@ private:
|
||||
updateDialog(CMakeGeneratorKitAspect::generator(kit()));
|
||||
|
||||
generatorCombo->setCurrentText(CMakeGeneratorKitAspect::generator(kit()));
|
||||
extraGeneratorCombo->setCurrentText(CMakeGeneratorKitAspect::extraGenerator(kit()));
|
||||
platformEdit->setText(platformEdit->isEnabled() ? CMakeGeneratorKitAspect::platform(kit()) : QString());
|
||||
toolsetEdit->setText(toolsetEdit->isEnabled() ? CMakeGeneratorKitAspect::toolset(kit()) : QString());
|
||||
|
||||
@@ -494,7 +478,6 @@ private:
|
||||
return;
|
||||
|
||||
CMakeGeneratorKitAspect::set(kit(), generatorCombo->currentText(),
|
||||
extraGeneratorCombo->currentData().toString(),
|
||||
platformEdit->isEnabled() ? platformEdit->text() : QString(),
|
||||
toolsetEdit->isEnabled() ? toolsetEdit->text() : QString());
|
||||
|
||||
@@ -579,11 +562,6 @@ QString CMakeGeneratorKitAspect::generator(const Kit *k)
|
||||
return generatorInfo(k).generator;
|
||||
}
|
||||
|
||||
QString CMakeGeneratorKitAspect::extraGenerator(const Kit *k)
|
||||
{
|
||||
return generatorInfo(k).extraGenerator;
|
||||
}
|
||||
|
||||
QString CMakeGeneratorKitAspect::platform(const Kit *k)
|
||||
{
|
||||
return generatorInfo(k).platform;
|
||||
@@ -601,13 +579,6 @@ void CMakeGeneratorKitAspect::setGenerator(Kit *k, const QString &generator)
|
||||
setGeneratorInfo(k, info);
|
||||
}
|
||||
|
||||
void CMakeGeneratorKitAspect::setExtraGenerator(Kit *k, const QString &extraGenerator)
|
||||
{
|
||||
GeneratorInfo info = generatorInfo(k);
|
||||
info.extraGenerator = extraGenerator;
|
||||
setGeneratorInfo(k, info);
|
||||
}
|
||||
|
||||
void CMakeGeneratorKitAspect::setPlatform(Kit *k, const QString &platform)
|
||||
{
|
||||
GeneratorInfo info = generatorInfo(k);
|
||||
@@ -624,11 +595,10 @@ void CMakeGeneratorKitAspect::setToolset(Kit *k, const QString &toolset)
|
||||
|
||||
void CMakeGeneratorKitAspect::set(Kit *k,
|
||||
const QString &generator,
|
||||
const QString &extraGenerator,
|
||||
const QString &platform,
|
||||
const QString &toolset)
|
||||
{
|
||||
GeneratorInfo info(generator, extraGenerator, platform, toolset);
|
||||
GeneratorInfo info(generator, platform, toolset);
|
||||
setGeneratorInfo(k, info);
|
||||
}
|
||||
|
||||
@@ -639,11 +609,7 @@ QStringList CMakeGeneratorKitAspect::generatorArguments(const Kit *k)
|
||||
if (info.generator.isEmpty())
|
||||
return result;
|
||||
|
||||
if (info.extraGenerator.isEmpty()) {
|
||||
result.append("-G" + info.generator);
|
||||
} else {
|
||||
result.append("-G" + info.extraGenerator + " - " + info.generator);
|
||||
}
|
||||
result.append("-G" + info.generator);
|
||||
|
||||
if (!info.platform.isEmpty())
|
||||
result.append("-A" + info.platform);
|
||||
@@ -664,9 +630,6 @@ CMakeConfig CMakeGeneratorKitAspect::generatorCMakeConfig(const Kit *k)
|
||||
|
||||
config << CMakeConfigItem("CMAKE_GENERATOR", info.generator.toUtf8());
|
||||
|
||||
if (!info.extraGenerator.isEmpty())
|
||||
config << CMakeConfigItem("CMAKE_EXTRA_GENERATOR", info.extraGenerator.toUtf8());
|
||||
|
||||
if (!info.platform.isEmpty())
|
||||
config << CMakeConfigItem("CMAKE_GENERATOR_PLATFORM", info.platform.toUtf8());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user