[cmake-commits] hoffman committed cmGlobalGenerator.cxx 1.209 1.210
cmGlobalGenerator.h 1.96 1.97
cmake-commits at cmake.org
cmake-commits at cmake.org
Mon Nov 12 22:33:02 EST 2007
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv32316
Modified Files:
cmGlobalGenerator.cxx cmGlobalGenerator.h
Log Message:
ENH: add guess progress for first time configuring a project.
Index: cmGlobalGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalGenerator.h,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -d -r1.96 -r1.97
--- cmGlobalGenerator.h 10 Oct 2007 15:06:14 -0000 1.96
+++ cmGlobalGenerator.h 13 Nov 2007 03:33:00 -0000 1.97
@@ -270,6 +270,7 @@
cmTargetManifest TargetManifest;
private:
+ float FirstTimeProgress;
// If you add a new map here, make sure it is copied
// in EnableLanguagesFromGenerator
std::map<cmStdString, bool> IgnoreExtensions;
Index: cmGlobalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalGenerator.cxx,v
retrieving revision 1.209
retrieving revision 1.210
diff -u -d -r1.209 -r1.210
--- cmGlobalGenerator.cxx 22 Oct 2007 16:48:39 -0000 1.209
+++ cmGlobalGenerator.cxx 13 Nov 2007 03:33:00 -0000 1.210
@@ -681,6 +681,7 @@
void cmGlobalGenerator::Configure()
{
+ this->FirstTimeProgress = 0.0;
// Delete any existing cmLocalGenerators
unsigned int i;
for (i = 0; i < this->LocalGenerators.size(); ++i)
@@ -896,6 +897,26 @@
const char *target,
std::string *output, cmMakefile *mf)
{
+ // if this is not set, then this is a first time configure
+ // and there is a good chance that the try compile stuff will
+ // take the bulk of the time, so try and guess some progress
+ // by getting closer and closer to 100 without actually getting there.
+ if (!this->CMakeInstance->GetCacheManager()->GetCacheValue
+ ("CMAKE_NUMBER_OF_LOCAL_GENERATORS"))
+ {
+ // If CMAKE_NUMBER_OF_LOCAL_GENERATORS is not set
+ // we are in the first time progress and we have no
+ // idea how long it will be. So, just move 1/10th of the way
+ // there each time, and don't go over 95%
+ this->FirstTimeProgress += ((1.0 - this->FirstTimeProgress) /30.0);
+ if(this->FirstTimeProgress > 0.95f)
+ {
+ this->FirstTimeProgress = 0.95f;
+ }
+ this->CMakeInstance->UpdateProgress("Configuring",
+ this->FirstTimeProgress);
+ }
+
std::string makeCommand = this->CMakeInstance->
GetCacheManager()->GetCacheValue("CMAKE_MAKE_PROGRAM");
if(makeCommand.size() == 0)
@@ -1055,6 +1076,17 @@
if (!numGenC)
{
+ // If CMAKE_NUMBER_OF_LOCAL_GENERATORS is not set
+ // we are in the first time progress and we have no
+ // idea how long it will be. So, just move half way
+ // there each time, and don't go over 95%
+ this->FirstTimeProgress += ((1.0 - this->FirstTimeProgress) /30.0);
+ if(this->FirstTimeProgress > 0.95f)
+ {
+ this->FirstTimeProgress = 0.95f;
+ }
+ this->CMakeInstance->UpdateProgress("Configuring",
+ this->FirstTimeProgress);
return;
}
More information about the Cmake-commits
mailing list