Commit eb8075f5 authored by Tobias Hunger's avatar Tobias Hunger

CMake: Compare canonical paths when checking source directory

Compare the CMAKE_HOME_DIRECTORY to the canonical project paths during
cmake project import. CMake makes sure to store the canonical path
there.

Change-Id: I4ae3ad1f8fab66a50ba98d4266c78cdb4d21f2ea
Reviewed-by: Tim Jenssen's avatarTim Jenssen <tim.jenssen@qt.io>
parent 77f8a416
......@@ -250,9 +250,10 @@ QList<void *> CMakeProjectImporter::examineDirectory(const Utils::FileName &impo
}
const auto homeDir
= Utils::FileName::fromUserInput(QString::fromUtf8(CMakeConfigItem::valueOf("CMAKE_HOME_DIRECTORY", config)));
if (homeDir != projectDirectory()) {
const Utils::FileName canonicalProjectDirectory = Utils::FileUtils::canonicalPath(projectDirectory());
if (homeDir != canonicalProjectDirectory) {
qCDebug(cmInputLog()) << "Wrong source directory:" << homeDir.toUserOutput()
<< "expected:" << projectDirectory().toUserOutput();
<< "expected:" << canonicalProjectDirectory.toUserOutput();
return { };
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment