summaryrefslogtreecommitdiffstats
path: root/Source/cmCacheManager.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2006-02-21 04:08:12 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2006-02-21 04:08:12 (GMT)
commite015df7d06a2b591571228cba10c5268a8f8fccd (patch)
tree3b25646b59d65a98d7a34edeeda9ac895d4bb0bc /Source/cmCacheManager.cxx
parent2cb68f60003d0dbe9a2f91663ebca7de3b16c8f1 (diff)
downloadCMake-e015df7d06a2b591571228cba10c5268a8f8fccd.zip
CMake-e015df7d06a2b591571228cba10c5268a8f8fccd.tar.gz
CMake-e015df7d06a2b591571228cba10c5268a8f8fccd.tar.bz2
ENH: better finding of mingw from msys, and delete CMakeFiles directory when cache is deleted
Diffstat (limited to 'Source/cmCacheManager.cxx')
-rw-r--r--Source/cmCacheManager.cxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index ece2084..055e9f1 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -19,6 +19,7 @@
#include "cmSystemTools.h"
#include "cmCacheManager.h"
#include "cmMakefile.h"
+#include <cmsys/Directory.hxx>
#include <cmsys/RegularExpression.hxx>
@@ -580,8 +581,26 @@ bool cmCacheManager::SaveCache(const char* path)
bool cmCacheManager::DeleteCache(const char* path)
{
std::string cacheFile = 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 += "/CMakeFiles";
+ dir.Load(cmakeFiles.c_str());
+ for (unsigned long fileNum = 0; fileNum < dir.GetNumberOfFiles(); ++fileNum)
+ {
+ if(!cmSystemTools::
+ FileIsDirectory(dir.GetFile(fileNum)))
+ {
+ std::string fullPath = cmakeFiles;
+ fullPath += "/";
+ fullPath += dir.GetFile(fileNum);
+ cmSystemTools::RemoveFile(fullPath.c_str());
+ }
+ }
return true;
}