Run CMake via canonical path instead of warning

Running CMake via a non-canonical path (including '..' in the path, or
via a symlink) can result in funny errors.

de6faa0f15 added a warning for that
condition. Unfortunately the auto-detection of CMake can return a path
to a symlink (e.g. for CMake from brew on macOS). Also it is helpful to
use a symlink to e.g. manage different CMake versions.

Instead of warning about the condition, and forcing the user to resolve
it manually, simply run CMake via its canonical path when actually
running it from Qt Creator.

Change-Id: I95623b45c5436a6d61c1419b7aba23e2a73a0650
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Eike Ziller
2019-08-12 14:44:29 +02:00
parent b61a5b759b
commit ff503740ce
5 changed files with 16 additions and 48 deletions

View File

@@ -257,13 +257,6 @@ Tasks CMakeKitAspect::validate(const Kit *k) const
"version 3.0 or later.").arg(QString::fromUtf8(version.fullVersion)),
Utils::FilePath(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
}
if (!tool->isExecutablePathCanonical()) {
result << Task(Task::Warning,
CMakeTool::nonCanonicalPathToCMakeExecutableWarningMessage(),
Utils::FilePath(),
-1,
Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
}
}
return result;
}