diff options
author | Ken Martin <ken.martin@kitware.com> | 2005-08-11 17:20:23 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2005-08-11 17:20:23 (GMT) |
commit | 039d4b604e7b35b9f9daa4edde8f348296d5ea28 (patch) | |
tree | c3cd53290a2cef57d80831e27f3a1b1bd2eabfa7 /Source/cmake.cxx | |
parent | 8a537ce3300c2e5e36a26eeae3c93bec8d6d526e (diff) | |
download | CMake-039d4b604e7b35b9f9daa4edde8f348296d5ea28.zip CMake-039d4b604e7b35b9f9daa4edde8f348296d5ea28.tar.gz CMake-039d4b604e7b35b9f9daa4edde8f348296d5ea28.tar.bz2 |
ENH: added better error checking for cases when there is a CMakeCache.txt file but it is not readable
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index aca7ab6..9ea46c5 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1515,7 +1515,18 @@ void cmake::AddDefaultGenerators() int cmake::LoadCache() { - m_CacheManager->LoadCache(this->GetHomeOutputDirectory()); + // could we not read the cache + if (!m_CacheManager->LoadCache(this->GetHomeOutputDirectory())) + { + // if it does exist, but isn;t readable then warn the user + std::string cacheFile = this->GetHomeOutputDirectory(); + cacheFile += "/CMakeCache.txt"; + if(cmSystemTools::FileExists(cacheFile.c_str())) + { + cmSystemTools::Error("There is a CMakeCache.txt file for the current binary tree but cmake does not have permission to read it. Please check the permissions of the directory you are trying to run CMake on."); + return -1; + } + } if (m_CMakeCommand.size() < 2) { |