forked from qt-creator/qt-creator
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:
@@ -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 );
|
||||
|
||||
@@ -261,7 +261,7 @@ Tasks CMakeKitAspect::validate(const Kit *k) const
|
||||
{
|
||||
Tasks result;
|
||||
CMakeTool *tool = CMakeKitAspect::cmakeTool(k);
|
||||
if (tool) {
|
||||
if (tool && tool->isValid()) {
|
||||
CMakeTool::Version version = tool->version();
|
||||
if (version.major < 3 || (version.major == 3 && version.minor < 14)) {
|
||||
result << BuildSystemTask(Task::Warning, msgUnsupportedVersion(version.fullVersion));
|
||||
|
||||
Reference in New Issue
Block a user