CMakePM: Better error message for no CMake present case

Currently if no CMake has been registered and a CMake project has been
openend the user will get the error:
"CMake version  is unsupported. Update to version 3.14 (with file-api)
or later."

With this patch the user will get the error:
"The kit needs to define a CMake tool to parse this project."

Change-Id: I555884fff1eac321052998d1ef7970a49b2f44af
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Cristian Adam
2022-06-28 16:08:09 +02:00
parent bbf16bba37
commit 175a61ad1b
2 changed files with 7 additions and 6 deletions

View File

@@ -377,16 +377,17 @@ void CMakeBuildSystem::setParametersAndRequestParse(const BuildDirParameters &pa
return; // ignore request, this build configuration is not active!
}
if (!parameters.cmakeTool()) {
const CMakeTool *tool = parameters.cmakeTool();
if (!tool || !tool->isValid()) {
TaskHub::addTask(
BuildSystemTask(Task::Error,
tr("The kit needs to define a CMake tool to parse this project.")));
return;
}
if (!parameters.cmakeTool()->hasFileApi()) {
TaskHub::addTask(BuildSystemTask(Task::Error,
CMakeKitAspect::msgUnsupportedVersion(
parameters.cmakeTool()->version().fullVersion)));
if (!tool->hasFileApi()) {
TaskHub::addTask(
BuildSystemTask(Task::Error,
CMakeKitAspect::msgUnsupportedVersion(tool->version().fullVersion)));
return;
}
QTC_ASSERT(parameters.isValid(), return );