forked from qt-creator/qt-creator
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 <tim.jenssen@qt.io>
This commit is contained in:
@@ -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 { };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user