CMake: Warn on kits using unsupported cmake versions

Change-Id: I6a3a940280baab78e9f56352008452f694534e76
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Tobias Hunger
2016-09-28 17:26:02 +02:00
parent 38b21ad04d
commit de664161a2

View File

@@ -98,8 +98,17 @@ QVariant CMakeKitInformation::defaultValue(const Kit *k) const
QList<Task> CMakeKitInformation::validate(const Kit *k) const
{
Q_UNUSED(k);
return QList<Task>();
QList<Task> result;
CMakeTool *tool = CMakeKitInformation::cmakeTool(k);
if (tool) {
CMakeTool::Version version = tool->version();
if (version.major < 3) {
result << Task(Task::Warning, tr("CMake version %1 is unsupported. Please update to "
"version 3.0 or later.").arg(QString::fromUtf8(version.fullVersion)),
Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM));
}
}
return result;
}
void CMakeKitInformation::setup(Kit *k)