forked from qt-creator/qt-creator
CMake: Normalize file paths before comparing them
On windows we got false negatives due to one path starting with "C:" and the other with "c:". Use Utils::FileName which should do the right thing. Change-Id: I7dcf8ad3f61caca7ac7c183d492ebfd57fe1b669 Reviewed-by: Cristian Adam <cristian.adam@gmail.com> Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -280,7 +280,9 @@ CMakeConfig BuildDirManager::parsedConfiguration() const
|
||||
CMakeConfig result = parseConfiguration(cacheFile, &errorMessage);
|
||||
if (!errorMessage.isEmpty())
|
||||
emit errorOccured(errorMessage);
|
||||
if (CMakeConfigItem::valueOf("CMAKE_HOME_DIRECTORY", result) != sourceDirectory().toString().toUtf8())
|
||||
const Utils::FileName sourceOfBuildDir
|
||||
= Utils::FileName::fromUtf8(CMakeConfigItem::valueOf("CMAKE_HOME_DIRECTORY", result));
|
||||
if (sourceOfBuildDir != sourceDirectory()) // Use case-insensitive compare where appropriate
|
||||
emit errorOccured(tr("The build directory is not for %1").arg(sourceDirectory().toUserOutput()));
|
||||
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user