[Cmake-commits] CMake branch, next, updated. v3.3.0-1465-g3704f34

Stephen Kelly steveire at gmail.com
Mon Jul 27 15:59:54 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  3704f34f8a8132d1b4cbe6041bbd7a99494c4481 (commit)
       via  57f03e59ba92989aaf3600399f11ffb308cc663e (commit)
       via  57ab0f70b50e8c308f12248494fcc233e83210a4 (commit)
       via  570938cbfd132ad0e586327466109aad87c21ede (commit)
       via  ec38e4c84faa276e664f950b417a71c3901485f6 (commit)
       via  dfb025bf126080f6bb209f6f40ff909c4f5c5c97 (commit)
       via  9f2dca805c8010636d4be7ef03d96bfc131c9809 (commit)
       via  c7a8e74b8c7ade9efb68b8bd36fd6d741f2dba7e (commit)
       via  5b60eaf619baf4dfa2bc1a3f1109ff742a04f532 (commit)
       via  50b17a6112704ad3897b1ccc87a0061cf7949ee7 (commit)
       via  ba2668588213688243174a9cc8d7f034661b2a73 (commit)
       via  5ab3a946518870d0dbd1fe606d1bc89d336769c4 (commit)
       via  496f4cd07d20e91750ec920e05a4aef4e4bdc9ba (commit)
       via  de80993a2020e64259f12f608d11d1ace9a719a6 (commit)
       via  611220f77af9e2c5e174aa7ff9fa8bba982374ef (commit)
       via  bbad6ba53771dc77bfdf74bab7173374084d434c (commit)
       via  e4dc83ade5f8b44d44f21d3f90185bf0264e5d9d (commit)
       via  72f43fa13ddb544f84891f14619e622baf29ae38 (commit)
       via  58811998fb63975cc92abab23044630bc11cd26d (commit)
      from  c8d4d22f10318295eb55dbf65795d42c3443411d (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=3704f34f8a8132d1b4cbe6041bbd7a99494c4481
commit 3704f34f8a8132d1b4cbe6041bbd7a99494c4481
Merge: c8d4d22 57f03e5
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Jul 27 15:59:52 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Jul 27 15:59:52 2015 -0400

    Merge topic 'use-generator-target' into next
    
    57f03e59 Port some of the cmExportFileGenerator API to cmGeneratorTarget.
    57ab0f70 Port cmExportBuildFileGenerator to cmGeneratorTarget.
    570938cb cmExportTryCompileFileGenerator: Create cmGeneratorTargets.
    ec38e4c8 Move GetFullPath to cmGeneratorTarget
    dfb025bf Move GetLocationForBuild to cmGeneratorTarget.
    9f2dca80 Move GetLocation to cmGeneratorTarget.
    c7a8e74b Always access target location from a cmGeneratorTarget instance.
    5b60eaf6 cmTarget: Restore the ImportedGetLocation method.
    50b17a61 cmIncludeCommand: Populate the cmGeneratorTargets in deprecated path.
    ba266858 cmTarget: Create cmGeneratorTargets before reading deprecated LOCATION.
    5ab3a946 cmTarget: Inline GetLocation into deprecated callers.
    496f4cd0 cmGlobalGenerator: Create cmGeneratorTargets before QtAutomoc.
    de80993a cmGlobalGenerator: Create cmGeneratorTargets earlier.
    611220f7 cmTarget: Use reliable test for CMP0024 and CMP0026 OLD.
    bbad6ba5 cmLocalGenerator: Remove unused AddCustomCommandToCreateObject method.
    e4dc83ad cmLocalGenerator: Remove unused AddBuildTargetRule method.
    ...


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=57f03e59ba92989aaf3600399f11ffb308cc663e
commit 57f03e59ba92989aaf3600399f11ffb308cc663e
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Oct 6 17:51:07 2012 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jul 27 21:59:03 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..2f33200 100644
--- a/Source/cmExportFileGenerator.h
+++ b/Source/cmExportFileGenerator.h
@@ -92,13 +92,15 @@ 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 +150,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=57ab0f70b50e8c308f12248494fcc233e83210a4
commit 57ab0f70b50e8c308f12248494fcc233e83210a4
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Oct 6 17:44:17 2012 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jul 27 21:59:03 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=570938cbfd132ad0e586327466109aad87c21ede
commit 570938cbfd132ad0e586327466109aad87c21ede
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jul 25 20:44:35 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jul 27 21:59:03 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 a77a02a..2b7c1b2 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*
@@ -1485,18 +1485,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
@@ -1524,12 +1528,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=ec38e4c84faa276e664f950b417a71c3901485f6
commit ec38e4c84faa276e664f950b417a71c3901485f6
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Oct 6 18:30:43 2012 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jul 27 21:59:02 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 6e46bc0..ba5ff30 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/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=dfb025bf126080f6bb209f6f40ff909c4f5c5c97
commit dfb025bf126080f6bb209f6f40ff909c4f5c5c97
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Mar 10 16:57:02 2014 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jul 27 21:58:50 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=9f2dca805c8010636d4be7ef03d96bfc131c9809
commit 9f2dca805c8010636d4be7ef03d96bfc131c9809
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Oct 28 19:47:46 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jul 27 21:58:50 2015 +0200

    Move GetLocation to cmGeneratorTarget.

diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index 086c9f9..7f3b651 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 d6c8bae..2e20ee2 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1710,7 +1710,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);
         }
