[Cmake-commits] CMake branch, next, updated. v3.3.0-1350-g1df0f0d

Stephen Kelly steveire at gmail.com
Sun Jul 26 04:49:31 EDT 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  1df0f0d628c0b5f405d0ae1b2d9ed159fb11283d (commit)
       via  89a5cc37dfde7bc271f86932a2f37eda8765508d (commit)
       via  dab7d98dcf5d183c5973db3c88204246e6973eea (commit)
       via  523f543bd87dc17ac864e1a41a31449a955ff307 (commit)
       via  3efb25a22bb887f92df8bbb6f819f29b09f17670 (commit)
       via  38a18e8a9d7e63a526117aaa2ac394035f38d5ec (commit)
       via  3dcdb6b49646b518774e519d0d61a0cc0afbf93b (commit)
       via  1ded7c87e8a074dd708f9be03b2b26f36359b2c4 (commit)
       via  1cb40f16678694bcdf17790894ae1ffdb7e469c5 (commit)
       via  ecf15b4ff5562e37fc370f3c9f9244adc1b8e7af (commit)
       via  e3e53b205b135a6b7d769a291003a63db655cbe9 (commit)
       via  74997f6f19ed6f2ffd6d9f2d4df41fb65bd70f12 (commit)
       via  d94eb6bf40064f76266ea756855e82399d210444 (commit)
       via  5144f70e01af28a63332f28cac878423ccebef29 (commit)
       via  981fe8f34bbfa11eaaf39a2f10fc6be1f25369b8 (commit)
       via  6ecc3406215477d344df8b10543ae990586103a9 (commit)
       via  ce29c80d3d533e8b79d06ccadd880b0b0413e0fb (commit)
       via  3123ffd3e1fb2651e49f247e932e30689e1a5a5f (commit)
       via  e01ad8f59c84be5467677c81e2ce1b11b4f1d0f2 (commit)
       via  5dd3341b0f97257d1262118ea32eabc817e2e507 (commit)
       via  3f99fd2daf1b9ac89419d6ddc37542eaf5b5b8e8 (commit)
       via  26d1a9d356ad3122f7d07dcd93d12767726807cf (commit)
       via  d546133d49432d24561760730b6e09213b5d136c (commit)
      from  9ab64be4926fc764e76a96a33186ac7c28202c0b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1df0f0d628c0b5f405d0ae1b2d9ed159fb11283d
commit 1df0f0d628c0b5f405d0ae1b2d9ed159fb11283d
Merge: 9ab64be 89a5cc3
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jul 26 04:49:28 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Jul 26 04:49:28 2015 -0400

    Merge topic 'use-generator-target' into next
    
    89a5cc37 Port some of the cmExportFileGenerator API to cmGeneratorTarget.
    dab7d98d Port cmExportBuildFileGenerator to cmGeneratorTarget.
    523f543b cmExportTryCompileFileGenerator: Create cmGeneratorTargets.
    3efb25a2 Move GetFullPath to cmGeneratorTarget
    38a18e8a Move GetLocationForBuild to cmGeneratorTarget.
    3dcdb6b4 Move GetLocation to cmGeneratorTarget.
    1ded7c87 Always access target location from a cmGeneratorTarget instance.
    1cb40f16 cmTarget: Restore the ImportedGetLocation method.
    ecf15b4f cmIncludeCommand: Populate the cmGeneratorTargets in deprecated path.
    e3e53b20 cmTarget: Create cmGeneratorTargets before reading deprecated LOCATION.
    74997f6f cmTarget: Inline GetLocation into deprecated callers.
    d94eb6bf cmGlobalGenerator: Create cmGeneratorTargets before QtAutomoc.
    5144f70e cmGlobalGenerator: Create cmGeneratorTargets earlier.
    981fe8f3 cmTarget: Use reliable test for CMP0024 and CMP0026 OLD.
    6ecc3406 cmLocalGenerator: Remove CreateCustomTargetsAndCommands method.
    ce29c80d cmGlobalGenerator: Add global targets at the end of Configure.
    ...


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=89a5cc37dfde7bc271f86932a2f37eda8765508d
commit 89a5cc37dfde7bc271f86932a2f37eda8765508d
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Oct 6 17:51:07 2012 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jul 26 10:40:42 2015 +0200

    Port some of the cmExportFileGenerator API to cmGeneratorTarget.
    
    Enough to make it more possible to move GetLinkInterface
    to cmGeneratorTarget.

diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index d02a39b..355fc00 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -148,11 +148,11 @@ cmExportBuildFileGenerator
       if (target->GetType() != cmTarget::INTERFACE_LIBRARY)
         {
         this->SetImportDetailProperties(config, suffix,
-                                        target->Target,
+                                        target,
                                         properties, missingTargets);
         this->SetImportLinkInterface(config, suffix,
                                      cmGeneratorExpression::BuildInterface,
-                                     target->Target,
+                                     target,
                                      properties, missingTargets);
         }
 
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 094ad4f..a33cd59 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -791,12 +791,13 @@ void
 cmExportFileGenerator
 ::SetImportLinkInterface(const std::string& config, std::string const& suffix,
                     cmGeneratorExpression::PreprocessContext preprocessRule,
-                    cmTarget* target, ImportPropertyMap& properties,
+                    cmGeneratorTarget* target, ImportPropertyMap& properties,
                     std::vector<std::string>& missingTargets)
 {
   // Add the transitive link dependencies for this configuration.
-  cmTarget::LinkInterface const* iface = target->GetLinkInterface(config,
-                                                                  target);
+  cmTarget::LinkInterface const* iface = target->Target->GetLinkInterface(
+                                                              config,
+                                                              target->Target);
   if (!iface)
     {
     return;
@@ -829,12 +830,14 @@ cmExportFileGenerator
     }
 
   const bool newCMP0022Behavior =
-                        target->GetPolicyStatusCMP0022() != cmPolicies::WARN
-                     && target->GetPolicyStatusCMP0022() != cmPolicies::OLD;
+                        target->Target
+                              ->GetPolicyStatusCMP0022() != cmPolicies::WARN
+                     && target->Target
+                              ->GetPolicyStatusCMP0022() != cmPolicies::OLD;
 
   if(newCMP0022Behavior && !this->ExportOld)
     {
-    cmMakefile *mf = target->GetMakefile();
+    cmMakefile *mf = target->Target->GetMakefile();
     std::ostringstream e;
     e << "Target \"" << target->GetName() << "\" has policy CMP0022 enabled, "
          "but also has old-style LINK_INTERFACE_LIBRARIES properties "
@@ -854,7 +857,7 @@ cmExportFileGenerator
                                                          preprocessRule);
   if (!prepro.empty())
     {
-    this->ResolveTargetsInGeneratorExpressions(prepro, target,
+    this->ResolveTargetsInGeneratorExpressions(prepro, target->Target,
                                                missingTargets,
                                                ReplaceFreeTargets);
     properties["IMPORTED_LINK_INTERFACE_LIBRARIES" + suffix] = prepro;
@@ -866,12 +869,13 @@ void
 cmExportFileGenerator
 ::SetImportDetailProperties(const std::string& config,
                             std::string const& suffix,
-                            cmTarget* target, ImportPropertyMap& properties,
+                            cmGeneratorTarget* target,
+                            ImportPropertyMap& properties,
                             std::vector<std::string>& missingTargets
                            )
 {
   // Get the makefile in which to lookup target information.
-  cmMakefile* mf = target->GetMakefile();
+  cmMakefile* mf = target->Makefile;
 
   // Add the soname for unix shared libraries.
   if(target->GetType() == cmTarget::SHARED_LIBRARY ||
@@ -884,14 +888,14 @@ cmExportFileGenerator
       {
       std::string prop;
       std::string value;
-      if(target->HasSOName(config))
+      if(target->Target->HasSOName(config))
         {
         if(mf->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME"))
           {
-          value = this->InstallNameDir(target, config);
+          value = this->InstallNameDir(target->Target, config);
           }
         prop = "IMPORTED_SONAME";
-        value += target->GetSOName(config);
+        value += target->Target->GetSOName(config);
         }
       else
         {
@@ -904,8 +908,9 @@ cmExportFileGenerator
     }
 
   // Add the transitive link dependencies for this configuration.
-  if(cmTarget::LinkInterface const* iface = target->GetLinkInterface(config,
-                                                                     target))
+  if(cmTarget::LinkInterface const* iface =
+                            target->Target
+                                  ->GetLinkInterface(config, target->Target))
     {
     this->SetImportLinkProperty(suffix, target,
                                 "IMPORTED_LINK_INTERFACE_LANGUAGES",
@@ -931,7 +936,7 @@ template <typename T>
 void
 cmExportFileGenerator
 ::SetImportLinkProperty(std::string const& suffix,
-                        cmTarget* target,
+                        cmGeneratorTarget* target,
                         const std::string& propName,
                         std::vector<T> const& entries,
                         ImportPropertyMap& properties,
@@ -955,7 +960,7 @@ cmExportFileGenerator
     sep = ";";
 
     std::string temp = *li;
-    this->AddTargetNamespace(temp, target, missingTargets);
+    this->AddTargetNamespace(temp, target->Target, missingTargets);
     link_entries += temp;
     }
 
diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h
index b6f4166..bcc41cc 100644
--- a/Source/cmExportFileGenerator.h
+++ b/Source/cmExportFileGenerator.h
@@ -92,13 +92,14 @@ protected:
   // Collect properties with detailed information about targets beyond
   // their location on disk.
   void SetImportDetailProperties(const std::string& config,
-                                 std::string const& suffix, cmTarget* target,
+                                 std::string const& suffix,
+                                 cmGeneratorTarget* target,
                                  ImportPropertyMap& properties,
                                  std::vector<std::string>& missingTargets);
 
   template <typename T>
   void SetImportLinkProperty(std::string const& suffix,
-                             cmTarget* target, const std::string& propName,
+                             cmGeneratorTarget* target, const std::string& propName,
                              std::vector<T> const& entries,
                              ImportPropertyMap& properties,
                              std::vector<std::string>& missingTargets);
@@ -148,7 +149,7 @@ protected:
   void SetImportLinkInterface(const std::string& config,
                     std::string const& suffix,
                     cmGeneratorExpression::PreprocessContext preprocessRule,
-                    cmTarget* target, ImportPropertyMap& properties,
+                    cmGeneratorTarget* target, ImportPropertyMap& properties,
                     std::vector<std::string>& missingTargets);
 
   enum FreeTargetsReplace {
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index 89c6ca2..6c7d97e 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -358,12 +358,14 @@ cmExportInstallFileGenerator
     if(!properties.empty())
       {
       // Get the rest of the target details.
+      cmGeneratorTarget *gtgt = te->Target->GetMakefile()->GetLocalGenerator()
+                    ->GetGlobalGenerator()->GetGeneratorTarget(te->Target);
       this->SetImportDetailProperties(config, suffix,
-                                      te->Target, properties, missingTargets);
+                                      gtgt, properties, missingTargets);
 
       this->SetImportLinkInterface(config, suffix,
                                    cmGeneratorExpression::InstallInterface,
-                                   te->Target, properties, missingTargets);
+                                   gtgt, properties, missingTargets);
 
       // TOOD: PUBLIC_HEADER_LOCATION
       // This should wait until the build feature propagation stuff

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dab7d98dcf5d183c5973db3c88204246e6973eea
commit dab7d98dcf5d183c5973db3c88204246e6973eea
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Oct 6 17:44:17 2012 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jul 26 10:40:42 2015 +0200

    Port cmExportBuildFileGenerator to cmGeneratorTarget.

diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index 9ed2880..d02a39b 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -36,10 +36,11 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
         tei = targets.begin();
       tei != targets.end(); ++tei)
     {
-    cmTarget *te = this->Makefile->FindTargetToUse(*tei);
-    expectedTargets += sep + this->Namespace + te->GetExportName();
+    cmGeneratorTarget *te = this->Makefile
+                                ->FindGeneratorTargetToUse(*tei);
+    expectedTargets += sep + this->Namespace + te->Target->GetExportName();
     sep = " ";
-    if(this->ExportedTargets.insert(te).second)
+    if(this->ExportedTargets.insert(te->Target).second)
       {
       this->Exports.push_back(te);
       }
@@ -63,11 +64,11 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
   std::vector<std::string> missingTargets;
 
   // Create all the imported targets.
-  for(std::vector<cmTarget*>::const_iterator
+  for(std::vector<cmGeneratorTarget*>::const_iterator
         tei = this->Exports.begin();
       tei != this->Exports.end(); ++tei)
     {
-    cmTarget* te = *tei;
+    cmTarget* te = (*tei)->Target;
     this->GenerateImportTargetCode(os, te);
 
     te->AppendBuildInterfaceIncludes();
@@ -129,12 +130,12 @@ cmExportBuildFileGenerator
                               std::string const& suffix,
                               std::vector<std::string> &missingTargets)
 {
-  for(std::vector<cmTarget*>::const_iterator
+  for(std::vector<cmGeneratorTarget*>::const_iterator
         tei = this->Exports.begin();
       tei != this->Exports.end(); ++tei)
     {
     // Collect import properties for this target.
-    cmTarget* target = *tei;
+    cmGeneratorTarget* target = *tei;
     ImportPropertyMap properties;
 
     if (target->GetType() != cmTarget::INTERFACE_LIBRARY)
@@ -147,10 +148,12 @@ cmExportBuildFileGenerator
       if (target->GetType() != cmTarget::INTERFACE_LIBRARY)
         {
         this->SetImportDetailProperties(config, suffix,
-                                        target, properties, missingTargets);
+                                        target->Target,
+                                        properties, missingTargets);
         this->SetImportLinkInterface(config, suffix,
-                                    cmGeneratorExpression::BuildInterface,
-                                    target, properties, missingTargets);
+                                     cmGeneratorExpression::BuildInterface,
+                                     target->Target,
+                                     properties, missingTargets);
         }
 
       // TOOD: PUBLIC_HEADER_LOCATION
@@ -160,7 +163,8 @@ cmExportBuildFileGenerator
       //                              properties);
 
       // Generate code in the export file.
-      this->GenerateImportPropertyCode(os, config, target, properties);
+      this->GenerateImportPropertyCode(os, config, target->Target,
+                                       properties);
       }
     }
 }
@@ -176,26 +180,24 @@ void
 cmExportBuildFileGenerator
 ::SetImportLocationProperty(const std::string& config,
                             std::string const& suffix,
-                            cmTarget* target, ImportPropertyMap& properties)
+                            cmGeneratorTarget* target,
+                            ImportPropertyMap& properties)
 {
   // Get the makefile in which to lookup target information.
-  cmMakefile* mf = target->GetMakefile();
-
-  cmGeneratorTarget* gtgt =
-      mf->GetGlobalGenerator()->GetGeneratorTarget(target);
+  cmMakefile* mf = target->Makefile;
 
   // Add the main target file.
   {
   std::string prop = "IMPORTED_LOCATION";
   prop += suffix;
   std::string value;
-  if(target->IsAppBundleOnApple())
+  if(target->Target->IsAppBundleOnApple())
     {
-    value = gtgt->GetFullPath(config, false);
+    value = target->GetFullPath(config, false);
     }
   else
     {
-    value = gtgt->GetFullPath(config, false, true);
+    value = target->GetFullPath(config, false, true);
     }
   properties[prop] = value;
   }
@@ -207,13 +209,13 @@ cmExportBuildFileGenerator
   // Add the import library for windows DLLs.
   if(dll_platform &&
      (target->GetType() == cmTarget::SHARED_LIBRARY ||
-      target->IsExecutableWithExports()) &&
+      target->Target->IsExecutableWithExports()) &&
      mf->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX"))
     {
     std::string prop = "IMPORTED_IMPLIB";
     prop += suffix;
-    std::string value = gtgt->GetFullPath(config, true);
-    target->GetImplibGNUtoMS(value, value,
+    std::string value = target->GetFullPath(config, true);
+    target->Target->GetImplibGNUtoMS(value, value,
                              "${CMAKE_IMPORT_LIBRARY_SUFFIX}");
     properties[prop] = value;
     }
diff --git a/Source/cmExportBuildFileGenerator.h b/Source/cmExportBuildFileGenerator.h
index 8b5694c..4d8e062 100644
--- a/Source/cmExportBuildFileGenerator.h
+++ b/Source/cmExportBuildFileGenerator.h
@@ -68,7 +68,7 @@ protected:
   /** Fill in properties indicating built file locations.  */
   void SetImportLocationProperty(const std::string& config,
                                  std::string const& suffix,
-                                 cmTarget* target,
+                                 cmGeneratorTarget* target,
                                  ImportPropertyMap& properties);
 
   std::string InstallNameDir(cmTarget* target, const std::string& config);
@@ -78,7 +78,7 @@ protected:
 
   std::vector<std::string> Targets;
   cmExportSet *ExportSet;
-  std::vector<cmTarget*> Exports;
+  std::vector<cmGeneratorTarget*> Exports;
   cmMakefile* Makefile;
   cmListFileBacktrace Backtrace;
 };

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=523f543bd87dc17ac864e1a41a31449a955ff307
commit 523f543bd87dc17ac864e1a41a31449a955ff307
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jul 25 20:44:35 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jul 26 10:39:52 2015 +0200

    cmExportTryCompileFileGenerator: Create cmGeneratorTargets.
    
    This is not a deprecated behavior, but only requires IMPORTED targets
    be made.

diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index e1e1a5c..ffb349e 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -379,7 +379,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
     if (!targets.empty())
       {
       std::string fname = "/" + std::string(targetName) + "Targets.cmake";
-      cmExportTryCompileFileGenerator tcfg;
+      cmExportTryCompileFileGenerator tcfg(gg);
       tcfg.SetExportFile((this->BinaryDirectory + fname).c_str());
       tcfg.SetExports(targets);
       tcfg.SetConfig(this->Makefile->GetSafeDefinition(
diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx
index dfb991b..94831f8 100644
--- a/Source/cmExportTryCompileFileGenerator.cxx
+++ b/Source/cmExportTryCompileFileGenerator.cxx
@@ -13,9 +13,16 @@
 #include "cmExportTryCompileFileGenerator.h"
 
 #include "cmGeneratedFileStream.h"
+#include "cmGlobalGenerator.h"
 #include "cmGeneratorExpressionDAGChecker.h"
 
 //----------------------------------------------------------------------------
+cmExportTryCompileFileGenerator::cmExportTryCompileFileGenerator(
+    cmGlobalGenerator* gg)
+{
+  gg->CreateGenerationObjects(cmGlobalGenerator::ImportedOnly);
+}
+
 bool cmExportTryCompileFileGenerator::GenerateMainFile(std::ostream& os)
 {
   std::set<cmTarget const*> emitted;
diff --git a/Source/cmExportTryCompileFileGenerator.h b/Source/cmExportTryCompileFileGenerator.h
index ec70d81..0d84896 100644
--- a/Source/cmExportTryCompileFileGenerator.h
+++ b/Source/cmExportTryCompileFileGenerator.h
@@ -20,6 +20,8 @@ class cmInstallTargetGenerator;
 class cmExportTryCompileFileGenerator: public cmExportFileGenerator
 {
 public:
+  cmExportTryCompileFileGenerator(cmGlobalGenerator* gg);
+
   /** Set the list of targets to export.  */
   void SetExports(const std::vector<cmTarget const*> &exports)
     { this->Exports = exports; }
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index daf794f..99263c1 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1170,11 +1170,11 @@ void cmGlobalGenerator::Configure()
 
 }
 
-void cmGlobalGenerator::CreateGenerationObjects()
+void cmGlobalGenerator::CreateGenerationObjects(TargetTypes targetTypes)
 {
   cmDeleteAll(this->GeneratorTargets);
   this->GeneratorTargets.clear();
-  this->CreateGeneratorTargets();
+  this->CreateGeneratorTargets(targetTypes);
 }
 
 cmExportBuildFileGenerator*
@@ -1477,18 +1477,22 @@ void cmGlobalGenerator::FinalizeTargetCompileInfo()
 }
 
 //----------------------------------------------------------------------------
-void cmGlobalGenerator::CreateGeneratorTargets(cmLocalGenerator *lg)
+void cmGlobalGenerator::CreateGeneratorTargets(TargetTypes targetTypes,
+                                               cmLocalGenerator *lg)
 {
   cmGeneratorTargetsType generatorTargets;
   cmMakefile* mf = lg->GetMakefile();
-  cmTargets& targets = mf->GetTargets();
-  for(cmTargets::iterator ti = targets.begin();
-      ti != targets.end(); ++ti)
+  if (targetTypes == AllTargets)
     {
-    cmTarget* t = &ti->second;
-    cmGeneratorTarget* gt = new cmGeneratorTarget(t, lg);
-    this->GeneratorTargets[t] = gt;
-    generatorTargets[t] = gt;
+    cmTargets& targets = mf->GetTargets();
+    for(cmTargets::iterator ti = targets.begin();
+        ti != targets.end(); ++ti)
+      {
+      cmTarget* t = &ti->second;
+      cmGeneratorTarget* gt = new cmGeneratorTarget(t, lg);
+      this->GeneratorTargets[t] = gt;
+      generatorTargets[t] = gt;
+      }
     }
 
   for(std::vector<cmTarget*>::const_iterator
@@ -1516,12 +1520,12 @@ void cmGlobalGenerator::InitGeneratorTargets()
 }
 
 //----------------------------------------------------------------------------
-void cmGlobalGenerator::CreateGeneratorTargets()
+void cmGlobalGenerator::CreateGeneratorTargets(TargetTypes targetTypes)
 {
   // Construct per-target generator information.
   for(unsigned int i=0; i < this->LocalGenerators.size(); ++i)
     {
-    this->CreateGeneratorTargets(this->LocalGenerators[i]);
+    this->CreateGeneratorTargets(targetTypes, this->LocalGenerators[i]);
     }
 }
 
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 95b0ef1..d486003 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -86,7 +86,13 @@ public:
    */
   virtual void Configure();
 
-  void CreateGenerationObjects();
+
+  enum TargetTypes {
+    AllTargets,
+    ImportedOnly
+  };
+
+  void CreateGenerationObjects(TargetTypes targetTypes = AllTargets);
 
   /**
    * Generate the all required files for building this project/tree. This
@@ -491,9 +497,9 @@ private:
   // Per-target generator information.
   cmGeneratorTargetsType GeneratorTargets;
   friend class cmake;
-  void CreateGeneratorTargets(cmLocalGenerator* lg);
+  void CreateGeneratorTargets(TargetTypes targetTypes, cmLocalGenerator* lg);
   void InitGeneratorTargets();
-  void CreateGeneratorTargets();
+  void CreateGeneratorTargets(TargetTypes targetTypes);
 
   void ClearGeneratorMembers();
 
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 7bf3832..fb9f123 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -483,7 +483,7 @@ bool cmake::FindPackage(const std::vector<std::string>& args)
     std::string linkPath;
     std::string flags;
     std::string linkFlags;
-    gg->CreateGeneratorTargets(lg.get());
+    gg->CreateGeneratorTargets(cmGlobalGenerator::AllTargets, lg.get());
     cmGeneratorTarget *gtgt = gg->GetGeneratorTarget(tgt);
     lg->GetTargetFlags(linkLibs, frameworkPath, linkPath, flags, linkFlags,
                        gtgt, false);

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3efb25a22bb887f92df8bbb6f819f29b09f17670
commit 3efb25a22bb887f92df8bbb6f819f29b09f17670
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Oct 6 18:30:43 2012 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jul 26 10:38:15 2015 +0200

    Move GetFullPath to cmGeneratorTarget

diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index 1f3046a..e63b44f 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -535,10 +535,13 @@ bool cmComputeLinkInformation::Compute()
         i != wrongItems.end(); ++i)
       {
       cmTarget const* tgt = *i;
+      cmGeneratorTarget *gtgt = tgt->GetMakefile()
+                                   ->GetGlobalGenerator()
+                                   ->GetGeneratorTarget(tgt);
       bool implib =
         (this->UseImportLibrary &&
          (tgt->GetType() == cmTarget::SHARED_LIBRARY));
-      std::string lib = tgt->GetFullPath(this->Config , implib, true);
+      std::string lib = gtgt->GetFullPath(this->Config , implib, true);
       this->OldLinkDirItems.push_back(lib);
       }
     }
@@ -637,6 +640,9 @@ void cmComputeLinkInformation::AddItem(std::string const& item,
 
   if(tgt && tgt->IsLinkable())
     {
+    cmGeneratorTarget *gtgt = tgt->GetMakefile()
+                                 ->GetGlobalGenerator()
+                                 ->GetGeneratorTarget(tgt);
     // This is a CMake target.  Ask the target for its real name.
     if(impexe && this->LoaderFlag)
       {
@@ -645,7 +651,8 @@ void cmComputeLinkInformation::AddItem(std::string const& item,
       // platform.  Add it now.
       std::string linkItem;
       linkItem = this->LoaderFlag;
-      std::string exe = tgt->GetFullPath(config, this->UseImportLibrary,
+
+      std::string exe = gtgt->GetFullPath(config, this->UseImportLibrary,
                                          true);
       linkItem += exe;
       this->Items.push_back(Item(linkItem, true, tgt));
@@ -666,7 +673,7 @@ void cmComputeLinkInformation::AddItem(std::string const& item,
          (impexe || tgt->GetType() == cmTarget::SHARED_LIBRARY));
 
       // Pass the full path to the target file.
-      std::string lib = tgt->GetFullPath(config, implib, true);
+      std::string lib = gtgt->GetFullPath(config, implib, true);
       if(!this->LinkDependsNoShared ||
          tgt->GetType() != cmTarget::SHARED_LIBRARY)
         {
@@ -755,7 +762,10 @@ void cmComputeLinkInformation::AddSharedDepItem(std::string const& item,
   std::string lib;
   if(tgt)
     {
-    lib = tgt->GetFullPath(this->Config, this->UseImportLibrary);
+    cmGeneratorTarget *gtgt = tgt->GetMakefile()
+                                 ->GetGlobalGenerator()
+                                 ->GetGeneratorTarget(tgt);
+    lib = gtgt->GetFullPath(this->Config, this->UseImportLibrary);
     this->AddLibraryRuntimeInfo(lib, tgt);
     }
   else
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index 568ce89..9ed2880 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -181,6 +181,9 @@ cmExportBuildFileGenerator
   // Get the makefile in which to lookup target information.
   cmMakefile* mf = target->GetMakefile();
 
+  cmGeneratorTarget* gtgt =
+      mf->GetGlobalGenerator()->GetGeneratorTarget(target);
+
   // Add the main target file.
   {
   std::string prop = "IMPORTED_LOCATION";
@@ -188,11 +191,11 @@ cmExportBuildFileGenerator
   std::string value;
   if(target->IsAppBundleOnApple())
     {
-    value = target->GetFullPath(config, false);
+    value = gtgt->GetFullPath(config, false);
     }
   else
     {
-    value = target->GetFullPath(config, false, true);
+    value = gtgt->GetFullPath(config, false, true);
     }
   properties[prop] = value;
   }
@@ -209,7 +212,7 @@ cmExportBuildFileGenerator
     {
     std::string prop = "IMPORTED_IMPLIB";
     prop += suffix;
-    std::string value = target->GetFullPath(config, true);
+    std::string value = gtgt->GetFullPath(config, true);
     target->GetImplibGNUtoMS(value, value,
                              "${CMAKE_IMPORT_LIBRARY_SUFFIX}");
     properties[prop] = value;
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index 90c82c2..3daa7b8 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -1556,7 +1556,7 @@ class ArtifactDirTag;
 template<typename ArtifactT>
 struct TargetFilesystemArtifactResultCreator
 {
-  static std::string Create(cmTarget* target,
+  static std::string Create(cmGeneratorTarget* target,
                             cmGeneratorExpressionContext *context,
                             const GeneratorExpressionContent *content);
 };
@@ -1565,12 +1565,12 @@ struct TargetFilesystemArtifactResultCreator
 template<>
 struct TargetFilesystemArtifactResultCreator<ArtifactSonameTag>
 {
-  static std::string Create(cmTarget* target,
+  static std::string Create(cmGeneratorTarget* target,
                             cmGeneratorExpressionContext *context,
                             const GeneratorExpressionContent *content)
   {
     // The target soname file (.so.1).
-    if(target->IsDLLPlatform())
+    if(target->Target->IsDLLPlatform())
       {
       ::reportError(context, content->GetOriginalExpression(),
                     "TARGET_SONAME_FILE is not allowed "
@@ -1584,9 +1584,9 @@ struct TargetFilesystemArtifactResultCreator<ArtifactSonameTag>
                     "SHARED libraries.");
       return std::string();
       }
-    std::string result = target->GetDirectory(context->Config);
+    std::string result = target->Target->GetDirectory(context->Config);
     result += "/";
-    result += target->GetSOName(context->Config);
+    result += target->Target->GetSOName(context->Config);
     return result;
   }
 };
@@ -1595,11 +1595,11 @@ struct TargetFilesystemArtifactResultCreator<ArtifactSonameTag>
 template<>
 struct TargetFilesystemArtifactResultCreator<ArtifactPdbTag>
 {
-  static std::string Create(cmTarget* target,
+  static std::string Create(cmGeneratorTarget* target,
                             cmGeneratorExpressionContext *context,
                             const GeneratorExpressionContent *content)
   {
-    std::string language = target->GetLinkerLanguage(context->Config);
+    std::string language = target->Target->GetLinkerLanguage(context->Config);
 
     std::string pdbSupportVar = "CMAKE_" + language + "_LINKER_SUPPORTS_PDB";
 
@@ -1610,7 +1610,7 @@ struct TargetFilesystemArtifactResultCreator<ArtifactPdbTag>
       return std::string();
       }
 
-    cmTarget::TargetType targetType = target->GetType();
+    cmTarget::TargetType targetType = target->Target->GetType();
 
     if(targetType != cmTarget::SHARED_LIBRARY &&
        targetType != cmTarget::MODULE_LIBRARY &&
@@ -1622,9 +1622,9 @@ struct TargetFilesystemArtifactResultCreator<ArtifactPdbTag>
       return std::string();
       }
 
-    std::string result = target->GetPDBDirectory(context->Config);
+    std::string result = target->Target->GetPDBDirectory(context->Config);
     result += "/";
-    result += target->GetPDBName(context->Config);
+    result += target->Target->GetPDBName(context->Config);
     return result;
   }
 };
@@ -1633,12 +1633,12 @@ struct TargetFilesystemArtifactResultCreator<ArtifactPdbTag>
 template<>
 struct TargetFilesystemArtifactResultCreator<ArtifactLinkerTag>
 {
-  static std::string Create(cmTarget* target,
+  static std::string Create(cmGeneratorTarget* target,
                             cmGeneratorExpressionContext *context,
                             const GeneratorExpressionContent *content)
   {
     // The file used to link to the target (.so, .lib, .a).
-    if(!target->IsLinkable())
+    if(!target->Target->IsLinkable())
       {
       ::reportError(context, content->GetOriginalExpression(),
                     "TARGET_LINKER_FILE is allowed only for libraries and "
@@ -1646,7 +1646,7 @@ struct TargetFilesystemArtifactResultCreator<ArtifactLinkerTag>
       return std::string();
       }
     return target->GetFullPath(context->Config,
-                               target->HasImportLibrary());
+                               target->Target->HasImportLibrary());
   }
 };
 
@@ -1654,7 +1654,7 @@ struct TargetFilesystemArtifactResultCreator<ArtifactLinkerTag>
 template<>
 struct TargetFilesystemArtifactResultCreator<ArtifactNameTag>
 {
-  static std::string Create(cmTarget* target,
+  static std::string Create(cmGeneratorTarget* target,
                             cmGeneratorExpressionContext *context,
                             const GeneratorExpressionContent *)
   {
@@ -1716,7 +1716,8 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode
                     "Expression syntax not recognized.");
       return std::string();
       }
-    cmTarget* target = context->Makefile->FindTargetToUse(name);
+    cmGeneratorTarget* target =
+        context->Makefile->FindGeneratorTargetToUse(name);
     if(!target)
       {
       ::reportError(context, content->GetOriginalExpression(),
@@ -1739,8 +1740,8 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode
                     "be used while evaluating link libraries");
       return std::string();
       }
-    context->DependTargets.insert(target);
-    context->AllTargets.insert(target);
+    context->DependTargets.insert(target->Target);
+    context->AllTargets.insert(target->Target);
 
     std::string result =
                 TargetFilesystemArtifactResultCreator<ArtifactT>::Create(
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index efb414e..edd89e8 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -529,7 +529,7 @@ const char* cmGeneratorTarget::GetLocation(const std::string& config) const
     }
   else
     {
-    location = this->Target->GetFullPath(config, false);
+    location = this->GetFullPath(config, false);
     }
   return location.c_str();
 }
@@ -1182,6 +1182,86 @@ void cmGeneratorTarget::GenerateTargetManifest(
     }
 }
 
+//----------------------------------------------------------------------------
+std::string cmGeneratorTarget::GetFullPath(const std::string& config,
+                                           bool implib, bool realname) const
+{
+  if(this->Target->IsImported())
+    {
+    return this->Target->ImportedGetFullPath(config, implib);
+    }
+  else
+    {
+    return this->NormalGetFullPath(config, implib, realname);
+    }
+}
+
+std::string cmGeneratorTarget::NormalGetFullPath(const std::string& config,
+                                                 bool implib,
+                                                 bool realname) const
+{
+  std::string fpath = this->Target->GetDirectory(config, implib);
+  fpath += "/";
+  if(this->Target->IsAppBundleOnApple())
+    {
+    fpath = this->Target->BuildMacContentDirectory(fpath, config, false);
+    fpath += "/";
+    }
+
+  // Add the full name of the target.
+  if(implib)
+    {
+    fpath += this->Target->GetFullName(config, true);
+    }
+  else if(realname)
+    {
+    fpath += this->NormalGetRealName(config);
+    }
+  else
+    {
+    fpath += this->Target->GetFullName(config, false);
+    }
+  return fpath;
+}
+
+//----------------------------------------------------------------------------
+std::string
+cmGeneratorTarget::NormalGetRealName(const std::string& config) const
+{
+  // This should not be called for imported targets.
+  // TODO: Split cmTarget into a class hierarchy to get compile-time
+  // enforcement of the limited imported target API.
+  if(this->Target->IsImported())
+    {
+    std::string msg =  "NormalGetRealName called on imported target: ";
+    msg += this->GetName();
+    this->Makefile->IssueMessage(cmake::INTERNAL_ERROR, msg);
+    }
+
+  if(this->GetType() == cmTarget::EXECUTABLE)
+    {
+    // Compute the real name that will be built.
+    std::string name;
+    std::string realName;
+    std::string impName;
+    std::string pdbName;
+    this->Target->GetExecutableNames(name, realName, impName, pdbName, config);
+    return realName;
+    }
+  else
+    {
+    // Compute the real name that will be built.
+    std::string name;
+    std::string soName;
+    std::string realName;
+    std::string impName;
+    std::string pdbName;
+    this->Target->GetLibraryNames(name, soName, realName,
+                                  impName, pdbName, config);
+    return realName;
+    }
+}
+
 bool cmStrictTargetComparison::operator()(cmTarget const* t1,
                                           cmTarget const* t2) const
 {
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 72c5706..a584c71 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -82,6 +82,14 @@ public:
   bool GetFeatureAsBool(const std::string& feature,
                         const std::string& config) const;
 
+  /** Get the full path to the target according to the settings in its
+      makefile and the configuration type.  */
+  std::string GetFullPath(const std::string& config="", bool implib = false,
+                          bool realname = false) const;
+  std::string NormalGetFullPath(const std::string& config, bool implib,
+                                bool realname) const;
+  std::string NormalGetRealName(const std::string& config) const;
+
   cmTarget* Target;
   cmMakefile* Makefile;
   cmLocalGenerator* LocalGenerator;
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index b88b8c8..d24cce8 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -910,10 +910,14 @@ cmGlobalNinjaGenerator
   case cmTarget::SHARED_LIBRARY:
   case cmTarget::STATIC_LIBRARY:
   case cmTarget::MODULE_LIBRARY:
+    {
+    cmGeneratorTarget *gtgt = target->GetMakefile()->GetLocalGenerator()
+                                    ->GetGlobalGenerator()
+                                    ->GetGeneratorTarget(target);
     outputs.push_back(ng->ConvertToNinjaPath(
-      target->GetFullPath(configName, false, realname)));
+      gtgt->GetFullPath(configName, false, realname)));
     break;
-
+    }
   case cmTarget::OBJECT_LIBRARY:
   case cmTarget::UTILITY: {
     std::string path = ng->ConvertToNinjaPath(
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 21075bb..c810550 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -3598,6 +3598,7 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
       {
       cmXCodeObject* target = *i;
       cmTarget* t =target->GetTarget();
+      cmGeneratorTarget *gt = this->GetGeneratorTarget(t);
 
       if(t->GetType() == cmTarget::EXECUTABLE ||
 // Nope - no post-build for OBJECT_LIRBRARY
@@ -3615,7 +3616,7 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
          t->GetType() == cmTarget::SHARED_LIBRARY ||
          t->GetType() == cmTarget::MODULE_LIBRARY)
         {
-        std::string tfull = t->GetFullPath(configName);
+        std::string tfull = gt->GetFullPath(configName);
         std::string trel = this->ConvertToRelativeForMake(tfull.c_str());
 
         // Add this target to the post-build phases of its dependencies.
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 9673415..53d0778 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -608,7 +608,7 @@ void cmLocalGenerator::AddBuildTargetRule(const std::string& llang,
     // Store this command line.
     commandLines.push_back(commandLine);
     }
-  std::string targetFullPath = target.Target->GetFullPath();
+  std::string targetFullPath = target.GetFullPath();
   // Generate a meaningful comment for the command.
   std::string comment = "Linking ";
   comment += llang;
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 5ef0b4f..0f82fb3 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -546,7 +546,7 @@ cmMakefileTargetGenerator
      this->Target->GetType() == cmTarget::MODULE_LIBRARY)
     {
     targetFullPathReal =
-      this->Target->GetFullPath(this->ConfigName, false, true);
+      this->GeneratorTarget->GetFullPath(this->ConfigName, false, true);
     targetFullPathPDB = this->Target->GetPDBDirectory(this->ConfigName);
     targetFullPathPDB += "/";
     targetFullPathPDB += this->Target->GetPDBName(this->ConfigName);
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index ea2816b..8ec6f5e 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -398,15 +398,16 @@ static int calculateCommandLineLengthLimit(int linkRuleLength)
 void cmNinjaNormalTargetGenerator::WriteLinkStatement()
 {
   cmTarget& target = *this->GetTarget();
+  cmGeneratorTarget& gt = *this->GetGeneratorTarget();
   const std::string cfgName = this->GetConfigName();
   std::string targetOutput = ConvertToNinjaPath(
-                               target.GetFullPath(cfgName));
+                               gt.GetFullPath(cfgName));
   std::string targetOutputReal = ConvertToNinjaPath(
-                                   target.GetFullPath(cfgName,
+                                   gt.GetFullPath(cfgName,
                                       /*implib=*/false,
                                       /*realpath=*/true));
   std::string targetOutputImplib = ConvertToNinjaPath(
-                                     target.GetFullPath(cfgName,
+                                     gt.GetFullPath(cfgName,
                                        /*implib=*/true));
 
   if (target.IsAppBundleOnApple())
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index d880cc0..2d10d29 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2918,7 +2918,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
         gg->CreateGenerationObjects();
         cmGeneratorTarget* gt = gg->GetGeneratorTarget(this);
         this->Properties.SetProperty(
-                prop, gt->Target->GetFullPath(configName, false).c_str());
+                prop, gt->GetFullPath(configName, false).c_str());
         }
       }
     // Support "<CONFIG>_LOCATION".
@@ -2942,7 +2942,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
           gg->CreateGenerationObjects();
           cmGeneratorTarget* gt = gg->GetGeneratorTarget(this);
           this->Properties.SetProperty(
-                  prop, gt->Target->GetFullPath(configName, false).c_str());
+                  prop, gt->GetFullPath(configName, false).c_str());
           }
         }
       }
@@ -3759,44 +3759,6 @@ bool cmTarget::IsImportedSharedLibWithoutSOName(
 }
 
 //----------------------------------------------------------------------------
-std::string cmTarget::NormalGetRealName(const std::string& config) const
-{
-  // This should not be called for imported targets.
-  // TODO: Split cmTarget into a class hierarchy to get compile-time
-  // enforcement of the limited imported target API.
-  if(this->IsImported())
-    {
-    std::string msg =  "NormalGetRealName called on imported target: ";
-    msg += this->GetName();
-    this->GetMakefile()->
-      IssueMessage(cmake::INTERNAL_ERROR,
-                   msg);
-    }
-
-  if(this->GetType() == cmTarget::EXECUTABLE)
-    {
-    // Compute the real name that will be built.
-    std::string name;
-    std::string realName;
-    std::string impName;
-    std::string pdbName;
-    this->GetExecutableNames(name, realName, impName, pdbName, config);
-    return realName;
-    }
-  else
-    {
-    // Compute the real name that will be built.
-    std::string name;
-    std::string soName;
-    std::string realName;
-    std::string impName;
-    std::string pdbName;
-    this->GetLibraryNames(name, soName, realName, impName, pdbName, config);
-    return realName;
-    }
-}
-
-//----------------------------------------------------------------------------
 std::string cmTarget::GetFullName(const std::string& config,
                                   bool implib) const
 {
@@ -3828,48 +3790,6 @@ void cmTarget::GetFullNameComponents(std::string& prefix, std::string& base,
 }
 
 //----------------------------------------------------------------------------
-std::string cmTarget::GetFullPath(const std::string& config, bool implib,
-                                  bool realname) const
-{
-  if(this->IsImported())
-    {
-    return this->ImportedGetFullPath(config, implib);
-    }
-  else
-    {
-    return this->NormalGetFullPath(config, implib, realname);
-    }
-}
-
-//----------------------------------------------------------------------------
-std::string cmTarget::NormalGetFullPath(const std::string& config,
-                                        bool implib, bool realname) const
-{
-  std::string fpath = this->GetDirectory(config, implib);
-  fpath += "/";
-  if(this->IsAppBundleOnApple())
-    {
-    fpath = this->BuildMacContentDirectory(fpath, config, false);
-    fpath += "/";
-    }
-
-  // Add the full name of the target.
-  if(implib)
-    {
-    fpath += this->GetFullName(config, true);
-    }
-  else if(realname)
-    {
-    fpath += this->NormalGetRealName(config);
-    }
-  else
-    {
-    fpath += this->GetFullName(config, false);
-    }
-  return fpath;
-}
-
-//----------------------------------------------------------------------------
 std::string
 cmTarget::ImportedGetFullPath(const std::string& config, bool implib) const
 {
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index eb0bf91..2a26a64 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -424,11 +424,6 @@ public:
       no soname at all.  */
   bool IsImportedSharedLibWithoutSOName(const std::string& config) const;
 
-  /** Get the full path to the target according to the settings in its
-      makefile and the configuration type.  */
-  std::string GetFullPath(const std::string& config="", bool implib = false,
-                          bool realname = false) const;
-
   /** Get the names of the library needed to generate a build rule
       that takes into account shared library version numbers.  This
       should be called only on a library target.  */
@@ -708,14 +703,6 @@ private:
 
   std::string ImportedGetFullPath(const std::string& config,
                                   bool implib) const;
-  std::string NormalGetFullPath(const std::string& config, bool implib,
-                                bool realname) const;
-
-  /** Get the real name of the target.  Allowed only for non-imported
-      targets.  When a library or executable file is versioned this is
-      the full versioned name.  If the target is not versioned this is
-      the same as GetFullName.  */
-  std::string NormalGetRealName(const std::string& config) const;
 
   /** Append to @a base the mac content directory and return it. */
   std::string BuildMacContentDirectory(const std::string& base,
diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx
index 65d3b6a..1815ade 100644
--- a/Source/cmTestGenerator.cxx
+++ b/Source/cmTestGenerator.cxx
@@ -82,7 +82,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
   // be translated.
   std::string exe = command[0];
   cmMakefile* mf = this->Test->GetMakefile();
-  cmTarget* target = mf->FindTargetToUse(exe);
+  cmGeneratorTarget* target = mf->FindGeneratorTargetToUse(exe);
   if(target && target->GetType() == cmTarget::EXECUTABLE)
     {
     // Use the target file on disk.

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=38a18e8a9d7e63a526117aaa2ac394035f38d5ec
commit 38a18e8a9d7e63a526117aaa2ac394035f38d5ec
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Mar 10 16:57:02 2014 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jul 26 10:38:15 2015 +0200

    Move GetLocationForBuild to cmGeneratorTarget.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 9fe7922..efb414e 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -540,6 +540,41 @@ bool cmGeneratorTarget::IsImported() const
 }
 
 //----------------------------------------------------------------------------
+const char* cmGeneratorTarget::GetLocationForBuild() const
+{
+  static std::string location;
+  if(this->IsImported())
+    {
+    location = this->Target->ImportedGetFullPath("", false);
+    return location.c_str();
+    }
+
+  // Now handle the deprecated build-time configuration location.
+  location = this->Target->GetDirectory();
+  const char* cfgid = this->Makefile->GetDefinition("CMAKE_CFG_INTDIR");
+  if(cfgid && strcmp(cfgid, ".") != 0)
+    {
+    location += "/";
+    location += cfgid;
+    }
+
+  if(this->Target->IsAppBundleOnApple())
+    {
+    std::string macdir = this->Target->BuildMacContentDirectory("", "",
+                                                                false);
+    if(!macdir.empty())
+      {
+      location += "/";
+      location += macdir;
+      }
+    }
+  location += "/";
+  location += this->Target->GetFullName("", false);
+  return location.c_str();
+}
+
+
+//----------------------------------------------------------------------------
 bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir,
                                               const std::string& config) const
 {
@@ -867,7 +902,7 @@ bool cmTargetTraceDependencies::IsUtility(std::string const& dep)
         {
         // This is really only for compatibility so we do not need to
         // worry about configuration names and output names.
-        std::string tLocation = t->Target->GetLocationForBuild();
+        std::string tLocation = t->GetLocationForBuild();
         tLocation = cmSystemTools::GetFilenamePath(tLocation);
         std::string depLocation = cmSystemTools::GetFilenamePath(dep);
         depLocation = cmSystemTools::CollapseFullPath(depLocation);
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 060007f..72c5706 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -31,6 +31,11 @@ public:
   bool IsImported() const;
   const char *GetLocation(const std::string& config) const;
 
+  /** Get the location of the target in the build tree with a placeholder
+      referencing the configuration in the native build system.  This
+      location is suitable for use as the LOCATION target property.  */
+  const char* GetLocationForBuild() const;
+
   int GetType() const;
   std::string GetName() const;
   const char *GetProperty(const std::string& prop) const;
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 9122daf..d880cc0 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2748,39 +2748,6 @@ const char* cmTarget::ImportedGetLocation(const std::string& config) const
 }
 
 //----------------------------------------------------------------------------
-const char* cmTarget::GetLocationForBuild() const
-{
-  static std::string location;
-  if(this->IsImported())
-    {
-    location = this->ImportedGetFullPath("", false);
-    return location.c_str();
-    }
-
-  // Now handle the deprecated build-time configuration location.
-  location = this->GetDirectory();
-  const char* cfgid = this->Makefile->GetDefinition("CMAKE_CFG_INTDIR");
-  if(cfgid && strcmp(cfgid, ".") != 0)
-    {
-    location += "/";
-    location += cfgid;
-    }
-
-  if(this->IsAppBundleOnApple())
-    {
-    std::string macdir = this->BuildMacContentDirectory("", "", false);
-    if(!macdir.empty())
-      {
-      location += "/";
-      location += macdir;
-      }
-    }
-  location += "/";
-  location += this->GetFullName("", false);
-  return location.c_str();
-}
-
-//----------------------------------------------------------------------------
 void cmTarget::GetTargetVersion(int& major, int& minor) const
 {
   int patch;
@@ -2922,8 +2889,11 @@ const char *cmTarget::GetProperty(const std::string& prop,
         // cannot take into account the per-configuration name of the
         // target because the configuration type may not be known at
         // CMake time.
-        this->Properties.SetProperty(
-                propLOCATION, this->GetLocationForBuild());
+        cmGlobalGenerator* gg = this->Makefile->GetGlobalGenerator();
+        gg->CreateGenerationObjects();
+        cmGeneratorTarget* gt = gg->GetGeneratorTarget(this);
+        this->Properties.SetProperty(propLOCATION,
+                                     gt->GetLocationForBuild());
         }
 
       }
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 4d419ee..eb0bf91 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -376,11 +376,6 @@ public:
 
   const char* ImportedGetLocation(const std::string& config) const;
 
-  /** Get the location of the target in the build tree with a placeholder
-      referencing the configuration in the native build system.  This
-      location is suitable for use as the LOCATION target property.  */
-  const char* GetLocationForBuild() const;
-
   /** Get the target major and minor version numbers interpreted from
       the VERSION property.  Version 0 is returned if the property is
       not set or cannot be parsed.  */

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3dcdb6b49646b518774e519d0d61a0cc0afbf93b
commit 3dcdb6b49646b518774e519d0d61a0cc0afbf93b
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Oct 28 19:47:46 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jul 26 10:38:14 2015 +0200

    Move GetLocation to cmGeneratorTarget.

diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index 16c64a7..61619ad 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -48,7 +48,7 @@ std::string cmCustomCommandGenerator::GetCommand(unsigned int c) const
      (target->Target->IsImported()
       || !this->LG->GetMakefile()->IsOn("CMAKE_CROSSCOMPILING")))
     {
-    return target->Target->GetLocation(this->Config);
+    return target->GetLocation(this->Config);
     }
   return this->GE->Parse(argv0)->Evaluate(this->LG->GetMakefile(), this->Config);
 }
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index 6d145a2..933a256 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -593,7 +593,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
       {
       cmGeneratorTarget* gt =
           this->GlobalGenerator->GetGeneratorTarget(target);
-      location = gt->Target->GetLocation(buildType);
+      location = gt->GetLocation(buildType);
       }
 
     fout<<"         <Option output=\"" << location
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index dc5a2a1..9fe7922 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -520,6 +520,26 @@ void cmGeneratorTarget
 }
 
 //----------------------------------------------------------------------------
+const char* cmGeneratorTarget::GetLocation(const std::string& config) const
+{
+  static std::string location;
+  if (this->Target->IsImported())
+    {
+    location = this->Target->ImportedGetFullPath(config, false);
+    }
+  else
+    {
+    location = this->Target->GetFullPath(config, false);
+    }
+  return location.c_str();
+}
+
+bool cmGeneratorTarget::IsImported() const
+{
+  return this->Target->IsImported();
+}
+
+//----------------------------------------------------------------------------
 bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir,
                                               const std::string& config) const
 {
@@ -834,7 +854,8 @@ bool cmTargetTraceDependencies::IsUtility(std::string const& dep)
     }
 
   // Check for a target with this name.
-  if(cmTarget* t = this->Makefile->FindTargetToUse(util))
+  if(cmGeneratorTarget* t
+                    = this->Makefile->FindGeneratorTargetToUse(util))
     {
     // If we find the target and the dep was given as a full path,
     // then make sure it was not a full path to something else, and
@@ -846,7 +867,7 @@ bool cmTargetTraceDependencies::IsUtility(std::string const& dep)
         {
         // This is really only for compatibility so we do not need to
         // worry about configuration names and output names.
-        std::string tLocation = t->GetLocationForBuild();
+        std::string tLocation = t->Target->GetLocationForBuild();
         tLocation = cmSystemTools::GetFilenamePath(tLocation);
         std::string depLocation = cmSystemTools::GetFilenamePath(dep);
         depLocation = cmSystemTools::CollapseFullPath(depLocation);
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 675ee9f..060007f 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -28,6 +28,9 @@ public:
 
   cmLocalGenerator* GetLocalGenerator() const;
 
+  bool IsImported() const;
+  const char *GetLocation(const std::string& config) const;
+
   int GetType() const;
   std::string GetName() const;
   const char *GetProperty(const std::string& prop) const;
diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx
index 6611c74..138ddbb 100644
--- a/Source/cmGlobalKdevelopGenerator.cxx
+++ b/Source/cmGlobalKdevelopGenerator.cxx
@@ -76,7 +76,7 @@ void cmGlobalKdevelopGenerator::Generate()
         {
         if (ti->second->GetType()==cmTarget::EXECUTABLE)
           {
-          executable = ti->second->Target->GetLocation("");
+          executable = ti->second->GetLocation("");
           break;
           }
         }
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 962d580..9673415 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1888,7 +1888,7 @@ bool cmLocalGenerator::GetRealDependency(const std::string& inName,
       if(target->GetType() >= cmTarget::EXECUTABLE &&
          target->GetType() <= cmTarget::MODULE_LIBRARY)
         {
-        tLocation = target->Target->GetLocation(config);
+        tLocation = target->GetLocation(config);
         tLocation = cmSystemTools::GetFilenamePath(tLocation);
         tLocation = cmSystemTools::CollapseFullPath(tLocation);
         }
@@ -1911,7 +1911,7 @@ bool cmLocalGenerator::GetRealDependency(const std::string& inName,
       case cmTarget::SHARED_LIBRARY:
       case cmTarget::MODULE_LIBRARY:
       case cmTarget::UNKNOWN_LIBRARY:
-        dep = target->Target->GetLocation(config);
+        dep = target->GetLocation(config);
         return true;
       case cmTarget::OBJECT_LIBRARY:
         // An object library has no single file on which to depend.
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index e4cd4f3..9122daf 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2739,21 +2739,6 @@ std::string cmTarget::GetCompilePDBDirectory(const std::string& config) const
 }
 
 //----------------------------------------------------------------------------
-const char* cmTarget::GetLocation(const std::string& config) const
-{
-  static std::string location;
-  if (this->IsImported())
-    {
-    location = this->ImportedGetFullPath(config, false);
-    }
-  else
-    {
-    location = this->GetFullPath(config, false);
-    }
-  return location.c_str();
-}
-
-//----------------------------------------------------------------------------
 const char* cmTarget::ImportedGetLocation(const std::string& config) const
 {
   static std::string location;
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index a0198e2..4d419ee 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -374,9 +374,6 @@ public:
       compiler pdb output directory is given.  */
   std::string GetCompilePDBDirectory(const std::string& config = "") const;
 
-  /** Get the location of the target in the build tree for the given
-      configuration.  */
-  const char* GetLocation(const std::string& config) const;
   const char* ImportedGetLocation(const std::string& config) const;
 
   /** Get the location of the target in the build tree with a placeholder

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1ded7c87e8a074dd708f9be03b2b26f36359b2c4
commit 1ded7c87e8a074dd708f9be03b2b26f36359b2c4
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jul 25 21:28:36 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jul 26 10:38:14 2015 +0200

    Always access target location from a cmGeneratorTarget instance.

diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index 211706b..16c64a7 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -42,12 +42,13 @@ unsigned int cmCustomCommandGenerator::GetNumberOfCommands() const
 std::string cmCustomCommandGenerator::GetCommand(unsigned int c) const
 {
   std::string const& argv0 = this->CC.GetCommandLines()[c][0];
-  cmTarget* target = this->LG->GetMakefile()->FindTargetToUse(argv0);
+  cmGeneratorTarget* target =
+      this->LG->GetMakefile()->FindGeneratorTargetToUse(argv0);
   if(target && target->GetType() == cmTarget::EXECUTABLE &&
-     (target->IsImported()
+     (target->Target->IsImported()
       || !this->LG->GetMakefile()->IsOn("CMAKE_CROSSCOMPILING")))
     {
-    return target->GetLocation(this->Config);
+    return target->Target->GetLocation(this->Config);
     }
   return this->GE->Parse(argv0)->Evaluate(this->LG->GetMakefile(), this->Config);
 }
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index a31e832..6d145a2 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -591,7 +591,9 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
       }
     else
       {
-      location = target->GetLocation(buildType);
+      cmGeneratorTarget* gt =
+          this->GlobalGenerator->GetGeneratorTarget(target);
+      location = gt->Target->GetLocation(buildType);
       }
 
     fout<<"         <Option output=\"" << location
diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx
index 98557cc..6611c74 100644
--- a/Source/cmGlobalKdevelopGenerator.cxx
+++ b/Source/cmGlobalKdevelopGenerator.cxx
@@ -70,13 +70,13 @@ void cmGlobalKdevelopGenerator::Generate()
          lg!=lgs.end(); lg++)
       {
       cmMakefile* makefile=(*lg)->GetMakefile();
-      cmTargets& targets=makefile->GetTargets();
-      for (cmTargets::iterator ti = targets.begin();
+      cmGeneratorTargetsType const& targets = makefile->GetGeneratorTargets();
+      for (cmGeneratorTargetsType::const_iterator ti = targets.begin();
            ti != targets.end(); ti++)
         {
-        if (ti->second.GetType()==cmTarget::EXECUTABLE)
+        if (ti->second->GetType()==cmTarget::EXECUTABLE)
           {
-          executable = ti->second.GetLocation("");
+          executable = ti->second->Target->GetLocation("");
           break;
           }
         }
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 25f33d7..962d580 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1877,7 +1877,8 @@ bool cmLocalGenerator::GetRealDependency(const std::string& inName,
     }
 
   // Look for a CMake target with the given name.
-  if(cmTarget* target = this->Makefile->FindTargetToUse(name))
+  if(cmGeneratorTarget* target =
+     this->Makefile->FindGeneratorTargetToUse(name))
     {
     // make sure it is not just a coincidence that the target name
     // found is part of the inName
@@ -1887,7 +1888,7 @@ bool cmLocalGenerator::GetRealDependency(const std::string& inName,
       if(target->GetType() >= cmTarget::EXECUTABLE &&
          target->GetType() <= cmTarget::MODULE_LIBRARY)
         {
-        tLocation = target->GetLocation(config);
+        tLocation = target->Target->GetLocation(config);
         tLocation = cmSystemTools::GetFilenamePath(tLocation);
         tLocation = cmSystemTools::CollapseFullPath(tLocation);
         }
@@ -1910,7 +1911,7 @@ bool cmLocalGenerator::GetRealDependency(const std::string& inName,
       case cmTarget::SHARED_LIBRARY:
       case cmTarget::MODULE_LIBRARY:
       case cmTarget::UNKNOWN_LIBRARY:
-        dep = target->GetLocation(config);
+        dep = target->Target->GetLocation(config);
         return true;
       case cmTarget::OBJECT_LIBRARY:
         // An object library has no single file on which to depend.

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1cb40f16678694bcdf17790894ae1ffdb7e469c5
commit 1cb40f16678694bcdf17790894ae1ffdb7e469c5
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Mar 10 14:42:27 2014 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jul 26 10:38:14 2015 +0200

    cmTarget: Restore the ImportedGetLocation method.
    
    It was removed in commit f154475b (cmTarget: Refactor GetLocation
    API, 2014-03-08), but it is more readable for targets we know are
    imported.

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index ae21561..979db91 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -809,7 +809,8 @@ void cmQtAutoGenerators::SetupAutoMocTarget(cmTarget const* target,
                           autogenTargetName.c_str());
       return;
       }
-    makefile->AddDefinition("_qt_moc_executable", qt5Moc->GetLocation(""));
+    makefile->AddDefinition("_qt_moc_executable",
+                            qt5Moc->ImportedGetLocation(""));
     }
   else if (strcmp(qtVersion, "4") == 0)
     {
@@ -820,7 +821,8 @@ void cmQtAutoGenerators::SetupAutoMocTarget(cmTarget const* target,
                           autogenTargetName.c_str());
       return;
       }
-    makefile->AddDefinition("_qt_moc_executable", qt4Moc->GetLocation(""));
+    makefile->AddDefinition("_qt_moc_executable",
+                            qt4Moc->ImportedGetLocation(""));
     }
   else
     {
@@ -967,7 +969,8 @@ void cmQtAutoGenerators::SetupAutoUicTarget(cmTarget const* target,
       }
     else
       {
-      makefile->AddDefinition("_qt_uic_executable", qt5Uic->GetLocation(""));
+      makefile->AddDefinition("_qt_uic_executable",
+                              qt5Uic->ImportedGetLocation(""));
       }
     }
   else if (strcmp(qtVersion, "4") == 0)
@@ -979,7 +982,8 @@ void cmQtAutoGenerators::SetupAutoUicTarget(cmTarget const* target,
                           targetName.c_str());
       return;
       }
-    makefile->AddDefinition("_qt_uic_executable", qt4Uic->GetLocation(""));
+    makefile->AddDefinition("_qt_uic_executable",
+                            qt4Uic->ImportedGetLocation(""));
     }
   else
     {
@@ -1171,7 +1175,7 @@ std::string cmQtAutoGenerators::GetRccExecutable(cmTarget const* target)
                           targetName.c_str());
       return std::string();
       }
-    return qt5Rcc->GetLocation("");
+    return qt5Rcc->ImportedGetLocation("");
     }
   else if (strcmp(qtVersion, "4") == 0)
     {
@@ -1182,7 +1186,7 @@ std::string cmQtAutoGenerators::GetRccExecutable(cmTarget const* target)
                           targetName.c_str());
       return std::string();
       }
-    return qt4Rcc->GetLocation("");
+    return qt4Rcc->ImportedGetLocation("");
     }
 
   cmSystemTools::Error("The CMAKE_AUTORCC feature supports only Qt 4 and "
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 295c862..e4cd4f3 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2754,6 +2754,15 @@ const char* cmTarget::GetLocation(const std::string& config) const
 }
 
 //----------------------------------------------------------------------------
+const char* cmTarget::ImportedGetLocation(const std::string& config) const
+{
+  static std::string location;
+  assert(this->IsImported());
+  location = this->ImportedGetFullPath(config, false);
+  return location.c_str();
+}
+
+//----------------------------------------------------------------------------
 const char* cmTarget::GetLocationForBuild() const
 {
   static std::string location;
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 1920312..a0198e2 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -377,6 +377,7 @@ public:
   /** Get the location of the target in the build tree for the given
       configuration.  */
   const char* GetLocation(const std::string& config) const;
+  const char* ImportedGetLocation(const std::string& config) const;
 
   /** Get the location of the target in the build tree with a placeholder
       referencing the configuration in the native build system.  This

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ecf15b4ff5562e37fc370f3c9f9244adc1b8e7af
commit ecf15b4ff5562e37fc370f3c9f9244adc1b8e7af
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jul 26 10:24:15 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jul 26 10:38:14 2015 +0200

    cmIncludeCommand: Populate the cmGeneratorTargets in deprecated path.

diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx
index b94ad25..8890e2b 100644
--- a/Source/cmIncludeCommand.cxx
+++ b/Source/cmIncludeCommand.cxx
@@ -125,6 +125,7 @@ bool cmIncludeCommand
         return false;
         }
       }
+    gg->CreateGenerationObjects();
     gg->GenerateImportFile(fname_abs);
     }
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e3e53b205b135a6b7d769a291003a63db655cbe9
commit e3e53b205b135a6b7d769a291003a63db655cbe9
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jul 25 21:10:31 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jul 26 10:38:14 2015 +0200

    cmTarget: Create cmGeneratorTargets before reading deprecated LOCATION.
    
    The intention is to move generation-semantic cmTarget API to cmGeneratorTarget
    and then use the latter for generator expressions.
    
    This means that each time we read a deprecated LOCATION property, we have to
    clear and re-populate the container.  That must be done each time because the
    result can change through the configure process, which is why this is
    deprecated in the first place.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 352b2de..295c862 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2950,8 +2950,11 @@ const char *cmTarget::GetProperty(const std::string& prop,
         }
       else
         {
+        cmGlobalGenerator* gg = this->Makefile->GetGlobalGenerator();
+        gg->CreateGenerationObjects();
+        cmGeneratorTarget* gt = gg->GetGeneratorTarget(this);
         this->Properties.SetProperty(
-                prop, this->GetFullPath(configName, false).c_str());
+                prop, gt->Target->GetFullPath(configName, false).c_str());
         }
       }
     // Support "<CONFIG>_LOCATION".
@@ -2971,8 +2974,11 @@ const char *cmTarget::GetProperty(const std::string& prop,
           }
         else
           {
+          cmGlobalGenerator* gg = this->Makefile->GetGlobalGenerator();
+          gg->CreateGenerationObjects();
+          cmGeneratorTarget* gt = gg->GetGeneratorTarget(this);
           this->Properties.SetProperty(
-                  prop, this->GetFullPath(configName, false).c_str());
+                  prop, gt->Target->GetFullPath(configName, false).c_str());
           }
         }
       }

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=74997f6f19ed6f2ffd6d9f2d4df41fb65bd70f12
commit 74997f6f19ed6f2ffd6d9f2d4df41fb65bd70f12
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jul 25 21:06:37 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jul 26 10:38:14 2015 +0200

    cmTarget: Inline GetLocation into deprecated callers.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index da57c4c..352b2de 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2917,11 +2917,21 @@ const char *cmTarget::GetProperty(const std::string& prop,
       // For an imported target this is the location of an arbitrary
       // available configuration.
       //
-      // For a non-imported target this is deprecated because it
-      // cannot take into account the per-configuration name of the
-      // target because the configuration type may not be known at
-      // CMake time.
-      this->Properties.SetProperty(propLOCATION, this->GetLocationForBuild());
+      if(this->IsImported())
+        {
+        this->Properties.SetProperty(
+                propLOCATION, this->ImportedGetFullPath("", false).c_str());
+        }
+      else
+        {
+        // For a non-imported target this is deprecated because it
+        // cannot take into account the per-configuration name of the
+        // target because the configuration type may not be known at
+        // CMake time.
+        this->Properties.SetProperty(
+                propLOCATION, this->GetLocationForBuild());
+        }
+
       }
 
     // Support "LOCATION_<CONFIG>".
@@ -2932,7 +2942,17 @@ const char *cmTarget::GetProperty(const std::string& prop,
         return 0;
         }
       const char* configName = prop.c_str() + 9;
-      this->Properties.SetProperty(prop, this->GetLocation(configName));
+
+      if (this->IsImported())
+        {
+        this->Properties.SetProperty(
+                prop, this->ImportedGetFullPath(configName, false).c_str());
+        }
+      else
+        {
+        this->Properties.SetProperty(
+                prop, this->GetFullPath(configName, false).c_str());
+        }
       }
     // Support "<CONFIG>_LOCATION".
     else if(cmHasLiteralSuffix(prop, "_LOCATION"))
@@ -2944,7 +2964,16 @@ const char *cmTarget::GetProperty(const std::string& prop,
           {
           return 0;
           }
-        this->Properties.SetProperty(prop, this->GetLocation(configName));
+        if (this->IsImported())
+          {
+          this->Properties.SetProperty(
+                  prop, this->ImportedGetFullPath(configName, false).c_str());
+          }
+        else
+          {
+          this->Properties.SetProperty(
+                  prop, this->GetFullPath(configName, false).c_str());
+          }
         }
       }
     }

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d94eb6bf40064f76266ea756855e82399d210444
commit d94eb6bf40064f76266ea756855e82399d210444
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jul 25 23:19:36 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jul 26 10:38:13 2015 +0200

    cmGlobalGenerator: Create cmGeneratorTargets before QtAutomoc.
    
    Add cmGeneratorTargets as needed in the QtAutomoc processing.

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 8b169c8..daf794f 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1234,13 +1234,14 @@ void cmGlobalGenerator::Generate()
 
   this->FinalizeTargetCompileInfo();
 
+  this->CreateGenerationObjects();
+
 #ifdef CMAKE_BUILD_WITH_CMAKE
   // Iterate through all targets and set up automoc for those which have
   // the AUTOMOC, AUTOUIC or AUTORCC property set
   AutogensType autogens;
   this->CreateQtAutoGeneratorsTargets(autogens);
 #endif
-  this->CreateGenerationObjects();
 
   unsigned int i;
 
@@ -1410,7 +1411,8 @@ void cmGlobalGenerator::CreateQtAutoGeneratorsTargets(AutogensType &autogens)
             && !target.IsImported())
           {
           cmQtAutoGenerators autogen;
-          if(autogen.InitializeAutogenTarget(&target))
+          if(autogen.InitializeAutogenTarget(this->LocalGenerators[i],
+                                             &target))
             {
             autogens.push_back(std::make_pair(autogen, &target));
             }
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 7d9bb4c..95b0ef1 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -300,6 +300,11 @@ public:
   /** Get per-target generator information.  */
   cmGeneratorTarget* GetGeneratorTarget(cmTarget const*) const;
 
+  void AddGeneratorTarget(cmTarget* t, cmGeneratorTarget* gt)
+  {
+    this->GeneratorTargets[t] = gt;
+  }
+
   const std::map<std::string, std::vector<cmLocalGenerator*> >& GetProjectMap()
                                                const {return this->ProjectMap;}
 
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 2fc4d78..f5cd74d 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -415,6 +415,10 @@ public:
     {
       this->GeneratorTargets = targets;
     }
+  void AddGeneratorTarget(cmTarget* t, cmGeneratorTarget* gt)
+  {
+    this->GeneratorTargets[t] = gt;
+  }
 
   cmTarget* FindTarget(const std::string& name,
                        bool excludeAliases = false) const;
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 58f4bf4..ae21561 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -287,7 +287,8 @@ std::string cmQtAutoGenerators::ListQt4RccInputs(cmSourceFile* sf,
   return entriesList;
 }
 
-bool cmQtAutoGenerators::InitializeAutogenTarget(cmTarget* target)
+bool cmQtAutoGenerators::InitializeAutogenTarget(cmLocalGenerator* lg,
+                                                 cmTarget* target)
 {
   cmMakefile* makefile = target->GetMakefile();
   // don't do anything if there is no Qt4 or Qt5Core (which contains moc):
@@ -474,6 +475,10 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmTarget* target)
                                 /*byproducts=*/rcc_output, depends,
                                 commandLines, false, autogenComment.c_str());
 
+    cmGeneratorTarget* gt = new cmGeneratorTarget(autogenTarget, lg);
+    lg->GetGlobalGenerator()->AddGeneratorTarget(autogenTarget, gt);
+    makefile->AddGeneratorTarget(autogenTarget, gt);
+
     // Set target folder
     const char* autogenFolder = makefile->GetState()
                                 ->GetGlobalProperty("AUTOMOC_TARGETS_FOLDER");
diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h
index 4c0fcbc..4f03348 100644
--- a/Source/cmQtAutoGenerators.h
+++ b/Source/cmQtAutoGenerators.h
@@ -18,6 +18,7 @@
 
 class cmGlobalGenerator;
 class cmMakefile;
+class cmLocalGenerator;
 
 class cmQtAutoGenerators
 {
@@ -25,7 +26,7 @@ public:
   cmQtAutoGenerators();
   bool Run(const std::string& targetDirectory, const std::string& config);
 
-  bool InitializeAutogenTarget(cmTarget* target);
+  bool InitializeAutogenTarget(cmLocalGenerator* lg, cmTarget* target);
   void SetupAutoGenerateTarget(cmTarget const* target);
   void SetupSourceFiles(cmTarget const* target);
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5144f70e01af28a63332f28cac878423ccebef29
commit 5144f70e01af28a63332f28cac878423ccebef29
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jul 25 20:58:55 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jul 26 10:38:13 2015 +0200

    cmGlobalGenerator: Create cmGeneratorTargets earlier.

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 48bb265..8b169c8 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1240,6 +1240,7 @@ void cmGlobalGenerator::Generate()
   AutogensType autogens;
   this->CreateQtAutoGeneratorsTargets(autogens);
 #endif
+  this->CreateGenerationObjects();
 
   unsigned int i;
 
@@ -1254,7 +1255,6 @@ void cmGlobalGenerator::Generate()
     this->LocalGenerators[i]->AddHelperCommands();
     }
 
-  this->CreateGenerationObjects();
   this->InitGeneratorTargets();
 
 #ifdef CMAKE_BUILD_WITH_CMAKE

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=981fe8f34bbfa11eaaf39a2f10fc6be1f25369b8
commit 981fe8f34bbfa11eaaf39a2f10fc6be1f25369b8
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jul 25 22:51:53 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jul 26 10:38:13 2015 +0200

    cmTarget: Use reliable test for CMP0024 and CMP0026 OLD.
    
    Check whether the Makefile is fully configured instead of checking
    whether generator targets exist.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 3d8adae..da57c4c 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -723,7 +723,7 @@ void cmTarget::GetSourceFiles(std::vector<std::string> &files,
 {
   assert(this->GetType() != INTERFACE_LIBRARY);
 
-  if (this->Makefile->GetGeneratorTargets().empty())
+  if (!this->Makefile->IsConfigured())
     {
     // At configure-time, this method can be called as part of getting the
     // LOCATION property or to export() a file to be include()d.  However
@@ -5249,7 +5249,7 @@ void cmTarget::GetLanguages(std::set<std::string>& languages,
 
   std::vector<cmTarget*> objectLibraries;
   std::vector<cmSourceFile const*> externalObjects;
-  if (this->Makefile->GetGeneratorTargets().empty())
+  if (!this->Makefile->IsConfigured())
     {
     this->GetObjectLibrariesCMP0026(objectLibraries);
     }

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6ecc3406215477d344df8b10543ae990586103a9
commit 6ecc3406215477d344df8b10543ae990586103a9
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jul 26 10:11:44 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jul 26 10:11:44 2015 +0200

    cmLocalGenerator: Remove CreateCustomTargetsAndCommands method.
    
    It loops over cmGeneratorTargets, but at the point it is called, there are no
    cmGeneratorTargets.  This must be dead code.

diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 7e4b470..25f33d7 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -626,48 +626,6 @@ void cmLocalGenerator::AddBuildTargetRule(const std::string& llang,
   target.Target->AddSource(targetFullPath);
 }
 
-
-void cmLocalGenerator
-::CreateCustomTargetsAndCommands(std::set<std::string> const& lang)
-{
-  cmGeneratorTargetsType tgts = this->Makefile->GetGeneratorTargets();
-  for(cmGeneratorTargetsType::iterator l = tgts.begin();
-      l != tgts.end(); l++)
-    {
-    if (l->first->IsImported())
-      {
-      continue;
-      }
-    cmGeneratorTarget& target = *l->second;
-    switch(target.GetType())
-      {
-      case cmTarget::STATIC_LIBRARY:
-      case cmTarget::SHARED_LIBRARY:
-      case cmTarget::MODULE_LIBRARY:
-      case cmTarget::EXECUTABLE:
-        {
-        std::string llang = target.Target->GetLinkerLanguage();
-        if(llang.empty())
-          {
-          cmSystemTools::Error
-            ("CMake can not determine linker language for target: ",
-             target.Target->GetName().c_str());
-          return;
-          }
-        // if the language is not in the set lang then create custom
-        // commands to build the target
-        if(lang.count(llang) == 0)
-          {
-          this->AddBuildTargetRule(llang, target);
-          }
-        }
-        break;
-      default:
-        break;
-      }
-    }
-}
-
 // List of variables that are replaced when
 // rules are expanced.  These variables are
 // replaced in the form <var> with GetSafeDefinition(var).
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 2dfe825..fee2420 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -338,12 +338,6 @@ protected:
                                       const std::string& lang,
                                       cmSourceFile& source,
                                       cmGeneratorTarget& target);
-  // Create Custom Targets and commands for unsupported languages
-  // The set passed in should contain the languages supported by the
-  // generator directly.  Any targets containing files that are not
-  // of the types listed will be compiled as custom commands and added
-  // to a custom target.
-  void CreateCustomTargetsAndCommands(std::set<std::string> const&);
 
   // Handle old-style install rules stored in the targets.
   void GenerateTargetInstallRules(
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index a26a1dd..9faee75 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -82,14 +82,6 @@ private:
   std::string Event;
 };
 
-void cmLocalVisualStudio6Generator::AddHelperCommands()
-{
-  std::set<std::string> lang;
-  lang.insert("C");
-  lang.insert("CXX");
-  this->CreateCustomTargetsAndCommands(lang);
-}
-
 void cmLocalVisualStudio6Generator::AddCMakeListsRules()
 {
   cmTargets &tgts = this->Makefile->GetTargets();
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 0e5e7a5..87d2c9f 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -68,15 +68,6 @@ cmLocalVisualStudio7Generator::~cmLocalVisualStudio7Generator()
 
 void cmLocalVisualStudio7Generator::AddHelperCommands()
 {
-  std::set<std::string> lang;
-  lang.insert("C");
-  lang.insert("CXX");
-  lang.insert("RC");
-  lang.insert("IDL");
-  lang.insert("DEF");
-  lang.insert("Fortran");
-  this->CreateCustomTargetsAndCommands(lang);
-
   // Now create GUIDs for targets
   cmTargets &tgts = this->Makefile->GetTargets();
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ce29c80d3d533e8b79d06ccadd880b0b0413e0fb
commit ce29c80d3d533e8b79d06ccadd880b0b0413e0fb
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jul 25 20:42:28 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jul 26 10:04:42 2015 +0200

    cmGlobalGenerator: Add global targets at the end of Configure.
    
    Rather than at the start of Generate.

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 8550d0d..48bb265 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1149,6 +1149,25 @@ void cmGlobalGenerator::Configure()
       }
     this->CMakeInstance->UpdateProgress(msg.str().c_str(), -1);
     }
+
+  unsigned int i;
+
+  // Put a copy of each global target in every directory.
+  cmTargets globalTargets;
+  this->CreateDefaultGlobalTargets(&globalTargets);
+
+  for (i = 0; i < this->LocalGenerators.size(); ++i)
+    {
+    cmMakefile* mf = this->LocalGenerators[i]->GetMakefile();
+    cmTargets* targets = &(mf->GetTargets());
+    cmTargets::iterator tit;
+    for ( tit = globalTargets.begin(); tit != globalTargets.end(); ++ tit )
+      {
+      (*targets)[tit->first] = tit->second;
+      (*targets)[tit->first].SetMakefile(mf);
+      }
+    }
+
 }
 
 void cmGlobalGenerator::CreateGenerationObjects()
@@ -1222,23 +1241,11 @@ void cmGlobalGenerator::Generate()
   this->CreateQtAutoGeneratorsTargets(autogens);
 #endif
 
-  // For each existing cmLocalGenerator
   unsigned int i;
 
-  // Put a copy of each global target in every directory.
-  cmTargets globalTargets;
-  this->CreateDefaultGlobalTargets(&globalTargets);
   for (i = 0; i < this->LocalGenerators.size(); ++i)
     {
     this->LocalGenerators[i]->ComputeObjectMaxPath();
-    cmMakefile* mf = this->LocalGenerators[i]->GetMakefile();
-    cmTargets* targets = &(mf->GetTargets());
-    cmTargets::iterator tit;
-    for ( tit = globalTargets.begin(); tit != globalTargets.end(); ++ tit )
-      {
-      (*targets)[tit->first] = tit->second;
-      (*targets)[tit->first].SetMakefile(mf);
-      }
     }
 
   // Add generator specific helper commands

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3123ffd3e1fb2651e49f247e932e30689e1a5a5f
commit 3123ffd3e1fb2651e49f247e932e30689e1a5a5f
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jul 25 20:00:27 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Jul 25 21:20:44 2015 +0200

    cmGlobalGenerator: Extract method to create generator objects.

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 45ef399..8550d0d 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1151,6 +1151,13 @@ void cmGlobalGenerator::Configure()
     }
 }
 
+void cmGlobalGenerator::CreateGenerationObjects()
+{
+  cmDeleteAll(this->GeneratorTargets);
+  this->GeneratorTargets.clear();
+  this->CreateGeneratorTargets();
+}
+
 cmExportBuildFileGenerator*
 cmGlobalGenerator::GetExportedTargetsFile(const std::string &filename) const
 {
@@ -1240,8 +1247,7 @@ void cmGlobalGenerator::Generate()
     this->LocalGenerators[i]->AddHelperCommands();
     }
 
-  // Create per-target generator information.
-  this->CreateGeneratorTargets();
+  this->CreateGenerationObjects();
   this->InitGeneratorTargets();
 
 #ifdef CMAKE_BUILD_WITH_CMAKE
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index b9a32bf..7d9bb4c 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -86,6 +86,8 @@ public:
    */
   virtual void Configure();
 
+  void CreateGenerationObjects();
+
   /**
    * Generate the all required files for building this project/tree. This
    * basically creates a series of LocalGenerators for each directory and

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e01ad8f59c84be5467677c81e2ce1b11b4f1d0f2
commit e01ad8f59c84be5467677c81e2ce1b11b4f1d0f2
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jul 25 19:58:20 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Jul 25 21:20:44 2015 +0200

    cmGlobalGenerator: Split creation of generator object from initialization.

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index fcb5998..45ef399 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1242,6 +1242,7 @@ void cmGlobalGenerator::Generate()
 
   // Create per-target generator information.
   this->CreateGeneratorTargets();
+  this->InitGeneratorTargets();
 
 #ifdef CMAKE_BUILD_WITH_CMAKE
   for (AutogensType::iterator it = autogens.begin(); it != autogens.end();
@@ -1471,7 +1472,6 @@ void cmGlobalGenerator::CreateGeneratorTargets(cmLocalGenerator *lg)
     {
     cmTarget* t = &ti->second;
     cmGeneratorTarget* gt = new cmGeneratorTarget(t, lg);
-    this->ComputeTargetObjectDirectory(gt);
     this->GeneratorTargets[t] = gt;
     generatorTargets[t] = gt;
     }
@@ -1488,6 +1488,19 @@ void cmGlobalGenerator::CreateGeneratorTargets(cmLocalGenerator *lg)
 }
 
 //----------------------------------------------------------------------------
+void cmGlobalGenerator::InitGeneratorTargets()
+{
+  for(cmGeneratorTargetsType::iterator ti =
+      this->GeneratorTargets.begin(); ti != this->GeneratorTargets.end(); ++ti)
+    {
+    if (!ti->second->Target->IsImported())
+      {
+      this->ComputeTargetObjectDirectory(ti->second);
+      }
+    }
+}
+
+//----------------------------------------------------------------------------
 void cmGlobalGenerator::CreateGeneratorTargets()
 {
   // Construct per-target generator information.
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 398335b..b9a32bf 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -485,6 +485,7 @@ private:
   cmGeneratorTargetsType GeneratorTargets;
   friend class cmake;
   void CreateGeneratorTargets(cmLocalGenerator* lg);
+  void InitGeneratorTargets();
   void CreateGeneratorTargets();
 
   void ClearGeneratorMembers();

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5dd3341b0f97257d1262118ea32eabc817e2e507
commit 5dd3341b0f97257d1262118ea32eabc817e2e507
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jul 25 17:55:34 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Jul 25 18:10:55 2015 +0200

    cmCPackPropertiesGenerator: Require cmLocalGenerator in API.

diff --git a/Source/cmCPackPropertiesGenerator.cxx b/Source/cmCPackPropertiesGenerator.cxx
index 368a0e6..cbcdd81 100644
--- a/Source/cmCPackPropertiesGenerator.cxx
+++ b/Source/cmCPackPropertiesGenerator.cxx
@@ -1,13 +1,14 @@
 #include "cmCPackPropertiesGenerator.h"
 
 #include "cmOutputConverter.h"
+#include "cmLocalGenerator.h"
 
 cmCPackPropertiesGenerator::cmCPackPropertiesGenerator(
-  cmMakefile* mf,
+  cmLocalGenerator* lg,
   cmInstalledFile const& installedFile,
   std::vector<std::string> const& configurations):
     cmScriptGenerator("CPACK_BUILD_CONFIG", configurations),
-    Makefile(mf),
+    LG(lg),
     InstalledFile(installedFile)
 {
   this->ActionsPerConfig = true;
@@ -17,7 +18,8 @@ void cmCPackPropertiesGenerator::GenerateScriptForConfig(std::ostream& os,
   const std::string& config, Indent const& indent)
 {
   std::string const& expandedFileName =
-      this->InstalledFile.GetNameExpression().Evaluate(this->Makefile, config);
+      this->InstalledFile.GetNameExpression().Evaluate(this->LG->GetMakefile(),
+                                                       config);
 
   cmInstalledFile::PropertyMapType const& properties =
     this->InstalledFile.GetProperties();
@@ -36,7 +38,7 @@ void cmCPackPropertiesGenerator::GenerateScriptForConfig(std::ostream& os,
       j = property.ValueExpressions.begin();
       j != property.ValueExpressions.end(); ++j)
       {
-      std::string value = (*j)->Evaluate(this->Makefile, config);
+      std::string value = (*j)->Evaluate(LG->GetMakefile(), config);
       os << " " << cmOutputConverter::EscapeForCMake(value);
       }
 
diff --git a/Source/cmCPackPropertiesGenerator.h b/Source/cmCPackPropertiesGenerator.h
index 71e2eaa..eec3df0 100644
--- a/Source/cmCPackPropertiesGenerator.h
+++ b/Source/cmCPackPropertiesGenerator.h
@@ -15,6 +15,8 @@
 #include "cmScriptGenerator.h"
 #include "cmInstalledFile.h"
 
+class cmLocalGenerator;
+
 /** \class cmCPackPropertiesGenerator
  * \brief Support class for generating CPackProperties.cmake.
  *
@@ -23,7 +25,7 @@ class cmCPackPropertiesGenerator: public cmScriptGenerator
 {
 public:
   cmCPackPropertiesGenerator(
-     cmMakefile* mf,
+     cmLocalGenerator* lg,
      cmInstalledFile const& installedFile,
      std::vector<std::string> const& configurations);
 
@@ -31,7 +33,7 @@ protected:
   virtual void GenerateScriptForConfig(std::ostream& os,
     const std::string& config, Indent const& indent);
 
-  cmMakefile* Makefile;
+  cmLocalGenerator* LG;
   cmInstalledFile const& InstalledFile;
 };
 
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 88ac0bc..fcb5998 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -3050,7 +3050,8 @@ bool cmGlobalGenerator::GenerateCPackPropertiesFile()
   cmake::InstalledFilesMap const& installedFiles =
     this->CMakeInstance->GetInstalledFiles();
 
-  cmMakefile* mf = this->LocalGenerators[0]->GetMakefile();
+  cmLocalGenerator* lg = this->LocalGenerators[0];
+  cmMakefile* mf = lg->GetMakefile();
 
   std::vector<std::string> configs;
   std::string config = mf->GetConfigurations(configs, false);
@@ -3072,7 +3073,7 @@ bool cmGlobalGenerator::GenerateCPackPropertiesFile()
     cmInstalledFile const& installedFile = i->second;
 
     cmCPackPropertiesGenerator cpackPropertiesGenerator(
-      mf, installedFile, configs);
+      lg, installedFile, configs);
 
     cpackPropertiesGenerator.Generate(file, config, configs);
     }

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3f99fd2daf1b9ac89419d6ddc37542eaf5b5b8e8
commit 3f99fd2daf1b9ac89419d6ddc37542eaf5b5b8e8
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jul 25 17:52:10 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Jul 25 18:10:23 2015 +0200

    cmCustomCommandGenerator: Require cmLocalGenerator in API.

diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index f654eb9..211706b 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -12,14 +12,15 @@
 #include "cmCustomCommandGenerator.h"
 
 #include "cmMakefile.h"
+#include "cmLocalGenerator.h"
 #include "cmCustomCommand.h"
 #include "cmOutputConverter.h"
 #include "cmGeneratorExpression.h"
 
 //----------------------------------------------------------------------------
 cmCustomCommandGenerator::cmCustomCommandGenerator(
-  cmCustomCommand const& cc, const std::string& config, cmMakefile* mf):
-  CC(cc), Config(config), Makefile(mf),
+  cmCustomCommand const& cc, const std::string& config, cmLocalGenerator* lg):
+  CC(cc), Config(config), LG(lg),
   OldStyle(cc.GetEscapeOldStyle()), MakeVars(cc.GetEscapeAllowMakeVars()),
   GE(new cmGeneratorExpression(cc.GetBacktrace())), DependsDone(false)
 {
@@ -41,13 +42,14 @@ unsigned int cmCustomCommandGenerator::GetNumberOfCommands() const
 std::string cmCustomCommandGenerator::GetCommand(unsigned int c) const
 {
   std::string const& argv0 = this->CC.GetCommandLines()[c][0];
-  cmTarget* target = this->Makefile->FindTargetToUse(argv0);
+  cmTarget* target = this->LG->GetMakefile()->FindTargetToUse(argv0);
   if(target && target->GetType() == cmTarget::EXECUTABLE &&
-     (target->IsImported() || !this->Makefile->IsOn("CMAKE_CROSSCOMPILING")))
+     (target->IsImported()
+      || !this->LG->GetMakefile()->IsOn("CMAKE_CROSSCOMPILING")))
     {
     return target->GetLocation(this->Config);
     }
-  return this->GE->Parse(argv0)->Evaluate(this->Makefile, this->Config);
+  return this->GE->Parse(argv0)->Evaluate(this->LG->GetMakefile(), this->Config);
 }
 
 //----------------------------------------------------------------------------
@@ -87,8 +89,9 @@ cmCustomCommandGenerator
   cmCustomCommandLine const& commandLine = this->CC.GetCommandLines()[c];
   for(unsigned int j=1;j < commandLine.size(); ++j)
     {
-    std::string arg = this->GE->Parse(commandLine[j])->Evaluate(this->Makefile,
-                                                               this->Config);
+    std::string arg =
+        this->GE->Parse(commandLine[j])->Evaluate(this->LG->GetMakefile(),
+                                                  this->Config);
     cmd += " ";
     if(this->OldStyle)
       {
@@ -96,7 +99,7 @@ cmCustomCommandGenerator
       }
     else
       {
-      cmOutputConverter converter(this->Makefile->GetStateSnapshot());
+      cmOutputConverter converter(this->LG->GetMakefile()->GetStateSnapshot());
       cmd += converter.EscapeForShell(arg, this->MakeVars);
       }
     }
@@ -141,7 +144,7 @@ std::vector<std::string> const& cmCustomCommandGenerator::GetDepends() const
                                               = this->GE->Parse(*i);
       std::vector<std::string> result;
       cmSystemTools::ExpandListArgument(
-                  cge->Evaluate(this->Makefile, this->Config), result);
+            cge->Evaluate(this->LG->GetMakefile(), this->Config), result);
       for (std::vector<std::string>::iterator it = result.begin();
           it != result.end(); ++it)
         {
diff --git a/Source/cmCustomCommandGenerator.h b/Source/cmCustomCommandGenerator.h
index 7ad95d1..a637fed 100644
--- a/Source/cmCustomCommandGenerator.h
+++ b/Source/cmCustomCommandGenerator.h
@@ -15,14 +15,14 @@
 #include "cmStandardIncludes.h"
 
 class cmCustomCommand;
-class cmMakefile;
+class cmLocalGenerator;
 class cmGeneratorExpression;
 
 class cmCustomCommandGenerator
 {
   cmCustomCommand const& CC;
   std::string Config;
-  cmMakefile* Makefile;
+  cmLocalGenerator* LG;
   bool OldStyle;
   bool MakeVars;
   cmGeneratorExpression* GE;
@@ -31,7 +31,7 @@ class cmCustomCommandGenerator
 public:
   cmCustomCommandGenerator(cmCustomCommand const& cc,
                            const std::string& config,
-                           cmMakefile* mf);
+                           cmLocalGenerator* lg);
   ~cmCustomCommandGenerator();
   cmCustomCommand const& GetCC() const { return this->CC; }
   unsigned int GetNumberOfCommands() const;
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index e6f7a43..dc5a2a1 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -938,7 +938,8 @@ void cmTargetTraceDependencies::FollowCommandDepends(cmCustomCommand const& cc,
                                               const std::string& config,
                                               std::set<std::string>& emitted)
 {
-  cmCustomCommandGenerator ccg(cc, config, this->Makefile);
+  cmCustomCommandGenerator ccg(cc, config,
+                               this->GeneratorTarget->LocalGenerator);
 
   const std::vector<std::string>& depends = ccg.GetDepends();
 
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index a293d06..9889bd4 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -404,7 +404,7 @@ cmLocalNinjaGenerator::WriteCustomCommandBuildStatement(
   if (this->GetGlobalNinjaGenerator()->SeenCustomCommand(cc))
     return;
 
-  cmCustomCommandGenerator ccg(*cc, this->GetConfigName(), this->Makefile);
+  cmCustomCommandGenerator ccg(*cc, this->GetConfigName(), this);
 
   const std::vector<std::string> &outputs = ccg.GetOutputs();
   const std::vector<std::string> &byproducts = ccg.GetByproducts();
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 077d4d9..de86c6b 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -1007,8 +1007,7 @@ cmLocalUnixMakefileGenerator3
   for(std::vector<cmCustomCommand>::const_iterator i = ccs.begin();
       i != ccs.end(); ++i)
     {
-    cmCustomCommandGenerator ccg(*i, this->ConfigName,
-                                 this->Makefile);
+    cmCustomCommandGenerator ccg(*i, this->ConfigName, this);
     this->AppendCustomDepend(depends, ccg);
     }
 }
@@ -1043,8 +1042,7 @@ cmLocalUnixMakefileGenerator3
   for(std::vector<cmCustomCommand>::const_iterator i = ccs.begin();
       i != ccs.end(); ++i)
     {
-    cmCustomCommandGenerator ccg(*i, this->ConfigName,
-                                 this->Makefile);
+    cmCustomCommandGenerator ccg(*i, this->ConfigName, this);
     this->AppendCustomCommand(commands, ccg, target, true, relative);
     }
 }
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 9cac5bd..5ef0b4f 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -167,7 +167,7 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
     {
     cmCustomCommandGenerator ccg(*(*si)->GetCustomCommand(),
                                  this->ConfigName,
-                                 this->Makefile);
+                                 this->LocalGenerator);
     this->GenerateCustomRuleFile(ccg);
     if (clean)
       {
@@ -1182,7 +1182,8 @@ cmMakefileTargetGenerator
     {
     if(cmCustomCommand* cc = (*source)->GetCustomCommand())
       {
-      cmCustomCommandGenerator ccg(*cc, this->ConfigName, this->Makefile);
+      cmCustomCommandGenerator ccg(*cc, this->ConfigName,
+                                   this->LocalGenerator);
       const std::vector<std::string>& outputs = ccg.GetOutputs();
       depends.insert(depends.end(), outputs.begin(), outputs.end());
       }
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 88da09b..ea2816b 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -608,7 +608,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
          ci = cmdLists[i]->begin();
          ci != cmdLists[i]->end(); ++ci)
       {
-      cmCustomCommandGenerator ccg(*ci, cfgName, mf);
+      cmCustomCommandGenerator ccg(*ci, cfgName, this->GetLocalGenerator());
       localGen.AppendCustomCommandLines(ccg, *cmdLineLists[i]);
       std::vector<std::string> const& ccByproducts = ccg.GetByproducts();
       std::transform(ccByproducts.begin(), ccByproducts.end(),
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 74f262c..1479d0b 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -509,7 +509,7 @@ cmNinjaTargetGenerator
     {
     cmCustomCommand const* cc = *cci;
     cmCustomCommandGenerator ccg(*cc, this->GetConfigName(),
-                                 this->GetMakefile());
+                                 this->GetLocalGenerator());
     const std::vector<std::string>& ccoutputs = ccg.GetOutputs();
     const std::vector<std::string>& ccbyproducts= ccg.GetByproducts();
     std::transform(ccoutputs.begin(), ccoutputs.end(),
diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx
index c3bf011..58b901a 100644
--- a/Source/cmNinjaUtilityTargetGenerator.cxx
+++ b/Source/cmNinjaUtilityTargetGenerator.cxx
@@ -44,7 +44,7 @@ void cmNinjaUtilityTargetGenerator::Generate()
     for (std::vector<cmCustomCommand>::const_iterator
          ci = cmdLists[i]->begin(); ci != cmdLists[i]->end(); ++ci) {
       cmCustomCommandGenerator ccg(*ci, this->GetConfigName(),
-                                   this->GetMakefile());
+                                   this->GetLocalGenerator());
       this->GetLocalGenerator()->AppendCustomCommandDeps(ccg, deps);
       this->GetLocalGenerator()->AppendCustomCommandLines(ccg, commands);
       std::vector<std::string> const& ccByproducts = ccg.GetByproducts();
@@ -65,7 +65,7 @@ void cmNinjaUtilityTargetGenerator::Generate()
     if(cmCustomCommand* cc = (*source)->GetCustomCommand())
       {
       cmCustomCommandGenerator ccg(*cc, this->GetConfigName(),
-                                   this->GetMakefile());
+                                   this->GetLocalGenerator());
       this->GetLocalGenerator()->AddCustomCommandTarget(cc, this->GetTarget());
 
       // Depend on all custom command outputs.

-----------------------------------------------------------------------

Summary of changes:
 Source/CMakeVersion.cmake                  |    2 +-
 Source/cmCPackPropertiesGenerator.cxx      |   10 +-
 Source/cmCPackPropertiesGenerator.h        |    6 +-
 Source/cmComputeLinkInformation.cxx        |   18 ++-
 Source/cmCoreTryCompile.cxx                |    2 +-
 Source/cmCustomCommandGenerator.cxx        |   22 ++--
 Source/cmCustomCommandGenerator.h          |    6 +-
 Source/cmExportBuildFileGenerator.cxx      |   37 +++---
 Source/cmExportBuildFileGenerator.h        |    4 +-
 Source/cmExportFileGenerator.cxx           |   37 +++---
 Source/cmExportFileGenerator.h             |    7 +-
 Source/cmExportInstallFileGenerator.cxx    |    6 +-
 Source/cmExportTryCompileFileGenerator.cxx |    7 ++
 Source/cmExportTryCompileFileGenerator.h   |    2 +
 Source/cmExtraCodeBlocksGenerator.cxx      |    4 +-
 Source/cmGeneratorExpressionNode.cxx       |   35 +++---
 Source/cmGeneratorTarget.cxx               |  141 +++++++++++++++++++++-
 Source/cmGeneratorTarget.h                 |   16 +++
 Source/cmGlobalGenerator.cxx               |   89 +++++++++-----
 Source/cmGlobalGenerator.h                 |   18 ++-
 Source/cmGlobalKdevelopGenerator.cxx       |    8 +-
 Source/cmGlobalNinjaGenerator.cxx          |    8 +-
 Source/cmGlobalXCodeGenerator.cxx          |    3 +-
 Source/cmIncludeCommand.cxx                |    1 +
 Source/cmLocalGenerator.cxx                |   47 +-------
 Source/cmLocalGenerator.h                  |    6 -
 Source/cmLocalNinjaGenerator.cxx           |    2 +-
 Source/cmLocalUnixMakefileGenerator3.cxx   |    6 +-
 Source/cmLocalVisualStudio6Generator.cxx   |    8 --
 Source/cmLocalVisualStudio7Generator.cxx   |    9 --
 Source/cmMakefile.h                        |    4 +
 Source/cmMakefileTargetGenerator.cxx       |    7 +-
 Source/cmNinjaNormalTargetGenerator.cxx    |    9 +-
 Source/cmNinjaTargetGenerator.cxx          |    2 +-
 Source/cmNinjaUtilityTargetGenerator.cxx   |    4 +-
 Source/cmQtAutoGenerators.cxx              |   23 ++--
 Source/cmQtAutoGenerators.h                |    3 +-
 Source/cmTarget.cxx                        |  181 ++++++++--------------------
 Source/cmTarget.h                          |   22 +---
 Source/cmTestGenerator.cxx                 |    2 +-
 Source/cmake.cxx                           |    2 +-
 41 files changed, 462 insertions(+), 364 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list