From 775697d5f5e8812dc642d1e21e7bc5405df943cd Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Tue, 21 Sep 2010 10:04:04 -0400 Subject: [PATCH] Add a delay after untar on windows to make external project work on windows 7 OK, on windows 7 after we untar some files, sometimes we can not rename the directory after the untar is done. This breaks the external project untar and rename code. So, by default we will wait 1/10th of a second after the untar. If CMAKE_UNTAR_DELAY is set in the env, its value will be used instead of 100. --- Source/cmake.cxx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Source/cmake.cxx b/Source/cmake.cxx index e6c7bb0b0..1e3b0187a 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1574,6 +1574,24 @@ int cmake::ExecuteCMakeCommand(std::vector& args) cmSystemTools::Error("Problem extracting tar: ", outFile.c_str()); return 1; } +#ifdef WIN32 + // OK, on windows 7 after we untar some files, + // sometimes we can not rename the directory after + // the untar is done. This breaks the external project + // untar and rename code. So, by default we will wait + // 1/10th of a second after the untar. If CMAKE_UNTAR_DELAY + // is set in the env, its value will be used instead of 100. + int delay = 100; + const char* delayVar = cmSystemTools::GetEnv("CMAKE_UNTAR_DELAY"); + if(delayVar) + { + delay = atoi(delayVar); + } + if(delay) + { + cmSystemTools::Delay(delay); + } +#endif } return 0; }