summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2001-11-01 15:42:07 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2001-11-01 15:42:07 (GMT)
commit10ae8a4e249548ab3a2ea223d9bbc4dee1107a9d (patch)
tree86df06c36548cd30919eee3c0f85824f7721269f /Source
parent8e79e498f988fbff8b6004af71d45a4a5c82c716 (diff)
downloadCMake-10ae8a4e249548ab3a2ea223d9bbc4dee1107a9d.zip
CMake-10ae8a4e249548ab3a2ea223d9bbc4dee1107a9d.tar.gz
CMake-10ae8a4e249548ab3a2ea223d9bbc4dee1107a9d.tar.bz2
ENH: clean up drive letter check
Diffstat (limited to 'Source')
-rw-r--r--Source/cmCacheManager.cxx43
1 files changed, 26 insertions, 17 deletions
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index b38a245..faf5059 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -248,25 +248,34 @@ bool cmCacheManager::LoadCache(const char* path,
"current loaded cache", cmCacheManager::INTERNAL);
}
- std::string currentcwd = path;
- if ( currentcwd[0] >= 'A' && currentcwd[0] <= 'Z' &&
- currentcwd[1] == ':' )
- {
- currentcwd[0] = currentcwd[0] - 'A' + 'a';
- }
- cmSystemTools::ConvertToUnixSlashes(currentcwd);
- if(internal && this->GetCacheValue("CMAKE_CACHEFILE_DIR") &&
- std::string(this->GetCacheValue("CMAKE_CACHEFILE_DIR")) != currentcwd)
+ if ( internal && this->GetCacheValue("CMAKE_CACHEFILE_DIR") )
{
- 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());
+ std::string currentcwd = path;
+ std::string oldcwd = this->GetCacheValue("CMAKE_CACHEFILE_DIR");
+ if ( currentcwd[0] >= 'A' && currentcwd[0] <= 'Z' &&
+ currentcwd[1] == ':' )
+ {
+ currentcwd[0] = currentcwd[0] - 'A' + 'a';
+ }
+ if ( oldcwd[0] >= 'A' && oldcwd[0] <= 'Z' &&
+ oldcwd[1] == ':' )
+ {
+ oldcwd[0] = oldcwd[0] - 'A' + 'a';
+ }
+ cmSystemTools::ConvertToUnixSlashes(currentcwd);
+ 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;
}