Browse Source

cmInstallGenerator: Add a Compute() virtual hook.

Stephen Kelly 10 years ago
parent
commit
e5e5297018
2 changed files with 14 additions and 0 deletions
  1. 12 0
      Source/cmGlobalGenerator.cxx
  2. 2 0
      Source/cmInstallGenerator.h

+ 12 - 0
Source/cmGlobalGenerator.cxx

@@ -34,6 +34,7 @@
 #include "cmExportBuildFileGenerator.h"
 #include "cmCPackPropertiesGenerator.h"
 #include "cmAlgorithms.h"
+#include "cmInstallGenerator.h"
 
 #include <cmsys/Directory.hxx>
 #include <cmsys/FStream.hxx>
@@ -1260,6 +1261,17 @@ bool cmGlobalGenerator::Compute()
     }
 #endif
 
+  for (i = 0; i < this->LocalGenerators.size(); ++i)
+    {
+    cmMakefile* mf = this->LocalGenerators[i]->GetMakefile();
+    std::vector<cmInstallGenerator*>& gens = mf->GetInstallGenerators();
+    for (std::vector<cmInstallGenerator*>::const_iterator git = gens.begin();
+         git != gens.end(); ++git)
+      {
+      (*git)->Compute(this->LocalGenerators[i]);
+      }
+    }
+
   return true;
 }
 

+ 2 - 0
Source/cmInstallGenerator.h

@@ -62,6 +62,8 @@ public:
   /** Select message level from CMAKE_INSTALL_MESSAGE or 'never'.  */
   static MessageLevel SelectMessageLevel(cmMakefile* mf, bool never = false);
 
+  virtual void Compute(cmLocalGenerator*) {}
+
 protected:
   virtual void GenerateScript(std::ostream& os);