Browse Source

cmLocalGenerator: Simplify semantic of adding generator targets.

Don't store on the global generator as a side effect.  Update clients to adapt.
Stephen Kelly 10 years ago
parent
commit
04b6bb1676

+ 1 - 0
Source/cmGlobalVisualStudio8Generator.cxx

@@ -257,6 +257,7 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget()
 
   cmGeneratorTarget* gt = new cmGeneratorTarget(tgt, lg);
   lg->AddGeneratorTarget(tgt, gt);
+  this->AddGeneratorTarget(tgt, gt);
 
   // Organize in the "predefined targets" folder:
   //

+ 1 - 0
Source/cmGlobalVisualStudioGenerator.cxx

@@ -88,6 +88,7 @@ void cmGlobalVisualStudioGenerator::AddExtraIDETargets()
 
       cmGeneratorTarget* gt = new cmGeneratorTarget(allBuild, gen[0]);
       gen[0]->AddGeneratorTarget(allBuild, gt);
+      this->AddGeneratorTarget(allBuild, gt);
 
 #if 0
       // Can't activate this code because we want ALL_BUILD

+ 2 - 0
Source/cmGlobalXCodeGenerator.cxx

@@ -460,6 +460,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
 
   cmGeneratorTarget* allBuildGt = new cmGeneratorTarget(allbuild, root);
   root->AddGeneratorTarget(allbuild, allBuildGt);
+  root->GetGlobalGenerator()->AddGeneratorTarget(allbuild, allBuildGt);
 
   // Refer to the main build configuration file for easy editing.
   std::string listfile = root->GetCurrentSourceDirectory();
@@ -495,6 +496,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
 
     cmGeneratorTarget* checkGt = new cmGeneratorTarget(check, root);
     root->AddGeneratorTarget(check, checkGt);
+    root->GetGlobalGenerator()->AddGeneratorTarget(check, checkGt);
     }
 
   // now make the allbuild depend on all the non-utility targets

+ 0 - 1
Source/cmLocalGenerator.cxx

@@ -451,7 +451,6 @@ void cmLocalGenerator::GenerateInstallRules()
 void cmLocalGenerator::AddGeneratorTarget(cmTarget* t, cmGeneratorTarget* gt)
 {
   this->GeneratorTargets[t] = gt;
-  this->GetGlobalGenerator()->AddGeneratorTarget(t, gt);
 }
 
 //----------------------------------------------------------------------------

+ 1 - 0
Source/cmQtAutoGeneratorInitializer.cxx

@@ -896,6 +896,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
 
     cmGeneratorTarget* gt = new cmGeneratorTarget(autogenTarget, lg);
     lg->AddGeneratorTarget(autogenTarget, gt);
+    lg->GetGlobalGenerator()->AddGeneratorTarget(autogenTarget, gt);
 
     // Set target folder
     const char* autogenFolder = makefile->GetState()