summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2007-11-13 03:33:00 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2007-11-13 03:33:00 (GMT)
commitd9d40942a0e7fe2780e33ddd0912ecb3e2335079 (patch)
tree9e7484eec6218565c1e3e9e02155a14ab8bdcf0a /Source/cmGlobalGenerator.cxx
parent9dec5fbaf1dfb46c5de61b934143c8cfee6374a1 (diff)
downloadCMake-d9d40942a0e7fe2780e33ddd0912ecb3e2335079.zip
CMake-d9d40942a0e7fe2780e33ddd0912ecb3e2335079.tar.gz
CMake-d9d40942a0e7fe2780e33ddd0912ecb3e2335079.tar.bz2
ENH: add guess progress for first time configuring a project.
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx32
1 files changed, 32 insertions, 0 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 463c56c..a0182ee 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -681,6 +681,7 @@ bool cmGlobalGenerator::IsDependedOn(const char* project,
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 @@ int cmGlobalGenerator::TryCompile(const char *srcdir, const char *bindir,
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 @@ void cmGlobalGenerator::AddLocalGenerator(cmLocalGenerator *lg)
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;
}