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