@@ -1733,7 +1733,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=c7a8e74b8c7ade9efb68b8bd36fd6d741f2dba7e
commit c7a8e74b8c7ade9efb68b8bd36fd6d741f2dba7e
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jul 25 21:28:36 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jul 27 21:58:50 2015 +0200

    Always access target location from a cmGeneratorTarget instance.

diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index 8483a91..086c9f9 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 91e37c4..d6c8bae 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1699,7 +1699,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
@@ -1709,7 +1710,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);
         }
@@ -1732,7 +1733,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=5b60eaf619baf4dfa2bc1a3f1109ff742a04f532
commit 5b60eaf619baf4dfa2bc1a3f1109ff742a04f532
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Mar 10 14:42:27 2014 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jul 27 21:58:50 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=50b17a6112704ad3897b1ccc87a0061cf7949ee7
commit 50b17a6112704ad3897b1ccc87a0061cf7949ee7
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jul 26 10:24:15 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jul 27 21:58:50 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=ba2668588213688243174a9cc8d7f034661b2a73
commit ba2668588213688243174a9cc8d7f034661b2a73
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jul 25 21:10:31 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jul 27 21:58:49 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=5ab3a946518870d0dbd1fe606d1bc89d336769c4
commit 5ab3a946518870d0dbd1fe606d1bc89d336769c4
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jul 25 21:06:37 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jul 27 21:58:49 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=496f4cd07d20e91750ec920e05a4aef4e4bdc9ba
commit 496f4cd07d20e91750ec920e05a4aef4e4bdc9ba
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jul 25 23:19:36 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jul 27 21:58:49 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 936ef74..a77a02a 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;
 
@@ -1414,7 +1415,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=de80993a2020e64259f12f608d11d1ace9a719a6
commit de80993a2020e64259f12f608d11d1ace9a719a6
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jul 25 20:58:55 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jul 27 21:58:49 2015 +0200

    cmGlobalGenerator: Create cmGeneratorTargets earlier.

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index f5ddd10..936ef74 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=611220f77af9e2c5e174aa7ff9fa8bba982374ef
commit 611220f77af9e2c5e174aa7ff9fa8bba982374ef
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jul 25 22:51:53 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jul 27 21:58:49 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=bbad6ba53771dc77bfdf74bab7173374084d434c
commit bbad6ba53771dc77bfdf74bab7173374084d434c
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Jul 27 20:58:28 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jul 27 21:58:48 2015 +0200

    cmLocalGenerator: Remove unused AddCustomCommandToCreateObject method.

diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index cce10ce..91e37c4 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -448,84 +448,6 @@ cmState::Snapshot cmLocalGenerator::GetStateSnapshot() const
   return this->StateSnapshot;
 }
 
