ENH: clean up drive letter check
This commit is contained in:
parent
8e79e498f9
commit
10ae8a4e24
|
@ -248,15 +248,22 @@ bool cmCacheManager::LoadCache(const char* path,
|
||||||
"current loaded cache", cmCacheManager::INTERNAL);
|
"current loaded cache", cmCacheManager::INTERNAL);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
if ( internal && this->GetCacheValue("CMAKE_CACHEFILE_DIR") )
|
||||||
|
{
|
||||||
std::string currentcwd = path;
|
std::string currentcwd = path;
|
||||||
|
std::string oldcwd = this->GetCacheValue("CMAKE_CACHEFILE_DIR");
|
||||||
if ( currentcwd[0] >= 'A' && currentcwd[0] <= 'Z' &&
|
if ( currentcwd[0] >= 'A' && currentcwd[0] <= 'Z' &&
|
||||||
currentcwd[1] == ':' )
|
currentcwd[1] == ':' )
|
||||||
{
|
{
|
||||||
currentcwd[0] = currentcwd[0] - 'A' + 'a';
|
currentcwd[0] = currentcwd[0] - 'A' + 'a';
|
||||||
}
|
}
|
||||||
|
if ( oldcwd[0] >= 'A' && oldcwd[0] <= 'Z' &&
|
||||||
|
oldcwd[1] == ':' )
|
||||||
|
{
|
||||||
|
oldcwd[0] = oldcwd[0] - 'A' + 'a';
|
||||||
|
}
|
||||||
cmSystemTools::ConvertToUnixSlashes(currentcwd);
|
cmSystemTools::ConvertToUnixSlashes(currentcwd);
|
||||||
if(internal && this->GetCacheValue("CMAKE_CACHEFILE_DIR") &&
|
if(oldcwd != currentcwd)
|
||||||
std::string(this->GetCacheValue("CMAKE_CACHEFILE_DIR")) != currentcwd)
|
|
||||||
{
|
{
|
||||||
std::string message =
|
std::string message =
|
||||||
std::string("The current CMakeCache.txt directory ") +
|
std::string("The current CMakeCache.txt directory ") +
|
||||||
|
@ -267,6 +274,8 @@ bool cmCacheManager::LoadCache(const char* path,
|
||||||
"are not sure, reedit the CMakeCache.txt");
|
"are not sure, reedit the CMakeCache.txt");
|
||||||
cmSystemTools::Error(message.c_str());
|
cmSystemTools::Error(message.c_str());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue