summaryrefslogtreecommitdiff
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-06-04 14:32:08 -0400
committerBrad King <brad.king@kitware.com>2010-06-04 14:32:08 -0400
commitfdb5f78705f1a603d176a0976c931dd197567ff9 (patch)
tree3133f91aaf9fe5aeb44cc1ff22c8d0379bc4a725 /Source/cmSystemTools.cxx
parent3ac3dea6f0eb1ce68b321020ecdd336b3db8a0fe (diff)
downloadcmake-fdb5f78705f1a603d176a0976c931dd197567ff9.tar.gz
CPack: Try harder to remove temporary dir (#10793)
Windows filesystems sometimes lock files temporarily. Try removing the CPack temp install folder multiple times before giving up.
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index d914203bfb..5f7cfa3988 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -2938,3 +2938,18 @@ bool cmSystemTools::CheckRPath(std::string const& file,
return false;
#endif
}
+
+//----------------------------------------------------------------------------
+bool cmSystemTools::RepeatedRemoveDirectory(const char* dir)
+{
+ // Windows sometimes locks files temporarily so try a few times.
+ for(int i = 0; i < 10; ++i)
+ {
+ if(cmSystemTools::RemoveADirectory(dir))
+ {
+ return true;
+ }
+ cmSystemTools::Delay(100);
+ }
+ return false;
+}