-void cmLocalGenerator::AddCustomCommandToCreateObject(const char* ofname,
-                                                    const std::string& lang,
-                                                    cmSourceFile& source,
-                                                    cmGeneratorTarget& target)
-{
-  std::string objectDir = cmSystemTools::GetFilenamePath(std::string(ofname));
-  objectDir = this->Convert(objectDir,START_OUTPUT,SHELL);
-  std::string objectFile = this->Convert(ofname,START_OUTPUT,SHELL);
-  std::string sourceFile =
-      this->ConvertToOutputFormat(source.GetFullPath(), SHELL);
-  std::string varString = "CMAKE_";
-  varString += lang;
-  varString += "_COMPILE_OBJECT";
-  std::vector<std::string> rules;
-  rules.push_back(this->Makefile->GetRequiredDefinition(varString));
-  varString = "CMAKE_";
-  varString += lang;
-  varString += "_FLAGS";
-  std::string flags;
-  flags += this->Makefile->GetSafeDefinition(varString);
-  flags += " ";
-    {
-    std::vector<std::string> includes;
-    this->GetIncludeDirectories(includes, &target, lang);
-    flags += this->GetIncludeFlags(includes, &target, lang);
-    }
-  flags += this->Makefile->GetDefineFlags();
-
-  // Construct the command lines.
-  cmCustomCommandLines commandLines;
-  std::vector<std::string> commands;
-  cmSystemTools::ExpandList(rules, commands);
-  cmLocalGenerator::RuleVariables vars;
-  vars.Language = lang.c_str();
-  vars.Source = sourceFile.c_str();
-  vars.Object = objectFile.c_str();
-  vars.ObjectDir = objectDir.c_str();
-  vars.Flags = flags.c_str();
-  for(std::vector<std::string>::iterator i = commands.begin();
-      i != commands.end(); ++i)
-    {
-    // Expand the full command line string.
-    this->ExpandRuleVariables(*i, vars);
-
-    // Parse the string to get the custom command line.
-    cmCustomCommandLine commandLine;
-    std::vector<std::string> cmd = cmSystemTools::ParseArguments(i->c_str());
-    commandLine.insert(commandLine.end(), cmd.begin(), cmd.end());
-
-    // Store this command line.
-    commandLines.push_back(commandLine);
-    }
-
-  // Check for extra object-file dependencies.
-  std::vector<std::string> depends;
-  const char* additionalDeps = source.GetProperty("OBJECT_DEPENDS");
-  if(additionalDeps)
-    {
-    cmSystemTools::ExpandListArgument(additionalDeps, depends);
-    }
-
-  // Generate a meaningful comment for the command.
-  std::string comment = "Building ";
-  comment += lang;
-  comment += " object ";
-  comment += this->Convert(ofname, START_OUTPUT);
-
-  // Add the custom command to build the object file.
-  this->Makefile->AddCustomCommandToOutput(
-    ofname,
-    depends,
-    source.GetFullPath(),
-    commandLines,
-    comment.c_str(),
-    this->StateSnapshot.GetDirectory().GetCurrentBinary()
-    );
-}
-
 // 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 429d5fc..2971574 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -328,12 +328,6 @@ protected:
   void InsertRuleLauncher(std::string& s, cmTarget* target,
                           const std::string& prop);
 
-  ///! add a custom command to build a .o file that is part of a target
-  void AddCustomCommandToCreateObject(const char* ofname,
-                                      const std::string& lang,
-                                      cmSourceFile& source,
-                                      cmGeneratorTarget& target);
-
   // Handle old-style install rules stored in the targets.
   void GenerateTargetInstallRules(
     std::ostream& os, const std::string& config,

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e4dc83ade5f8b44d44f21d3f90185bf0264e5d9d
commit e4dc83ade5f8b44d44f21d3f90185bf0264e5d9d
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Jul 27 20:57:39 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jul 27 21:58:47 2015 +0200

    cmLocalGenerator: Remove unused AddBuildTargetRule method.

diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 25f33d7..cce10ce 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -526,106 +526,6 @@ void cmLocalGenerator::AddCustomCommandToCreateObject(const char* ofname,
     );
 }
 
