forked from qt-creator/qt-creator
CMake: Better warnings for strange/invalid CMake binaries
Warn when cmake is configured to use a non-canonical path. This might trigger problems in CMake itself. Show this warning in the Kit as well as in the CMake options page. Also complain other issues in the CMake options page. Task-number: QTCREATORBUG-22583 Change-Id: I841341db8305f9152543487ce9ceeab2eca0b2b9 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -356,6 +356,25 @@ CMakeTool::ReaderType CMakeTool::readerType() const
|
||||
return m_readerType.value();
|
||||
}
|
||||
|
||||
bool CMakeTool::isCanonicalPath(const Utils::FilePath &path)
|
||||
{
|
||||
const QString canonicalPath = path.toFileInfo().canonicalFilePath();
|
||||
return canonicalPath == path.toString();
|
||||
}
|
||||
|
||||
bool CMakeTool::isExecutablePathCanonical() const
|
||||
{
|
||||
return isCanonicalPath(cmakeExecutable());
|
||||
}
|
||||
|
||||
QString CMakeTool::nonCanonicalPathToCMakeExecutableWarningMessage()
|
||||
{
|
||||
return QCoreApplication::translate(
|
||||
"CMakeProjectManager::CMakeTool",
|
||||
"CMake executable path is not canonical and contains \"..\", \".\" "
|
||||
"or a symbolic link. This might trigger bugs in CMake.");
|
||||
}
|
||||
|
||||
void CMakeTool::readInformation(CMakeTool::QueryType type) const
|
||||
{
|
||||
if ((type == QueryType::GENERATORS && !m_introspection->m_generators.isEmpty())
|
||||
|
||||
Reference in New Issue
Block a user