diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2002-12-05 19:56:31 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2002-12-05 19:56:31 (GMT) |
commit | 7985bc118e336010a5b840ca3c326287649a463c (patch) | |
tree | aba922a0b053775debeaf66ce1d13a9c1ea7a727 /Source/cmCacheManager.cxx | |
parent | 83f596ee9d7ddba7880ccf1f51c9b6d82d0267ec (diff) | |
download | CMake-7985bc118e336010a5b840ca3c326287649a463c.zip CMake-7985bc118e336010a5b840ca3c326287649a463c.tar.gz CMake-7985bc118e336010a5b840ca3c326287649a463c.tar.bz2 |
ENH: add a rule to automatically re-run cmake from the top if the CMakeCache.txt file is changed
Diffstat (limited to 'Source/cmCacheManager.cxx')
-rw-r--r-- | Source/cmCacheManager.cxx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index 81762a1..8609db3 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -456,8 +456,18 @@ bool cmCacheManager::SaveCache(const char* path) cmSystemTools::CopyFileIfDifferent(tempFile.c_str(), cacheFile.c_str()); cmSystemTools::RemoveFile(tempFile.c_str()); - return true; + std::string checkCacheFile = path; + checkCacheFile += "/cmake.check_cache"; + std::ofstream checkCache(checkCacheFile.c_str()); + if(!checkCache) + { + cmSystemTools::Error("Unable to open check cache file for write. ", + checkCacheFile.c_str()); + return false; } + checkCache << "# This file is generated by cmake for dependency checking of the CMakeCache.txt file\n"; + return true; +} void cmCacheManager::OutputHelpString(std::ofstream& fout, const std::string& helpString) |