-void cmLocalGenerator::AddBuildTargetRule(const std::string& llang,
-                                          cmGeneratorTarget& target)
-{
-  std::string objs;
-  std::vector<std::string> objVector;
-  std::string config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
-  // Add all the sources outputs to the depends of the target
-  std::vector<cmSourceFile*> classes;
-  target.GetSourceFiles(classes, config);
-  for(std::vector<cmSourceFile*>::const_iterator i = classes.begin();
-      i != classes.end(); ++i)
-    {
-    cmSourceFile* sf = *i;
-    if(!sf->GetCustomCommand() &&
-       !sf->GetPropertyAsBool("HEADER_FILE_ONLY") &&
-       !sf->GetPropertyAsBool("EXTERNAL_OBJECT"))
-      {
-      std::string dir_max;
-      dir_max += this->StateSnapshot.GetDirectory().GetCurrentBinary();
-      dir_max += "/";
-      std::string obj = this->GetObjectFileNameWithoutTarget(*sf, dir_max);
-      if(!obj.empty())
-        {
-        std::string ofname =
-            this->StateSnapshot.GetDirectory().GetCurrentBinary();
-        ofname += "/";
-        ofname += obj;
-        objVector.push_back(ofname);
-        this->AddCustomCommandToCreateObject(ofname.c_str(),
-                                             llang, *(*i), target);
-        objs += this->Convert(ofname,START_OUTPUT,SHELL);
-        objs += " ";
-        }
-      }
-    }
-  std::string createRule = target.GetCreateRuleVariable(llang, config);
-  bool useWatcomQuote = this->Makefile->IsOn(createRule+"_USE_WATCOM_QUOTE");
-  std::string targetName = target.Target->GetFullName();
-  // Executable :
-  // Shared Library:
-  // Static Library:
-  // Shared Module:
-  std::string linkLibs; // should be set
-  std::string frameworkPath;
-  std::string linkPath;
-  std::string flags; // should be set
-  std::string linkFlags; // should be set
-  this->GetTargetFlags(linkLibs, frameworkPath, linkPath, flags, linkFlags,
-                       &target, useWatcomQuote);
-  linkLibs = frameworkPath + linkPath + linkLibs;
-  cmLocalGenerator::RuleVariables vars;
-  vars.Language = llang.c_str();
-  vars.Objects = objs.c_str();
-  vars.ObjectDir = ".";
-  vars.Target = targetName.c_str();
-  vars.LinkLibraries = linkLibs.c_str();
-  vars.Flags = flags.c_str();
-  vars.LinkFlags = linkFlags.c_str();
-
-  std::string langFlags;
-  this->AddLanguageFlags(langFlags, llang, "");
-  this->AddArchitectureFlags(langFlags, &target, llang, "");
-  vars.LanguageCompileFlags = langFlags.c_str();
-
-  cmCustomCommandLines commandLines;
-  std::vector<std::string> rules;
-  rules.push_back(this->Makefile->GetRequiredDefinition(createRule));
-  std::vector<std::string> commands;
-  cmSystemTools::ExpandList(rules, commands);
-  for(std::vector<std::string>::iterator i = commands.begin();
-      i != commands.end(); ++i)
-    {
-    // Expand the full command line string.
-    this->ExpandRuleVariables(*i, vars);
-    // Parse the string to get the custom command line.
-    cmCustomCommandLine commandLine;
-    std::vector<std::string> cmd = cmSystemTools::ParseArguments(i->c_str());
-    commandLine.insert(commandLine.end(), cmd.begin(), cmd.end());
-
-    // Store this command line.
-    commandLines.push_back(commandLine);
-    }
-  std::string targetFullPath = target.Target->GetFullPath();
-  // Generate a meaningful comment for the command.
-  std::string comment = "Linking ";
-  comment += llang;
-  comment += " target ";
-  comment += this->Convert(targetFullPath, START_OUTPUT);
-  this->Makefile->AddCustomCommandToOutput(
-    targetFullPath,
-    objVector,
-    "",
-    commandLines,
-    comment.c_str(),
-    this->StateSnapshot.GetDirectory().GetCurrentBinary()
-    );
-  this->Makefile->GetSource(targetFullPath);
-  target.Target->AddSource(targetFullPath);
-}
-
 // 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 fee2420..429d5fc 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -328,11 +328,6 @@ protected:
   void InsertRuleLauncher(std::string& s, cmTarget* target,
                           const std::string& prop);
 
-
-  /** Convert a target to a utility target for unsupported
-   *  languages of a generator */
-  void AddBuildTargetRule(const std::string& llang,
-                          cmGeneratorTarget& target);
   ///! add a custom command to build a .o file that is part of a target
   void AddCustomCommandToCreateObject(const char* ofname,
                                       const std::string& lang,

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=72f43fa13ddb544f84891f14619e622baf29ae38
commit 72f43fa13ddb544f84891f14619e622baf29ae38
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jul 26 10:11:44 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jul 27 21:57:29 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 9263053..f1c8def 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/cmLocalVisualStudio6Generator.h b/Source/cmLocalVisualStudio6Generator.h
index 8f4d521..a44e61d 100644
--- a/Source/cmLocalVisualStudio6Generator.h
+++ b/Source/cmLocalVisualStudio6Generator.h
@@ -35,7 +35,6 @@ public:
 
   virtual ~cmLocalVisualStudio6Generator();
 
-  virtual void AddHelperCommands();
   virtual void AddCMakeListsRules();
 
   /**
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index bf82c87..f199a41 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=58811998fb63975cc92abab23044630bc11cd26d
commit 58811998fb63975cc92abab23044630bc11cd26d
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jul 25 20:42:28 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jul 27 21:57:28 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..f5ddd10 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
@@ -1384,6 +1391,10 @@ void cmGlobalGenerator::CreateQtAutoGeneratorsTargets(AutogensType &autogens)
     for(cmTargets::iterator ti = targets.begin();
         ti != targets.end(); ++ti)
       {
+      if (ti->second.GetType() == cmTarget::GLOBAL_TARGET)
+        {
+        continue;
+        }
       targetNames.push_back(ti->second.GetName());
       }
     for(std::vector<std::string>::iterator ti = targetNames.begin();
@@ -1432,6 +1443,10 @@ void cmGlobalGenerator::FinalizeTargetCompileInfo()
         ti != targets.end(); ++ti)
       {
       cmTarget* t = &ti->second;
+      if (t->GetType() == cmTarget::GLOBAL_TARGET)
+        {
+        continue;
+        }
 
       t->AppendBuildInterfaceIncludes();
 

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list