summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-07-24 13:31:34 -0400
committerBrad King <brad.king@kitware.com>2009-07-24 13:31:34 -0400
commit71c0e1417bdc42fbcc48986c7cb7c26642c1f665 (patch)
treee42517cc97b5977fa69bd1f4ad58f999ba929cc4
parent071ce33ec98fd6eac3345d23de76822643611083 (diff)
downloadcmake-71c0e1417bdc42fbcc48986c7cb7c26642c1f665.tar.gz
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 ed00b7867d..1a85102797 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 4147c68652..b65ced1c9c 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 b5997ccded..75de7dcbc4 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 48155347d4..ff74f07b67 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 6262833dcb..2ba7f61350 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 04fbb07f10..8f4713e691 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 fe67443425..218a1fcca2 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 84d82df802..648639c590 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());