summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-07-24 17:31:34 (GMT)
committerBrad King <brad.king@kitware.com>2009-07-24 17:31:34 (GMT)
commit71c0e1417bdc42fbcc48986c7cb7c26642c1f665 (patch)
treee42517cc97b5977fa69bd1f4ad58f999ba929cc4
parent071ce33ec98fd6eac3345d23de76822643611083 (diff)
downloadCMake-71c0e1417bdc42fbcc48986c7cb7c26642c1f665.zip
CMake-71c0e1417bdc42fbcc48986c7cb7c26642c1f665.tar.gz
CMake-71c0e1417bdc42fbcc48986c7cb7c26642c1f665.tar.bz2
ENH: Keep only FinalPass commands in memory
In cmMakefile we save all invoked commands so that FinalPass can be called on them later. Most commands have no final pass, so we should keep only the few that do.
-rw-r--r--Source/cmCommand.h5
-rw-r--r--Source/cmConfigureFileCommand.h1
-rw-r--r--Source/cmExportLibraryDependencies.h1
-rw-r--r--Source/cmFLTKWrapUICommand.h1
-rw-r--r--Source/cmInstallFilesCommand.h1
-rw-r--r--Source/cmInstallProgramsCommand.h2
-rw-r--r--Source/cmLoadCommandCommand.cxx2
-rw-r--r--Source/cmMakefile.cxx2
8 files changed, 14 insertions, 1 deletions
diff --git a/Source/cmCommand.h b/Source/cmCommand.h
index ed00b78..1a85102 100644
--- a/Source/cmCommand.h
+++ b/Source/cmCommand.h
@@ -87,6 +87,11 @@ public:
* writing to the cache can be done.
*/
virtual void FinalPass() {};
+
+ /**
+ * Does this command have a final pass? Query after InitialPass.
+ */
+ virtual bool HasFinalPass() const { return false; }
/**
* This is a virtual constructor for the command.
diff --git a/Source/cmConfigureFileCommand.h b/Source/cmConfigureFileCommand.h
index 4147c68..b65ced1 100644
--- a/Source/cmConfigureFileCommand.h
+++ b/Source/cmConfigureFileCommand.h
@@ -81,6 +81,7 @@ public:
}
virtual void FinalPass();
+ virtual bool HasFinalPass() const { return !this->Immediate; }
private:
int ConfigureFile();
diff --git a/Source/cmExportLibraryDependencies.h b/Source/cmExportLibraryDependencies.h
index b5997cc..75de7dc 100644
--- a/Source/cmExportLibraryDependencies.h
+++ b/Source/cmExportLibraryDependencies.h
@@ -48,6 +48,7 @@ public:
* specified by the command is accumulated.
*/
virtual void FinalPass();
+ virtual bool HasFinalPass() const { return true; }
/**
* The name of the command as specified in CMakeList.txt.
diff --git a/Source/cmFLTKWrapUICommand.h b/Source/cmFLTKWrapUICommand.h
index 4815534..ff74f07 100644
--- a/Source/cmFLTKWrapUICommand.h
+++ b/Source/cmFLTKWrapUICommand.h
@@ -52,6 +52,7 @@ public:
* writing to the cache can be done.
*/
virtual void FinalPass();
+ virtual bool HasFinalPass() const { return true; }
/**
* The name of the command as specified in CMakeList.txt.
diff --git a/Source/cmInstallFilesCommand.h b/Source/cmInstallFilesCommand.h
index 6262833..2ba7f61 100644
--- a/Source/cmInstallFilesCommand.h
+++ b/Source/cmInstallFilesCommand.h
@@ -63,6 +63,7 @@ public:
* writing to the cache can be done.
*/
virtual void FinalPass();
+ virtual bool HasFinalPass() const { return !this->IsFilesForm; }
/**
* More documentation.
diff --git a/Source/cmInstallProgramsCommand.h b/Source/cmInstallProgramsCommand.h
index 04fbb07..8f4713e 100644
--- a/Source/cmInstallProgramsCommand.h
+++ b/Source/cmInstallProgramsCommand.h
@@ -64,6 +64,8 @@ public:
*/
virtual void FinalPass();
+ virtual bool HasFinalPass() const { return true; }
+
/**
* More documentation.
*/
diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx
index fe67443..218a1fc 100644
--- a/Source/cmLoadCommandCommand.cxx
+++ b/Source/cmLoadCommandCommand.cxx
@@ -68,6 +68,8 @@ public:
* writing to the cache can be done.
*/
virtual void FinalPass();
+ virtual bool HasFinalPass() const
+ { return this->info.FinalPass? true:false; }
/**
* The name of the command as specified in CMakeList.txt.
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 84d82df..648639c 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -415,7 +415,7 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff,
cmSystemTools::SetFatalErrorOccured();
}
}
- else
+ else if(pcmd->HasFinalPass())
{
// use the command
this->UsedCommands.push_back(pcmd.release());