forked from qt-creator/qt-creator
cmake: Show errors for unsupported CMake versions
Show an error icon in the CMake settings, and instead running CMake with unsupported parameters show an error in the Issues pane. Arguably it should not be possible to select an unsupported CMake version in the kit settings at all (neither manually nor automatically when setting up kits), but this is the less intrusive change for now. Fixes: QTCREATORBUG-24553 Change-Id: I32caa2ce93d28cbd9db90e2004d60da93d32c68c Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -255,10 +255,7 @@ Tasks CMakeKitAspect::validate(const Kit *k) const
|
||||
if (tool) {
|
||||
CMakeTool::Version version = tool->version();
|
||||
if (version.major < 3 || (version.major == 3 && version.minor < 14)) {
|
||||
result << BuildSystemTask(Task::Warning,
|
||||
tr("CMake version %1 is unsupported. Please update to "
|
||||
"version 3.14 (with file-api) or later.")
|
||||
.arg(QString::fromUtf8(version.fullVersion)));
|
||||
result << BuildSystemTask(Task::Warning, msgUnsupportedVersion(version.fullVersion));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
@@ -305,6 +302,13 @@ QSet<Utils::Id> CMakeKitAspect::availableFeatures(const Kit *k) const
|
||||
return {};
|
||||
}
|
||||
|
||||
QString CMakeKitAspect::msgUnsupportedVersion(const QByteArray &versionString)
|
||||
{
|
||||
return tr("CMake version %1 is unsupported. Please update to "
|
||||
"version 3.14 (with file-api) or later.")
|
||||
.arg(QString::fromUtf8(versionString));
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// CMakeGeneratorKitAspect:
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user