summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2008-01-18 15:25:25 (GMT)
committerKen Martin <ken.martin@kitware.com>2008-01-18 15:25:25 (GMT)
commit7c473d482824cb251db0213955b36f1d391120a1 (patch)
treeed2fcb0b61d551a3ce6a42a8701a70ff00d1796e /Source/cmake.cxx
parent6ad79d13ddd74b9bf1a1819527d5eb1e88bac8c2 (diff)
downloadCMake-7c473d482824cb251db0213955b36f1d391120a1.zip
CMake-7c473d482824cb251db0213955b36f1d391120a1.tar.gz
CMake-7c473d482824cb251db0213955b36f1d391120a1.tar.bz2
BUG: fix bugs 5539 (progress going beyond 100% when new files are added) and 5889 (tests are not found in some cases when using add_subdirectory to .. etc)
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index e95a3bb..f43f191 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -1185,7 +1185,19 @@ int cmake::ExecuteCMakeCommand(std::vector<std::string>& args)
std::string dirName = args[2];
dirName += "/Progress";
cmSystemTools::RemoveADirectory(dirName.c_str());
- int count = atoi(args[3].c_str());
+
+ // is the last argument a filename that exists?
+ FILE *countFile = fopen(args[3].c_str(),"r");
+ int count;
+ if (countFile)
+ {
+ fscanf(countFile,"%i",&count);
+ fclose(countFile);
+ }
+ else
+ {
+ count = atoi(args[3].c_str());
+ }
if (count)
{
cmSystemTools::MakeDirectory(dirName.c_str());