diff options
author | Brad King <brad.king@kitware.com> | 2013-02-20 13:09:40 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-02-20 13:09:40 (GMT) |
commit | fc7b4d5cf320ca0c3b81be4e7163215d870342c4 (patch) | |
tree | 0895d866ea95f4b014b4cd34a2bc4c92bfe63bfd /Source | |
parent | f1cd42f8182946109f71fdd37956245c0d8cfb4f (diff) | |
parent | e83e6a1c8c572548b2a8ce1e54f4fd0f60f32a70 (diff) | |
download | CMake-fc7b4d5cf320ca0c3b81be4e7163215d870342c4.zip CMake-fc7b4d5cf320ca0c3b81be4e7163215d870342c4.tar.gz CMake-fc7b4d5cf320ca0c3b81be4e7163215d870342c4.tar.bz2 |
Merge topic 'compiler-change-cleanup'
e83e6a1 Test Unix Makefiles generator support for changing compilers
c307e1c Tests/RunCMake: Allow tests to control build tree behavior
2963c98 Merge branch 'empty-compiler-crash' into compiler-change-cleanup
1df09e5 Delete entire CMakeFiles directory when deleting CMakeCache.txt (#13756)
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmCacheManager.cxx | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index 4231243..3d5b24b 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -584,23 +584,15 @@ bool cmCacheManager::DeleteCache(const char* path) cmSystemTools::ConvertToUnixSlashes(cacheFile); std::string cmakeFiles = cacheFile; cacheFile += "/CMakeCache.txt"; - cmSystemTools::RemoveFile(cacheFile.c_str()); - // now remove the files in the CMakeFiles directory - // this cleans up language cache files - cmsys::Directory dir; - cmakeFiles += cmake::GetCMakeFilesDirectory(); - dir.Load(cmakeFiles.c_str()); - for (unsigned long fileNum = 0; - fileNum < dir.GetNumberOfFiles(); - ++fileNum) - { - if(!cmSystemTools:: - FileIsDirectory(dir.GetFile(fileNum))) + if(cmSystemTools::FileExists(cacheFile.c_str())) + { + cmSystemTools::RemoveFile(cacheFile.c_str()); + // now remove the files in the CMakeFiles directory + // this cleans up language cache files + cmakeFiles += cmake::GetCMakeFilesDirectory(); + if(cmSystemTools::FileIsDirectory(cmakeFiles.c_str())) { - std::string fullPath = cmakeFiles; - fullPath += "/"; - fullPath += dir.GetFile(fileNum); - cmSystemTools::RemoveFile(fullPath.c_str()); + cmSystemTools::RemoveADirectory(cmakeFiles.c_str()); } } return true; |