[Cmake-commits] CMake branch, next, updated. v3.4.0-rc2-885-g23a2ea9

Stephen Kelly steveire at gmail.com
Thu Oct 22 12:27:03 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  23a2ea9d7f1bf9e05462e78508cb4a8a5ab0d28c (commit)
       via  b579e955b411029e189c6f173884ee25be3c138c (commit)
       via  d67b9669fd1511a4bf8f9732c37e35f7d70c60ab (commit)
       via  8cb738cb008759bf5146822834130a466a0f74a1 (commit)
       via  d87154d0dc3881c81df8acad8275c629d48832f5 (commit)
       via  7b5508df640190bc6bbd8542de6ae5eeef4300a2 (commit)
       via  715a873cb5aed773241c28cfa24a490b105aca84 (commit)
       via  d02435b24edd127ff33f2eb9ea3075b2898ec057 (commit)
       via  7d88907a36306870673898a452cfa2ee77d3ea4d (commit)
       via  4ab54236e329f882a31081780645cd853ea90a63 (commit)
      from  01bd45b35341d83cc4f44c0976f14883817c0351 (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=23a2ea9d7f1bf9e05462e78508cb4a8a5ab0d28c
commit 23a2ea9d7f1bf9e05462e78508cb4a8a5ab0d28c
Merge: 01bd45b b579e95
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Oct 22 12:27:01 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Oct 22 12:27:01 2015 -0400

    Merge topic 'use-generator-target' into next
    
    b579e955 Graphviz: Port to cmGeneratorTarget.
    d67b9669 C::B: Port API to cmGeneratorTarget.
    8cb738cb GHS: Port to cmGeneratorTarget.
    d87154d0 Sublime: Port API to cmGeneratorTarget.
    7b5508df Xcode: Port API to cmGeneratorTarget.
    715a873c Xcode: Prefer to get target state from cmGeneratorTarget.
    d02435b2 Xcode: Re-order conditions.
    7d88907a Xcode: Port ForceLinkerLanguage to cmGeneratorTarget.
    4ab54236 Xcode: Port loops to cmGeneratorTarget.


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b579e955b411029e189c6f173884ee25be3c138c
commit b579e955b411029e189c6f173884ee25be3c138c
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 21 21:49:41 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 22 18:26:32 2015 +0200

    Graphviz: Port to cmGeneratorTarget.

diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx
index cc36c62..a63b6e3 100644
--- a/Source/cmGraphVizWriter.cxx
+++ b/Source/cmGraphVizWriter.cxx
@@ -17,7 +17,7 @@
 
 
 
-static const char* getShapeForTarget(const cmTarget* target)
+static const char* getShapeForTarget(const cmGeneratorTarget* target)
 {
   if (!target)
     {
@@ -163,7 +163,7 @@ void cmGraphVizWriter::WriteTargetDependersFiles(const char* fileName)
 
   this->CollectTargetsAndLibs();
 
-  for(std::map<std::string, const cmTarget*>::const_iterator ptrIt =
+  for(std::map<std::string, const cmGeneratorTarget*>::const_iterator ptrIt =
                                                       this->TargetPtrs.begin();
       ptrIt != this->TargetPtrs.end();
       ++ptrIt)
@@ -214,7 +214,7 @@ void cmGraphVizWriter::WritePerTargetFiles(const char* fileName)
 
   this->CollectTargetsAndLibs();
 
-  for(std::map<std::string, const cmTarget*>::const_iterator ptrIt =
+  for(std::map<std::string, const cmGeneratorTarget*>::const_iterator ptrIt =
                                                       this->TargetPtrs.begin();
       ptrIt != this->TargetPtrs.end();
       ++ptrIt)
@@ -268,7 +268,7 @@ void cmGraphVizWriter::WriteGlobalFile(const char* fileName)
   std::set<std::string> insertedConnections;
   std::set<std::string> insertedNodes;
 
-  for(std::map<std::string, const cmTarget*>::const_iterator ptrIt =
+  for(std::map<std::string, const cmGeneratorTarget*>::const_iterator ptrIt =
                                                       this->TargetPtrs.begin();
       ptrIt != this->TargetPtrs.end();
       ++ptrIt)
@@ -308,8 +308,8 @@ void cmGraphVizWriter::WriteConnections(const std::string& targetName,
                                     std::set<std::string>& insertedConnections,
                                     cmGeneratedFileStream& str) const
 {
-  std::map<std::string, const cmTarget* >::const_iterator targetPtrIt =
-                                             this->TargetPtrs.find(targetName);
+  std::map<std::string, const cmGeneratorTarget* >::const_iterator targetPtrIt
+      = this->TargetPtrs.find(targetName);
 
   if (targetPtrIt == this->TargetPtrs.end())  // not found at all
     {
@@ -327,7 +327,7 @@ void cmGraphVizWriter::WriteConnections(const std::string& targetName,
   std::string myNodeName = this->TargetNamesNodes.find(targetName)->second;
 
   const cmTarget::LinkLibraryVectorType* ll =
-                            &(targetPtrIt->second->GetOriginalLinkLibraries());
+      &(targetPtrIt->second->Target->GetOriginalLinkLibraries());
 
   for (cmTarget::LinkLibraryVectorType::const_iterator llit = ll->begin();
        llit != ll->end();
@@ -367,8 +367,8 @@ void cmGraphVizWriter::WriteDependerConnections(const std::string& targetName,
                                     std::set<std::string>& insertedConnections,
                                     cmGeneratedFileStream& str) const
 {
-  std::map<std::string, const cmTarget* >::const_iterator targetPtrIt =
-                                             this->TargetPtrs.find(targetName);
+  std::map<std::string, const cmGeneratorTarget* >::const_iterator targetPtrIt
+      = this->TargetPtrs.find(targetName);
 
   if (targetPtrIt == this->TargetPtrs.end())  // not found at all
     {
@@ -386,8 +386,8 @@ void cmGraphVizWriter::WriteDependerConnections(const std::string& targetName,
   std::string myNodeName = this->TargetNamesNodes.find(targetName)->second;
 
   // now search who links against me
-  for(std::map<std::string, const cmTarget*>::const_iterator dependerIt =
-                                                      this->TargetPtrs.begin();
+  for(std::map<std::string, const cmGeneratorTarget*>::const_iterator
+      dependerIt = this->TargetPtrs.begin();
       dependerIt != this->TargetPtrs.end();
       ++dependerIt)
     {
@@ -404,7 +404,7 @@ void cmGraphVizWriter::WriteDependerConnections(const std::string& targetName,
     // Now we have a target, check whether it links against targetName.
     // If so, draw a connection, and then continue with dependers on that one.
     const cmTarget::LinkLibraryVectorType* ll =
-                            &(dependerIt->second->GetOriginalLinkLibraries());
+        &(dependerIt->second->Target->GetOriginalLinkLibraries());
 
     for (cmTarget::LinkLibraryVectorType::const_iterator llit = ll->begin();
          llit != ll->end();
@@ -448,7 +448,7 @@ void cmGraphVizWriter::WriteDependerConnections(const std::string& targetName,
 
 
 void cmGraphVizWriter::WriteNode(const std::string& targetName,
-                                 const cmTarget* target,
+                                 const cmGeneratorTarget* target,
                                  std::set<std::string>& insertedNodes,
                                  cmGeneratedFileStream& str) const
 {
@@ -488,12 +488,11 @@ int cmGraphVizWriter::CollectAllTargets()
        lit != this->LocalGenerators.end();
        ++ lit )
     {
-    const cmTargets* targets = &((*lit)->GetMakefile()->GetTargets());
-    for ( cmTargets::const_iterator tit = targets->begin();
-          tit != targets->end();
-          ++ tit )
+    std::vector<cmGeneratorTarget*> targets = (*lit)->GetGeneratorTargets();
+    for ( std::vector<cmGeneratorTarget*>::const_iterator it =
+          targets.begin(); it != targets.end(); ++it )
       {
-      const char* realTargetName = tit->first.c_str();
+      const char* realTargetName = (*it)->GetName().c_str();
       if(this->IgnoreThisTarget(realTargetName))
         {
         // Skip ignored targets
@@ -503,7 +502,7 @@ int cmGraphVizWriter::CollectAllTargets()
       std::ostringstream ostr;
       ostr << this->GraphNodePrefix << cnt++;
       this->TargetNamesNodes[realTargetName] = ostr.str();
-      this->TargetPtrs[realTargetName] = &tit->second;
+      this->TargetPtrs[realTargetName] = *it;
       }
     }
 
@@ -519,19 +518,18 @@ int cmGraphVizWriter::CollectAllExternalLibs(int cnt)
        lit != this->LocalGenerators.end();
        ++ lit )
     {
-    const cmTargets* targets = &((*lit)->GetMakefile()->GetTargets());
-    for ( cmTargets::const_iterator tit = targets->begin();
-          tit != targets->end();
-          ++ tit )
+    std::vector<cmGeneratorTarget*> targets = (*lit)->GetGeneratorTargets();
+    for ( std::vector<cmGeneratorTarget*>::const_iterator it =
+          targets.begin(); it != targets.end(); ++it )
       {
-      const char* realTargetName = tit->first.c_str();
+      const char* realTargetName = (*it)->GetName().c_str();
       if (this->IgnoreThisTarget(realTargetName))
         {
         // Skip ignored targets
         continue;
         }
       const cmTarget::LinkLibraryVectorType* ll =
-                                     &(tit->second.GetOriginalLinkLibraries());
+          &((*it)->Target->GetOriginalLinkLibraries());
       for (cmTarget::LinkLibraryVectorType::const_iterator llit = ll->begin();
            llit != ll->end();
            ++ llit )
@@ -543,8 +541,8 @@ int cmGraphVizWriter::CollectAllExternalLibs(int cnt)
           continue;
           }
 
-        std::map<std::string, const cmTarget*>::const_iterator tarIt =
-                                                this->TargetPtrs.find(libName);
+        std::map<std::string, const cmGeneratorTarget*>::const_iterator tarIt
+            = this->TargetPtrs.find(libName);
         if ( tarIt == this->TargetPtrs.end() )
           {
           std::ostringstream ostr;
diff --git a/Source/cmGraphVizWriter.h b/Source/cmGraphVizWriter.h
index 0a20e6e..90d31d3 100644
--- a/Source/cmGraphVizWriter.h
+++ b/Source/cmGraphVizWriter.h
@@ -14,9 +14,9 @@
 #include "cmStandardIncludes.h"
 #include "cmLocalGenerator.h"
 #include "cmGeneratedFileStream.h"
-#include "cmTarget.h"
 #include <cmsys/RegularExpression.hxx>
 
+class cmGeneratorTarget;
 
 /** This class implements writing files for graphviz (dot) for graphs
  * representing the dependencies between the targets in the project. */
@@ -54,7 +54,8 @@ protected:
                                 std::set<std::string>& insertedConnections,
                                 cmGeneratedFileStream& str) const;
 
-  void WriteNode(const std::string& targetName, const cmTarget* target,
+  void WriteNode(const std::string& targetName,
+                 const cmGeneratorTarget* target,
                  std::set<std::string>& insertedNodes,
                  cmGeneratedFileStream& str) const;
 
@@ -73,7 +74,7 @@ protected:
 
   const std::vector<cmLocalGenerator*>& LocalGenerators;
 
-  std::map<std::string, const cmTarget*> TargetPtrs;
+  std::map<std::string, const cmGeneratorTarget*> TargetPtrs;
   // maps from the actual target names to node names in dot:
   std::map<std::string, std::string> TargetNamesNodes;
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d67b9669fd1511a4bf8f9732c37e35f7d70c60ab
commit d67b9669fd1511a4bf8f9732c37e35f7d70c60ab
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 21 21:38:24 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 22 18:26:32 2015 +0200

    C::B: Port API to cmGeneratorTarget.

diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index a71b1cb..597c9d8 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -17,7 +17,6 @@
 #include "cmake.h"
 #include "cmSourceFile.h"
 #include "cmGeneratedFileStream.h"
-#include "cmTarget.h"
 #include "cmSystemTools.h"
 #include "cmXMLSafe.h"
 
@@ -441,7 +440,7 @@ void cmExtraCodeBlocksGenerator
               }
 
             CbpUnit &cbpUnit = allFiles[fullPath];
-            cbpUnit.Targets.push_back((*ti)->Target);
+            cbpUnit.Targets.push_back(*ti);
             }
           }
         default:  // intended fallthrough
@@ -501,8 +500,9 @@ void cmExtraCodeBlocksGenerator
 
     fout<<"      <Unit filename=\""<< cmXMLSafe(unitFilename) <<"\">\n";
 
-    for(std::vector<const cmTarget*>::const_iterator ti = unit.Targets.begin();
-      ti != unit.Targets.end(); ++ti)
+    for(std::vector<const cmGeneratorTarget*>::const_iterator ti =
+        unit.Targets.begin();
+        ti != unit.Targets.end(); ++ti)
       {
       std::string const& targetName = (*ti)->GetName();
       fout<<"         <Option target=\""<< cmXMLSafe(targetName) <<"\"/>\n";
@@ -560,7 +560,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
   fout<<"      <Target title=\"" << targetName << "\">\n";
   if (target!=0)
     {
-    int cbTargetType = this->GetCBTargetType(target->Target);
+    int cbTargetType = this->GetCBTargetType(target);
     std::string workingDir = lg->GetCurrentBinaryDirectory();
     if ( target->GetType()==cmState::EXECUTABLE)
       {
@@ -718,7 +718,7 @@ std::string cmExtraCodeBlocksGenerator::GetCBCompilerId(const cmMakefile* mf)
 
 
 // Translate the cmake target type into the CodeBlocks target type id
-int cmExtraCodeBlocksGenerator::GetCBTargetType(cmTarget* target)
+int cmExtraCodeBlocksGenerator::GetCBTargetType(cmGeneratorTarget* target)
 {
   if ( target->GetType()==cmState::EXECUTABLE)
     {
diff --git a/Source/cmExtraCodeBlocksGenerator.h b/Source/cmExtraCodeBlocksGenerator.h
index f28809a..0c3846d 100644
--- a/Source/cmExtraCodeBlocksGenerator.h
+++ b/Source/cmExtraCodeBlocksGenerator.h
@@ -18,7 +18,6 @@
 class cmLocalGenerator;
 class cmMakefile;
 class cmGeneratorTarget;
-class cmTarget;
 class cmGeneratedFileStream;
 
 /** \class cmExtraCodeBlocksGenerator
@@ -42,7 +41,7 @@ public:
 private:
   struct CbpUnit
   {
-    std::vector<const cmTarget*> Targets;
+    std::vector<const cmGeneratorTarget*> Targets;
   };
 
   void CreateProjectFile(const std::vector<cmLocalGenerator*>& lgs);
@@ -53,7 +52,7 @@ private:
                                     cmGeneratorTarget* target) const;
 
   std::string GetCBCompilerId(const cmMakefile* mf);
-  int GetCBTargetType(cmTarget* target);
+  int GetCBTargetType(cmGeneratorTarget* target);
   std::string BuildMakeCommand(const std::string& make, const char* makefile,
                                const std::string& target);
   void AppendTarget(cmGeneratedFileStream& fout,

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8cb738cb008759bf5146822834130a466a0f74a1
commit 8cb738cb008759bf5146822834130a466a0f74a1
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 21 21:31:00 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 22 18:26:32 2015 +0200

    GHS: Port to cmGeneratorTarget.

diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 01e6f8c..12115be 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -22,23 +22,22 @@
 std::string const cmGhsMultiTargetGenerator::DDOption("-dynamic");
 
 cmGhsMultiTargetGenerator::cmGhsMultiTargetGenerator(cmGeneratorTarget *target)
-  : Target(target->Target)
-  , GeneratorTarget(target)
+  : GeneratorTarget(target)
   , LocalGenerator(static_cast<cmLocalGhsMultiGenerator *>(
                      target->GetLocalGenerator()))
   , Makefile(target->Target->GetMakefile())
   , TargetGroup(DetermineIfTargetGroup(target))
   , DynamicDownload(false)
 {
-  this->RelBuildFilePath = this->GetRelBuildFilePath(target->Target);
+  this->RelBuildFilePath = this->GetRelBuildFilePath(target);
 
   this->RelOutputFileName =
-    this->RelBuildFilePath + this->Target->GetName() + ".a";
+    this->RelBuildFilePath + target->GetName() + ".a";
 
   this->RelBuildFileName = this->RelBuildFilePath;
-  this->RelBuildFileName += this->GetBuildFileName(target->Target);
+  this->RelBuildFileName += this->GetBuildFileName(target);
 
-  std::string absPathToRoot = this->GetAbsPathToRoot(target->Target);
+  std::string absPathToRoot = this->GetAbsPathToRoot(target);
   absPathToRoot = this->AddSlashIfNeededToPath(absPathToRoot);
   this->AbsBuildFilePath = absPathToRoot + this->RelBuildFilePath;
   this->AbsBuildFileName = absPathToRoot + this->RelBuildFileName;
@@ -51,7 +50,8 @@ cmGhsMultiTargetGenerator::~cmGhsMultiTargetGenerator()
 }
 
 std::string
-cmGhsMultiTargetGenerator::GetRelBuildFilePath(const cmTarget *target)
+cmGhsMultiTargetGenerator::GetRelBuildFilePath(
+        const cmGeneratorTarget *target)
 {
   std::string output;
   char const *folderProp = target->GetProperty("FOLDER");
@@ -66,15 +66,13 @@ cmGhsMultiTargetGenerator::GetRelBuildFilePath(const cmTarget *target)
 }
 
 std::string
-cmGhsMultiTargetGenerator::GetAbsPathToRoot(const cmTarget *target)
+cmGhsMultiTargetGenerator::GetAbsPathToRoot(const cmGeneratorTarget *target)
 {
-  cmGeneratorTarget* gt = target->GetMakefile()->GetGlobalGenerator()
-      ->GetGeneratorTarget(target);
-  return gt->GetLocalGenerator()->GetBinaryDirectory();
+  return target->GetLocalGenerator()->GetBinaryDirectory();
 }
 
 std::string
-cmGhsMultiTargetGenerator::GetAbsBuildFilePath(const cmTarget *target)
+cmGhsMultiTargetGenerator::GetAbsBuildFilePath(const cmGeneratorTarget *target)
 {
   std::string output;
   output = cmGhsMultiTargetGenerator::GetAbsPathToRoot(target);
@@ -84,7 +82,7 @@ cmGhsMultiTargetGenerator::GetAbsBuildFilePath(const cmTarget *target)
 }
 
 std::string
-cmGhsMultiTargetGenerator::GetRelBuildFileName(const cmTarget *target)
+cmGhsMultiTargetGenerator::GetRelBuildFileName(const cmGeneratorTarget *target)
 {
   std::string output;
   output = cmGhsMultiTargetGenerator::GetRelBuildFilePath(target);
@@ -93,7 +91,8 @@ cmGhsMultiTargetGenerator::GetRelBuildFileName(const cmTarget *target)
   return  output;
 }
 
-std::string cmGhsMultiTargetGenerator::GetBuildFileName(const cmTarget *target)
+std::string
+cmGhsMultiTargetGenerator::GetBuildFileName(const cmGeneratorTarget *target)
 {
   std::string output;
   output = target->GetName();
@@ -161,7 +160,8 @@ void cmGhsMultiTargetGenerator::Generate()
 bool cmGhsMultiTargetGenerator::IncludeThisTarget()
 {
   bool output = true;
-  char const *excludeFromAll = this->Target->GetProperty("EXCLUDE_FROM_ALL");
+  char const *excludeFromAll =
+      this->GeneratorTarget->GetProperty("EXCLUDE_FROM_ALL");
   if (NULL != excludeFromAll && '1' == excludeFromAll[0] &&
       '\0' == excludeFromAll[1])
     {
@@ -367,13 +367,13 @@ void cmGhsMultiTargetGenerator::WriteTargetLinkLibraries()
   for (cmTargetDependSet::iterator tdsI = tds.begin(); tdsI != tds.end();
        ++tdsI)
     {
-    const cmTarget *tg = (*tdsI)->Target;
+    const cmGeneratorTarget *tg = *tdsI;
     *this->GetFolderBuildStreams() << "    -L\"" << GetAbsBuildFilePath(tg)
                                    << "\"" << std::endl;
     }
   // library targets
   cmTarget::LinkLibraryVectorType llv =
-    this->Target->GetOriginalLinkLibraries();
+    this->GeneratorTarget->Target->GetOriginalLinkLibraries();
   for (cmTarget::LinkLibraryVectorType::const_iterator llvI = llv.begin();
        llvI != llv.end(); ++llvI)
     {
@@ -391,10 +391,12 @@ void cmGhsMultiTargetGenerator::WriteTargetLinkLibraries()
 
 void cmGhsMultiTargetGenerator::WriteCustomCommands()
 {
-  WriteCustomCommandsHelper(this->Target->GetPreBuildCommands(),
-                            cmTarget::PRE_BUILD);
-  WriteCustomCommandsHelper(this->Target->GetPostBuildCommands(),
-                            cmTarget::POST_BUILD);
+  WriteCustomCommandsHelper(
+        this->GeneratorTarget->Target->GetPreBuildCommands(),
+        cmTarget::PRE_BUILD);
+  WriteCustomCommandsHelper(
+        this->GeneratorTarget->Target->GetPostBuildCommands(),
+        cmTarget::POST_BUILD);
 }
 
 void cmGhsMultiTargetGenerator::WriteCustomCommandsHelper(
@@ -518,7 +520,7 @@ cmGhsMultiTargetGenerator::GetOutputDirectory(const std::string &config) const
   std::string outputDir(AbsBuildFilePath);
 
   const char *runtimeOutputProp =
-    this->Target->GetProperty("RUNTIME_OUTPUT_DIRECTORY");
+    this->GeneratorTarget->GetProperty("RUNTIME_OUTPUT_DIRECTORY");
   if (NULL != runtimeOutputProp)
     {
     outputDir = runtimeOutputProp;
@@ -526,7 +528,8 @@ cmGhsMultiTargetGenerator::GetOutputDirectory(const std::string &config) const
 
   std::string configCapped(cmSystemTools::UpperCase(config));
   const char *runtimeOutputSProp =
-    this->Target->GetProperty("RUNTIME_OUTPUT_DIRECTORY_" + configCapped);
+    this->GeneratorTarget
+      ->GetProperty("RUNTIME_OUTPUT_DIRECTORY_" + configCapped);
   if (NULL != runtimeOutputSProp)
     {
     outputDir = runtimeOutputSProp;
@@ -544,9 +547,10 @@ cmGhsMultiTargetGenerator::GetOutputDirectory(const std::string &config) const
 std::string
 cmGhsMultiTargetGenerator::GetOutputFilename(const std::string &config) const
 {
-  std::string outputFilename(this->Target->GetName());
+  std::string outputFilename(this->GeneratorTarget->GetName());
 
-  const char *outputNameProp = this->Target->GetProperty("OUTPUT_NAME");
+  const char *outputNameProp =
+      this->GeneratorTarget->GetProperty("OUTPUT_NAME");
   if (NULL != outputNameProp)
     {
     outputFilename = outputNameProp;
@@ -554,7 +558,7 @@ cmGhsMultiTargetGenerator::GetOutputFilename(const std::string &config) const
 
   std::string configCapped(cmSystemTools::UpperCase(config));
   const char *outputNameSProp =
-    this->Target->GetProperty(configCapped + "_OUTPUT_NAME");
+    this->GeneratorTarget->GetProperty(configCapped + "_OUTPUT_NAME");
   if (NULL != outputNameSProp)
     {
     outputFilename = outputNameSProp;
diff --git a/Source/cmGhsMultiTargetGenerator.h b/Source/cmGhsMultiTargetGenerator.h
index d1c17f4..327fdef 100644
--- a/Source/cmGhsMultiTargetGenerator.h
+++ b/Source/cmGhsMultiTargetGenerator.h
@@ -54,11 +54,11 @@ public:
     return this->AbsOutputFileName.c_str();
   }
 
-  static std::string GetRelBuildFilePath(const cmTarget *target);
-  static std::string GetAbsPathToRoot(const cmTarget *target);
-  static std::string GetAbsBuildFilePath(const cmTarget *target);
-  static std::string GetRelBuildFileName(const cmTarget *target);
-  static std::string GetBuildFileName(const cmTarget *target);
+  static std::string GetRelBuildFilePath(const cmGeneratorTarget *target);
+  static std::string GetAbsPathToRoot(const cmGeneratorTarget *target);
+  static std::string GetAbsBuildFilePath(const cmGeneratorTarget *target);
+  static std::string GetRelBuildFileName(const cmGeneratorTarget *target);
+  static std::string GetBuildFileName(const cmGeneratorTarget *target);
   static std::string AddSlashIfNeededToPath(std::string const &input);
 
 private:
@@ -99,7 +99,6 @@ private:
   bool DetermineIfDynamicDownload(std::string const &config,
                                   const std::string &language);
 
-  cmTarget *Target;
   cmGeneratorTarget* GeneratorTarget;
   cmLocalGhsMultiGenerator *LocalGenerator;
   cmMakefile *Makefile;
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index 7c33904..1bcbd26 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -487,7 +487,7 @@ void cmGlobalGhsMultiGenerator::UpdateBuildFiles(
        tgtsI != tgts.end(); ++tgtsI)
     {
     const cmGeneratorTarget *tgt = *tgtsI;
-    if (IsTgtForBuild(tgt->Target))
+    if (IsTgtForBuild(tgt))
       {
       char const *rawFolderName = tgt->GetProperty("FOLDER");
       if (NULL == rawFolderName)
@@ -504,7 +504,7 @@ void cmGlobalGhsMultiGenerator::UpdateBuildFiles(
           GhsMultiGpj::PROJECT);
         }
       std::vector<cmsys::String> splitPath = cmSystemTools::SplitString(
-            cmGhsMultiTargetGenerator::GetRelBuildFileName(tgt->Target));
+            cmGhsMultiTargetGenerator::GetRelBuildFileName(tgt));
       std::string foldNameRelBuildFile(*(splitPath.end() - 2) + "/" +
                                        splitPath.back());
       *this->TargetFolderBuildStreams[folderName] << foldNameRelBuildFile
@@ -516,13 +516,12 @@ void cmGlobalGhsMultiGenerator::UpdateBuildFiles(
     }
 }
 
-bool cmGlobalGhsMultiGenerator::IsTgtForBuild(const cmTarget *tgt)
+bool cmGlobalGhsMultiGenerator::IsTgtForBuild(const cmGeneratorTarget *tgt)
 {
   const std::string config =
-    tgt->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE");
+    tgt->Target->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE");
   std::vector<cmSourceFile *> tgtSources;
-  cmGeneratorTarget* gt = this->GetGeneratorTarget(tgt);
-  gt->GetSourceFiles(tgtSources, config);
+  tgt->GetSourceFiles(tgtSources, config);
   bool tgtInBuild = true;
   char const *excludeFromAll = tgt->GetProperty("EXCLUDE_FROM_ALL");
   if (NULL != excludeFromAll && '1' == excludeFromAll[0] &&
diff --git a/Source/cmGlobalGhsMultiGenerator.h b/Source/cmGlobalGhsMultiGenerator.h
index 04a9a5b..480cd6a 100644
--- a/Source/cmGlobalGhsMultiGenerator.h
+++ b/Source/cmGlobalGhsMultiGenerator.h
@@ -111,7 +111,7 @@ private:
       GhsMultiGpj::Types projType);
   static std::string GetFileNameFromPath(std::string const &path);
   void UpdateBuildFiles(std::vector<cmGeneratorTarget*> tgts);
-  bool IsTgtForBuild(const cmTarget *tgt);
+  bool IsTgtForBuild(const cmGeneratorTarget *tgt);
 
   std::vector<cmGeneratedFileStream *> TargetSubProjects;
   std::map<std::string, cmGeneratedFileStream *> TargetFolderBuildStreams;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d87154d0dc3881c81df8acad8275c629d48832f5
commit d87154d0dc3881c81df8acad8275c629d48832f5
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Oct 18 23:53:26 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 22 18:26:32 2015 +0200

    Sublime: Port API to cmGeneratorTarget.

diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx
index 47822e8..92d38b9 100644
--- a/Source/cmExtraSublimeTextGenerator.cxx
+++ b/Source/cmExtraSublimeTextGenerator.cxx
@@ -20,7 +20,6 @@
 #include "cmMakefile.h"
 #include "cmSourceFile.h"
 #include "cmSystemTools.h"
-#include "cmTarget.h"
 
 #include <cmsys/SystemTools.hxx>
 
@@ -204,12 +203,12 @@ void cmExtraSublimeTextGenerator::
         case cmState::MODULE_LIBRARY:
         case cmState::OBJECT_LIBRARY:
           {
-          this->AppendTarget(fout, targetName, *lg, (*ti)->Target,
+          this->AppendTarget(fout, targetName, *lg, *ti,
                              make.c_str(), makefile, compiler.c_str(),
                              sourceFileFlags, false);
           std::string fastTarget = targetName;
           fastTarget += "/fast";
-          this->AppendTarget(fout, fastTarget, *lg, (*ti)->Target,
+          this->AppendTarget(fout, fastTarget, *lg, *ti,
                              make.c_str(), makefile, compiler.c_str(),
                              sourceFileFlags, false);
           }
@@ -225,7 +224,7 @@ void cmExtraSublimeTextGenerator::
   AppendTarget(cmGeneratedFileStream& fout,
                const std::string& targetName,
                cmLocalGenerator* lg,
-               cmTarget* target,
+               cmGeneratorTarget* target,
                const char* make,
                const cmMakefile* makefile,
                const char*, //compiler
@@ -235,10 +234,8 @@ void cmExtraSublimeTextGenerator::
 
   if (target != 0)
     {
-      cmGeneratorTarget *gtgt = this->GlobalGenerator
-                                    ->GetGeneratorTarget(target);
       std::vector<cmSourceFile*> sourceFiles;
-      gtgt->GetSourceFiles(sourceFiles,
+      target->GetSourceFiles(sourceFiles,
                              makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"));
       std::vector<cmSourceFile*>::const_iterator sourceFilesEnd =
         sourceFiles.end();
@@ -256,9 +253,9 @@ void cmExtraSublimeTextGenerator::
             }
           std::vector<std::string>& flags = sourceFileFlagsIter->second;
           std::string flagsString =
-            this->ComputeFlagsForObject(*iter, lg, gtgt);
+            this->ComputeFlagsForObject(*iter, lg, target);
           std::string definesString =
-            this->ComputeDefines(*iter, lg, gtgt);
+            this->ComputeDefines(*iter, lg, target);
           flags.clear();
           cmsys::RegularExpression flagRegex;
           // Regular expression to extract compiler flags from a string
diff --git a/Source/cmExtraSublimeTextGenerator.h b/Source/cmExtraSublimeTextGenerator.h
index 5dd1140..cf31ee0 100644
--- a/Source/cmExtraSublimeTextGenerator.h
+++ b/Source/cmExtraSublimeTextGenerator.h
@@ -18,7 +18,6 @@
 
 class cmLocalGenerator;
 class cmMakefile;
-class cmTarget;
 class cmGeneratedFileStream;
 class cmGeneratorTarget;
 
@@ -67,7 +66,7 @@ private:
   void AppendTarget(cmGeneratedFileStream& fout,
                     const std::string& targetName,
                     cmLocalGenerator* lg,
-                    cmTarget* target,
+                    cmGeneratorTarget* target,
                     const char* make,
                     const cmMakefile* makefile,
                     const char* compiler,

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7b5508df640190bc6bbd8542de6ae5eeef4300a2
commit 7b5508df640190bc6bbd8542de6ae5eeef4300a2
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Oct 19 21:23:29 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 22 18:26:31 2015 +0200

    Xcode: Port API to cmGeneratorTarget.

diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index a2d87ff..9111a3f 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -711,9 +711,9 @@ cmXCodeObject* cmGlobalXCodeGenerator
 
 //----------------------------------------------------------------------------
 std::string
-GetGroupMapKeyFromPath(cmTarget& cmtarget, const std::string& fullpath)
+GetGroupMapKeyFromPath(cmGeneratorTarget* target, const std::string& fullpath)
 {
-  std::string key(cmtarget.GetName());
+  std::string key(target->GetName());
   key += "-";
   key += fullpath;
   return key;
@@ -721,16 +721,16 @@ GetGroupMapKeyFromPath(cmTarget& cmtarget, const std::string& fullpath)
 
 //----------------------------------------------------------------------------
 std::string
-GetGroupMapKey(cmTarget& cmtarget, cmSourceFile* sf)
+GetGroupMapKey(cmGeneratorTarget* target, cmSourceFile* sf)
 {
-  return GetGroupMapKeyFromPath(cmtarget, sf->GetFullPath());
+  return GetGroupMapKeyFromPath(target, sf->GetFullPath());
 }
 
 //----------------------------------------------------------------------------
 cmXCodeObject*
 cmGlobalXCodeGenerator::CreateXCodeSourceFileFromPath(
   const std::string &fullpath,
-  cmTarget& cmtarget,
+  cmGeneratorTarget* target,
   const std::string &lang,
   cmSourceFile* sf)
 {
@@ -738,7 +738,7 @@ cmGlobalXCodeGenerator::CreateXCodeSourceFileFromPath(
   // fileRef object for any given full path.
   //
   cmXCodeObject* fileRef =
-    this->CreateXCodeFileReferenceFromPath(fullpath, cmtarget, lang, sf);
+    this->CreateXCodeFileReferenceFromPath(fullpath, target, lang, sf);
 
   cmXCodeObject* buildFile = this->CreateObject(cmXCodeObject::PBXBuildFile);
   buildFile->SetComment(fileRef->GetComment());
@@ -751,7 +751,7 @@ cmGlobalXCodeGenerator::CreateXCodeSourceFileFromPath(
 cmXCodeObject*
 cmGlobalXCodeGenerator::CreateXCodeSourceFile(cmLocalGenerator* lg,
                                               cmSourceFile* sf,
-                                              cmTarget& cmtarget)
+                                              cmGeneratorTarget* gtgt)
 {
   // Add flags from target and source file properties.
   std::string flags;
@@ -781,7 +781,7 @@ cmGlobalXCodeGenerator::CreateXCodeSourceFile(cmLocalGenerator* lg,
     this->CurrentLocalGenerator->GetSourceFileLanguage(*sf);
 
   cmXCodeObject* buildFile =
-    this->CreateXCodeSourceFileFromPath(sf->GetFullPath(), cmtarget, lang, sf);
+    this->CreateXCodeSourceFileFromPath(sf->GetFullPath(), gtgt, lang, sf);
   cmXCodeObject* fileRef = buildFile->GetObject("fileRef")->GetObject();
 
   cmXCodeObject* settings =
@@ -791,7 +791,6 @@ cmGlobalXCodeGenerator::CreateXCodeSourceFile(cmLocalGenerator* lg,
   // Is this a resource file in this target? Add it to the resources group...
   //
 
-  cmGeneratorTarget* gtgt = this->GetGeneratorTarget(&cmtarget);
   cmGeneratorTarget::SourceFileFlags tsFlags =
       gtgt->GetTargetSourceFileFlags(sf);
   bool isResource = tsFlags.Type == cmGeneratorTarget::SourceFileTypeResource;
@@ -926,11 +925,11 @@ GetSourcecodeValueFromFileExtension(const std::string& _ext,
 cmXCodeObject*
 cmGlobalXCodeGenerator::CreateXCodeFileReferenceFromPath(
   const std::string &fullpath,
-  cmTarget& cmtarget,
+  cmGeneratorTarget* target,
   const std::string &lang,
   cmSourceFile* sf)
 {
-  std::string key = GetGroupMapKeyFromPath(cmtarget, fullpath);
+  std::string key = GetGroupMapKeyFromPath(target, fullpath);
   cmXCodeObject* fileRef = this->FileRefs[key];
   if(!fileRef)
     {
@@ -1007,13 +1006,13 @@ cmGlobalXCodeGenerator::CreateXCodeFileReferenceFromPath(
 //----------------------------------------------------------------------------
 cmXCodeObject*
 cmGlobalXCodeGenerator::CreateXCodeFileReference(cmSourceFile* sf,
-                                                 cmTarget& cmtarget)
+                                                 cmGeneratorTarget* target)
 {
   std::string lang =
     this->CurrentLocalGenerator->GetSourceFileLanguage(*sf);
 
   return this->CreateXCodeFileReferenceFromPath(
-    sf->GetFullPath(), cmtarget, lang, sf);
+    sf->GetFullPath(), target, lang, sf);
 }
 
 //----------------------------------------------------------------------------
@@ -1100,7 +1099,6 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
       l != sortedTargets.end(); l++)
     {
     cmGeneratorTarget* gtgt = l->second;
-    cmTarget& cmtarget = *gtgt->Target;
 
     std::string targetName = gtgt->GetName();
 
@@ -1118,7 +1116,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
     if(gtgt->GetType() == cmState::UTILITY ||
        gtgt->GetType() == cmState::GLOBAL_TARGET)
       {
-      cmXCodeObject* t = this->CreateUtilityTarget(cmtarget);
+      cmXCodeObject* t = this->CreateUtilityTarget(gtgt);
       if (!t)
         {
         return false;
@@ -1146,7 +1144,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
       {
       cmXCodeObject* xsf =
         this->CreateXCodeSourceFile(this->CurrentLocalGenerator,
-                                    *i, cmtarget);
+                                    *i, gtgt);
       cmXCodeObject* fr = xsf->GetObject("fileRef");
       cmXCodeObject* filetype =
         fr->GetObject()->GetObject("explicitFileType");
@@ -1197,7 +1195,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
         {
         std::string obj = *oi;
         cmXCodeObject* xsf =
-          this->CreateXCodeSourceFileFromPath(obj, cmtarget, "", 0);
+          this->CreateXCodeSourceFileFromPath(obj, gtgt, "", 0);
         externalObjFiles.push_back(xsf);
         }
       }
@@ -1320,7 +1318,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
           {
           cmXCodeObject* xsf =
             this->CreateXCodeSourceFile(this->CurrentLocalGenerator,
-                                        *sfIt, cmtarget);
+                                        *sfIt, gtgt);
           buildFiles->AddObject(xsf);
           }
         contentBuildPhases.push_back(copyFilesBuildPhase);
@@ -1354,9 +1352,9 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
     this->CreateCustomCommands(buildPhases, sourceBuildPhase,
                                headerBuildPhase, resourceBuildPhase,
                                contentBuildPhases,
-                               frameworkBuildPhase, cmtarget);
+                               frameworkBuildPhase, gtgt);
 
-    targets.push_back(this->CreateXCodeTarget(cmtarget, buildPhases));
+    targets.push_back(this->CreateXCodeTarget(gtgt, buildPhases));
     }
   return true;
 }
@@ -1431,7 +1429,7 @@ bool cmGlobalXCodeGenerator::IsHeaderFile(cmSourceFile* sf)
 cmXCodeObject*
 cmGlobalXCodeGenerator::CreateBuildPhase(const char* name,
                                          const char* name2,
-                                         cmTarget& cmtarget,
+                                         cmGeneratorTarget* target,
                                          const std::vector<cmCustomCommand>&
                                          commands)
 {
@@ -1451,7 +1449,7 @@ cmGlobalXCodeGenerator::CreateBuildPhase(const char* name,
                            this->CreateString("0"));
   buildPhase->AddAttribute("shellPath",
                            this->CreateString("/bin/sh"));
-  this->AddCommandsToBuildPhase(buildPhase, cmtarget, commands,
+  this->AddCommandsToBuildPhase(buildPhase, target, commands,
                                 name2);
   return buildPhase;
 }
@@ -1468,16 +1466,14 @@ void cmGlobalXCodeGenerator::CreateCustomCommands(cmXCodeObject* buildPhases,
                                                   contentBuildPhases,
                                                   cmXCodeObject*
                                                   frameworkBuildPhase,
-                                                  cmTarget& cmtarget)
+                                                  cmGeneratorTarget* gtgt)
 {
   std::vector<cmCustomCommand> const & prebuild
-    = cmtarget.GetPreBuildCommands();
+    = gtgt->Target->GetPreBuildCommands();
   std::vector<cmCustomCommand> const & prelink
-    = cmtarget.GetPreLinkCommands();
+    = gtgt->Target->GetPreLinkCommands();
   std::vector<cmCustomCommand> postbuild
-    = cmtarget.GetPostBuildCommands();
-
-  cmGeneratorTarget* gtgt = this->GetGeneratorTarget(&cmtarget);
+    = gtgt->Target->GetPostBuildCommands();
 
   if(gtgt->GetType() == cmState::SHARED_LIBRARY &&
     !gtgt->IsFrameworkOnApple())
@@ -1530,19 +1526,19 @@ void cmGlobalXCodeGenerator::CreateCustomCommands(cmXCodeObject* buildPhases,
   cmXCodeObject* cmakeRulesBuildPhase =
     this->CreateBuildPhase("CMake Rules",
                            "cmakeRulesBuildPhase",
-                           cmtarget, commands);
+                           gtgt, commands);
   // create prebuild phase
   cmXCodeObject* preBuildPhase =
     this->CreateBuildPhase("CMake PreBuild Rules", "preBuildCommands",
-                           cmtarget, prebuild);
+                           gtgt, prebuild);
   // create prelink phase
   cmXCodeObject* preLinkPhase =
     this->CreateBuildPhase("CMake PreLink Rules", "preLinkCommands",
-                           cmtarget, prelink);
+                           gtgt, prelink);
   // create postbuild phase
   cmXCodeObject* postBuildPhase =
     this->CreateBuildPhase("CMake PostBuild Rules", "postBuildPhase",
-                           cmtarget, postbuild);
+                           gtgt, postbuild);
 
   // The order here is the order they will be built in.
   // The order "headers, resources, sources" mimics a native project generated
@@ -1625,7 +1621,7 @@ std::string cmGlobalXCodeGenerator::ExtractFlag(const char* flag,
 //----------------------------------------------------------------------------
 void
 cmGlobalXCodeGenerator::AddCommandsToBuildPhase(cmXCodeObject* buildphase,
-                                                cmTarget& target,
+                                                cmGeneratorTarget* target,
                                                 std::vector<cmCustomCommand>
                                                 const & commands,
                                                 const char* name)
@@ -1635,7 +1631,7 @@ cmGlobalXCodeGenerator::AddCommandsToBuildPhase(cmXCodeObject* buildphase,
   cmSystemTools::MakeDirectory(dir.c_str());
   std::string makefile = dir;
   makefile += "/";
-  makefile += target.GetName();
+  makefile += target->GetName();
   makefile += "_";
   makefile += name;
   makefile += ".make";
@@ -1669,7 +1665,7 @@ cmGlobalXCodeGenerator::AddCommandsToBuildPhase(cmXCodeObject* buildphase,
 //----------------------------------------------------------------------------
 void  cmGlobalXCodeGenerator
 ::CreateCustomRulesMakefile(const char* makefileBasename,
-                            cmTarget& target,
+                            cmGeneratorTarget* target,
                             std::vector<cmCustomCommand>
                             const & commands,
                             const std::string& configName)
@@ -1686,7 +1682,7 @@ void  cmGlobalXCodeGenerator
     }
   makefileStream.SetCopyIfDifferent(true);
   makefileStream << "# Generated by CMake, DO NOT EDIT\n";
-  makefileStream << "# Custom rules for " << target.GetName() << "\n";
+  makefileStream << "# Custom rules for " << target->GetName() << "\n";
 
   // disable the implicit rules
   makefileStream << ".SUFFIXES: " << "\n";
@@ -1715,7 +1711,7 @@ void  cmGlobalXCodeGenerator
         {
         std::ostringstream str;
         str << "_buildpart_" << count++ ;
-        tname[&ccg.GetCC()] = std::string(target.GetName()) + str.str();
+        tname[&ccg.GetCC()] = std::string(target->GetName()) + str.str();
         makefileStream << "\\\n\t" << tname[&ccg.GetCC()];
         }
       }
@@ -1793,11 +1789,10 @@ void  cmGlobalXCodeGenerator
 }
 
 //----------------------------------------------------------------------------
-void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
+void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
                                                 cmXCodeObject* buildSettings,
                                                 const std::string& configName)
 {
-  cmGeneratorTarget *gtgt = this->GetGeneratorTarget(&target);
   if(gtgt->GetType() == cmState::INTERFACE_LIBRARY)
     {
     return;
@@ -2020,7 +2015,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
     if(this->XcodeVersion >= 21)
       {
       std::string pncdir = this->GetObjectsNormalDirectory(
-        this->CurrentProject, configName, &target);
+        this->CurrentProject, configName, gtgt);
       buildSettings->AddAttribute("CONFIGURATION_BUILD_DIR",
                                   this->CreateString(pncdir.c_str()));
       }
@@ -2029,7 +2024,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
       buildSettings->AddAttribute("OBJROOT",
                                   this->CreateString(pndir.c_str()));
       pndir = this->GetObjectsNormalDirectory(
-        this->CurrentProject, configName, &target);
+        this->CurrentProject, configName, gtgt);
       }
     }
 
@@ -2067,7 +2062,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
         extraLinkOptions += " ";
         extraLinkOptions += createFlags;
         }
-      std::string plist = this->ComputeInfoPListLocation(target);
+      std::string plist = this->ComputeInfoPListLocation(gtgt);
       // Xcode will create the final version of Info.plist at build time,
       // so let it replace the cfbundle name. This avoids creating
       // a per-configuration Info.plist file. The cfbundle plist
@@ -2113,11 +2108,11 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
     {
     if(gtgt->GetPropertyAsBool("FRAMEWORK"))
       {
-      std::string fw_version = target.GetFrameworkVersion();
+      std::string fw_version = gtgt->Target->GetFrameworkVersion();
       buildSettings->AddAttribute("FRAMEWORK_VERSION",
                                   this->CreateString(fw_version.c_str()));
 
-      std::string plist = this->ComputeInfoPListLocation(target);
+      std::string plist = this->ComputeInfoPListLocation(gtgt);
       // Xcode will create the final version of Info.plist at build time,
       // so let it replace the framework name. This avoids creating
       // a per-configuration Info.plist file.
@@ -2160,7 +2155,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
     // Handle bundles and normal executables separately.
     if(gtgt->GetPropertyAsBool("MACOSX_BUNDLE"))
       {
-      std::string plist = this->ComputeInfoPListLocation(target);
+      std::string plist = this->ComputeInfoPListLocation(gtgt);
       // Xcode will create the final version of Info.plist at build time,
       // so let it replace the executable name.  This avoids creating
       // a per-configuration Info.plist file.
@@ -2400,7 +2395,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
       }
     }
 
-  buildSettings->AddAttribute(this->GetTargetLinkFlagsVar(target),
+  buildSettings->AddAttribute(this->GetTargetLinkFlagsVar(gtgt),
                               this->CreateString(extraLinkOptions.c_str()));
   buildSettings->AddAttribute("OTHER_REZFLAGS",
                               this->CreateString(""));
@@ -2459,7 +2454,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
   // put this last so it can override existing settings
   // Convert "XCODE_ATTRIBUTE_*" properties directly.
   {
-  cmPropertyMap const& props = target.GetProperties();
+  cmPropertyMap const& props = gtgt->Target->GetProperties();
   for(cmPropertyMap::const_iterator i = props.begin();
       i != props.end(); ++i)
     {
@@ -2508,9 +2503,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
 
 //----------------------------------------------------------------------------
 cmXCodeObject*
-cmGlobalXCodeGenerator::CreateUtilityTarget(cmTarget& cmtarget)
+cmGlobalXCodeGenerator::CreateUtilityTarget(cmGeneratorTarget* gtgt)
 {
-  cmGeneratorTarget* gtgt = this->GetGeneratorTarget(&cmtarget);
   cmXCodeObject* shellBuildPhase =
     this->CreateObject(cmXCodeObject::PBXShellScriptBuildPhase);
   shellBuildPhase->AddAttribute("buildActionMask",
@@ -2538,11 +2532,11 @@ cmGlobalXCodeGenerator::CreateUtilityTarget(cmTarget& cmtarget)
     this->CreateObject(cmXCodeObject::OBJECT_LIST);
   std::vector<cmXCodeObject*> emptyContentVector;
   this->CreateCustomCommands(buildPhases, 0, 0, 0, emptyContentVector, 0,
-                             cmtarget);
+                             gtgt);
   target->AddAttribute("buildPhases", buildPhases);
   if(this->XcodeVersion > 20)
     {
-    this->AddConfigurations(target, cmtarget);
+    this->AddConfigurations(target, gtgt);
     }
   else
     {
@@ -2550,7 +2544,7 @@ cmGlobalXCodeGenerator::CreateUtilityTarget(cmTarget& cmtarget)
       this->CurrentMakefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
     cmXCodeObject* buildSettings =
       this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP);
-    this->CreateBuildSettings(cmtarget, buildSettings, theConfig);
+    this->CreateBuildSettings(gtgt, buildSettings, theConfig);
     target->AddAttribute("buildSettings", buildSettings);
     }
   cmXCodeObject* dependencies =
@@ -2558,8 +2552,8 @@ cmGlobalXCodeGenerator::CreateUtilityTarget(cmTarget& cmtarget)
   target->AddAttribute("dependencies", dependencies);
   target->AddAttribute("name", this->CreateString(gtgt->GetName()));
   target->AddAttribute("productName",this->CreateString(gtgt->GetName()));
-  target->SetTarget(&cmtarget);
-  this->XCodeObjectMap[&cmtarget] = target;
+  target->SetTarget(gtgt);
+  this->XCodeObjectMap[gtgt] = target;
 
   // Add source files without build rules for editing convenience.
   if(gtgt->GetType() == cmState::UTILITY)
@@ -2575,7 +2569,7 @@ cmGlobalXCodeGenerator::CreateUtilityTarget(cmTarget& cmtarget)
       {
       if(!(*i)->GetPropertyAsBool("GENERATED"))
         {
-        this->CreateXCodeFileReference(*i, cmtarget);
+        this->CreateXCodeFileReference(*i, gtgt);
         }
       }
     }
@@ -2588,7 +2582,7 @@ cmGlobalXCodeGenerator::CreateUtilityTarget(cmTarget& cmtarget)
 
 //----------------------------------------------------------------------------
 std::string cmGlobalXCodeGenerator::AddConfigurations(cmXCodeObject* target,
-                                                      cmTarget& cmtarget)
+                                                      cmGeneratorTarget* gtgt)
 {
   std::string configTypes =
     this->CurrentMakefile->GetRequiredDefinition("CMAKE_CONFIGURATION_TYPES");
@@ -2604,7 +2598,7 @@ std::string cmGlobalXCodeGenerator::AddConfigurations(cmXCodeObject* target,
   std::string comment = "Build configuration list for ";
   comment += cmXCodeObject::PBXTypeNames[target->GetIsA()];
   comment += " \"";
-  comment += cmtarget.GetName();
+  comment += gtgt->GetName();
   comment += "\"";
   configlist->SetComment(comment.c_str());
   target->AddAttribute("buildConfigurationList",
@@ -2616,7 +2610,7 @@ std::string cmGlobalXCodeGenerator::AddConfigurations(cmXCodeObject* target,
     buildConfigurations->AddObject(config);
     cmXCodeObject* buildSettings =
       this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP);
-    this->CreateBuildSettings(cmtarget, buildSettings,
+    this->CreateBuildSettings(gtgt, buildSettings,
                               configVector[i].c_str());
     config->AddAttribute("name", this->CreateString(configVector[i].c_str()));
     config->SetComment(configVector[i].c_str());
@@ -2634,12 +2628,12 @@ std::string cmGlobalXCodeGenerator::AddConfigurations(cmXCodeObject* target,
 }
 
 //----------------------------------------------------------------------------
-const char*
-cmGlobalXCodeGenerator::GetTargetLinkFlagsVar(cmTarget const& cmtarget) const
+const char* cmGlobalXCodeGenerator::GetTargetLinkFlagsVar(
+    cmGeneratorTarget const* target) const
 {
   if(this->XcodeVersion >= 60 &&
-     (cmtarget.GetType() == cmState::STATIC_LIBRARY ||
-      cmtarget.GetType() == cmState::OBJECT_LIBRARY))
+     (target->GetType() == cmState::STATIC_LIBRARY ||
+      target->GetType() == cmState::OBJECT_LIBRARY))
     {
     return "OTHER_LIBTOOLFLAGS";
     }
@@ -2709,11 +2703,9 @@ const char* cmGlobalXCodeGenerator::GetTargetProductType(
 
 //----------------------------------------------------------------------------
 cmXCodeObject*
-cmGlobalXCodeGenerator::CreateXCodeTarget(cmTarget& cmtarget,
+cmGlobalXCodeGenerator::CreateXCodeTarget(cmGeneratorTarget* gtgt,
                                           cmXCodeObject* buildPhases)
 {
-  cmGeneratorTarget *gtgt = this->GetGeneratorTarget(&cmtarget);
-
   if(gtgt->GetType() == cmState::INTERFACE_LIBRARY)
     {
     return 0;
@@ -2726,14 +2718,14 @@ cmGlobalXCodeGenerator::CreateXCodeTarget(cmTarget& cmtarget,
   std::string defConfig;
   if(this->XcodeVersion > 20)
     {
-    defConfig = this->AddConfigurations(target, cmtarget);
+    defConfig = this->AddConfigurations(target, gtgt);
     }
   else
     {
     cmXCodeObject* buildSettings =
       this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP);
     defConfig = this->CurrentMakefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
-    this->CreateBuildSettings(cmtarget, buildSettings, defConfig.c_str());
+    this->CreateBuildSettings(gtgt, buildSettings, defConfig.c_str());
     target->AddAttribute("buildSettings", buildSettings);
     }
   cmXCodeObject* dependencies =
@@ -2770,22 +2762,23 @@ cmGlobalXCodeGenerator::CreateXCodeTarget(cmTarget& cmtarget,
     {
     target->AddAttribute("productType", this->CreateString(productType));
     }
-  target->SetTarget(&cmtarget);
-  this->XCodeObjectMap[&cmtarget] = target;
+  target->SetTarget(gtgt);
+  this->XCodeObjectMap[gtgt] = target;
   target->SetId(this->GetOrCreateId(
     gtgt->GetName(), target->GetId()).c_str());
   return target;
 }
 
 //----------------------------------------------------------------------------
-cmXCodeObject* cmGlobalXCodeGenerator::FindXCodeTarget(cmTarget const* t)
+cmXCodeObject*
+cmGlobalXCodeGenerator::FindXCodeTarget(cmGeneratorTarget const* t)
 {
   if(!t)
     {
     return 0;
     }
 
-  std::map<cmTarget const*, cmXCodeObject*>::const_iterator const i =
+  std::map<cmGeneratorTarget const*, cmXCodeObject*>::const_iterator const i =
     this->XCodeObjectMap.find(t);
   if (i == this->XCodeObjectMap.end())
     {
@@ -2922,8 +2915,7 @@ void cmGlobalXCodeGenerator
 void cmGlobalXCodeGenerator
 ::AddDependAndLinkInformation(cmXCodeObject* target)
 {
-  cmTarget* cmtarget = target->GetTarget();
-  cmGeneratorTarget* gt = this->GetGeneratorTarget(cmtarget);
+  cmGeneratorTarget* gt = target->GetTarget();
   if(!gt)
     {
     cmSystemTools::Error("Error no target on xobject\n");
@@ -2938,7 +2930,7 @@ void cmGlobalXCodeGenerator
   TargetDependSet const& deps = this->GetTargetDirectDepends(gt);
   for(TargetDependSet::const_iterator i = deps.begin(); i != deps.end(); ++i)
     {
-    if(cmXCodeObject* dptarget = this->FindXCodeTarget((*i)->Target))
+    if(cmXCodeObject* dptarget = this->FindXCodeTarget(*i))
       {
       this->AddDependTarget(target, dptarget);
       }
@@ -2967,7 +2959,7 @@ void cmGlobalXCodeGenerator
         linkObjs += this->XCodeEscapePath(oi->c_str());
         }
       this->AppendBuildSettingAttribute(
-        target, this->GetTargetLinkFlagsVar(*cmtarget),
+        target, this->GetTargetLinkFlagsVar(gt),
         linkObjs.c_str(), configName);
       }
 
@@ -3047,7 +3039,7 @@ void cmGlobalXCodeGenerator
         }
       }
     this->AppendBuildSettingAttribute(
-      target, this->GetTargetLinkFlagsVar(*cmtarget),
+      target, this->GetTargetLinkFlagsVar(gt),
       linkLibs.c_str(), configName);
     }
     }
@@ -3090,7 +3082,7 @@ bool cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root,
       // MACOSX_BUNDLE file
       if(gtgt->GetPropertyAsBool("MACOSX_BUNDLE"))
         {
-        std::string plist = this->ComputeInfoPListLocation(*gtgt->Target);
+        std::string plist = this->ComputeInfoPListLocation(gtgt);
         mf->GetOrCreateSource(plist, true);
         gtgt->AddSource(plist);
         }
@@ -3110,8 +3102,8 @@ bool cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root,
         cmSourceGroup* sourceGroup =
           mf->FindSourceGroup(source.c_str(), sourceGroups);
         cmXCodeObject* pbxgroup =
-          this->CreateOrGetPBXGroup(*gtgt->Target, sourceGroup);
-        std::string key = GetGroupMapKey(*gtgt->Target, sf);
+          this->CreateOrGetPBXGroup(gtgt, sourceGroup);
+        std::string key = GetGroupMapKey(gtgt, sf);
         this->GroupMap[key] = pbxgroup;
         }
 
@@ -3125,8 +3117,8 @@ bool cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root,
         cmSourceGroup* sourceGroup =
           mf->FindSourceGroup(source.c_str(), sourceGroups);
         cmXCodeObject* pbxgroup =
-          this->CreateOrGetPBXGroup(*gtgt->Target, sourceGroup);
-        std::string key = GetGroupMapKeyFromPath(*gtgt->Target, source);
+          this->CreateOrGetPBXGroup(gtgt, sourceGroup);
+        std::string key = GetGroupMapKeyFromPath(gtgt, source);
         this->GroupMap[key] = pbxgroup;
         }
       }
@@ -3157,16 +3149,16 @@ cmXCodeObject *cmGlobalXCodeGenerator
 
 //----------------------------------------------------------------------------
 cmXCodeObject* cmGlobalXCodeGenerator
-::CreateOrGetPBXGroup(cmTarget& cmtarget, cmSourceGroup* sg)
+::CreateOrGetPBXGroup(cmGeneratorTarget* gtgt, cmSourceGroup* sg)
 {
   std::string s;
   std::string target;
-  const char *targetFolder= cmtarget.GetProperty("FOLDER");
+  const char *targetFolder= gtgt->GetProperty("FOLDER");
   if(targetFolder) {
     target = targetFolder;
     target += "/";
   }
-  target += cmtarget.GetName();
+  target += gtgt->GetName();
   s = target + "/";
   s += sg->GetFullName();
   std::map<std::string, cmXCodeObject* >::iterator it =
@@ -3556,10 +3548,10 @@ std::string
 cmGlobalXCodeGenerator::GetObjectsNormalDirectory(
   const std::string &projName,
   const std::string &configName,
-  const cmTarget *t) const
+  const cmGeneratorTarget *t) const
 {
   std::string dir =
-    t->GetMakefile()->GetCurrentBinaryDirectory();
+    t->GetLocalGenerator()->GetCurrentBinaryDirectory();
   dir += "/";
   dir += projName;
   dir += ".build/";
@@ -3633,8 +3625,7 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
         i != targets.end(); ++i)
       {
       cmXCodeObject* target = *i;
-      cmTarget* t =target->GetTarget();
-      cmGeneratorTarget *gt = this->GetGeneratorTarget(t);
+      cmGeneratorTarget* gt =target->GetTarget();
 
       if(gt->GetType() == cmState::EXECUTABLE ||
 // Nope - no post-build for OBJECT_LIRBRARY
@@ -3695,7 +3686,7 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
         if(this->Architectures.size() > 1)
           {
           std::string universal = this->GetObjectsNormalDirectory(
-            this->CurrentProject, configName, t);
+            this->CurrentProject, configName, gt);
           for( std::vector<std::string>::iterator arch =
                  this->Architectures.begin();
                arch != this->Architectures.end(); ++arch)
@@ -4038,12 +4029,13 @@ void cmGlobalXCodeGenerator::AppendFlag(std::string& flags,
 
 //----------------------------------------------------------------------------
 std::string
-cmGlobalXCodeGenerator::ComputeInfoPListLocation(cmTarget& target)
+cmGlobalXCodeGenerator::ComputeInfoPListLocation(cmGeneratorTarget* target)
 {
-  std::string plist = target.GetMakefile()->GetCurrentBinaryDirectory();
+  std::string plist =
+      target->GetLocalGenerator()->GetCurrentBinaryDirectory();
   plist += cmake::GetCMakeFilesDirectory();
   plist += "/";
-  plist += target.GetName();
+  plist += target->GetName();
   plist += ".dir/Info.plist";
   return plist;
 }
@@ -4069,7 +4061,7 @@ void cmGlobalXCodeGenerator
 {
   std::string configName = this->GetCMakeCFGIntDir();
   std::string dir = this->GetObjectsNormalDirectory(
-    "$(PROJECT_NAME)", configName, gt->Target);
+    "$(PROJECT_NAME)", configName, gt);
   if(this->XcodeVersion >= 21)
     {
     dir += "$(CURRENT_ARCH)/";
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index 10d9bd6..510d46e 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -16,7 +16,6 @@
 #include "cmXCodeObject.h"
 #include "cmCustomCommand.h"
 class cmGlobalGeneratorFactory;
-class cmTarget;
 class cmSourceFile;
 class cmSourceGroup;
 
@@ -90,7 +89,7 @@ protected:
   virtual void AddExtraIDETargets();
   virtual void Generate();
 private:
-  cmXCodeObject* CreateOrGetPBXGroup(cmTarget& cmtarget,
+  cmXCodeObject* CreateOrGetPBXGroup(cmGeneratorTarget* gtgt,
                                      cmSourceGroup* sg);
   cmXCodeObject* CreatePBXGroup(cmXCodeObject *parent,
                                 std::string name);
@@ -108,22 +107,22 @@ private:
                             cmXCodeObject* resourceBuildPhase,
                             std::vector<cmXCodeObject*> contentBuildPhases,
                             cmXCodeObject* frameworkBuildPhase,
-                            cmTarget& cmtarget);
+                            cmGeneratorTarget *gtgt);
 
-  std::string ComputeInfoPListLocation(cmTarget& target);
+  std::string ComputeInfoPListLocation(cmGeneratorTarget *target);
 
   void AddCommandsToBuildPhase(cmXCodeObject* buildphase,
-                               cmTarget& target,
+                               cmGeneratorTarget *target,
                                std::vector<cmCustomCommand>
                                const & commands,
                                const char* commandFileName);
 
   void CreateCustomRulesMakefile(const char* makefileBasename,
-                                 cmTarget& target,
+                                 cmGeneratorTarget* target,
                                  std::vector<cmCustomCommand> const & commands,
                                  const std::string& configName);
 
-  cmXCodeObject* FindXCodeTarget(cmTarget const*);
+  cmXCodeObject* FindXCodeTarget(const cmGeneratorTarget *);
   std::string GetOrCreateId(const std::string& name, const std::string& id);
 
   // create cmXCodeObject from these functions so that memory can be managed
@@ -132,22 +131,23 @@ private:
   cmXCodeObject* CreateObject(cmXCodeObject::Type type);
   cmXCodeObject* CreateString(const std::string& s);
   cmXCodeObject* CreateObjectReference(cmXCodeObject*);
-  cmXCodeObject* CreateXCodeTarget(cmTarget& target,
+  cmXCodeObject* CreateXCodeTarget(cmGeneratorTarget *gtgt,
                                    cmXCodeObject* buildPhases);
   void ForceLinkerLanguages();
   void ForceLinkerLanguage(cmGeneratorTarget* gtgt);
-  const char* GetTargetLinkFlagsVar(cmTarget const& cmtarget) const;
+  const char* GetTargetLinkFlagsVar(const cmGeneratorTarget *target) const;
   const char* GetTargetFileType(cmGeneratorTarget* target);
   const char* GetTargetProductType(cmGeneratorTarget* target);
-  std::string AddConfigurations(cmXCodeObject* target, cmTarget& cmtarget);
+  std::string AddConfigurations(cmXCodeObject* target,
+                                cmGeneratorTarget *gtgt);
   void AppendOrAddBuildSetting(cmXCodeObject* settings, const char* attr,
                                const char* value);
   void AppendBuildSettingAttribute(cmXCodeObject* target, const char* attr,
                                    const char* value,
                                    const std::string& configName);
-  cmXCodeObject* CreateUtilityTarget(cmTarget& target);
+  cmXCodeObject* CreateUtilityTarget(cmGeneratorTarget *gtgt);
   void AddDependAndLinkInformation(cmXCodeObject* target);
-  void CreateBuildSettings(cmTarget& target,
+  void CreateBuildSettings(cmGeneratorTarget *gtgt,
                            cmXCodeObject* buildSettings,
                            const std::string& buildType);
   std::string ExtractFlag(const char* flag, std::string& flags);
@@ -161,18 +161,18 @@ private:
   void WriteXCodePBXProj(std::ostream& fout, cmLocalGenerator* root,
                          std::vector<cmLocalGenerator*>& generators);
   cmXCodeObject* CreateXCodeFileReferenceFromPath(const std::string &fullpath,
-                                                  cmTarget& cmtarget,
+                                                  cmGeneratorTarget *target,
                                                   const std::string &lang,
                                                   cmSourceFile* sf);
   cmXCodeObject* CreateXCodeSourceFileFromPath(const std::string &fullpath,
-                                               cmTarget& cmtarget,
+                                               cmGeneratorTarget *target,
                                                const std::string &lang,
                                                cmSourceFile* sf);
   cmXCodeObject* CreateXCodeFileReference(cmSourceFile* sf,
-                                          cmTarget& cmtarget);
+                                          cmGeneratorTarget *target);
   cmXCodeObject* CreateXCodeSourceFile(cmLocalGenerator* gen,
                                        cmSourceFile* sf,
-                                       cmTarget& cmtarget);
+                                       cmGeneratorTarget *gtgt);
   bool CreateXCodeTargets(cmLocalGenerator* gen,
                           std::vector<cmXCodeObject*>&);
   bool IsHeaderFile(cmSourceFile*);
@@ -185,7 +185,7 @@ private:
                        std::vector<cmLocalGenerator*>& gens);
   cmXCodeObject* CreateBuildPhase(const char* name,
                                   const char* name2,
-                                  cmTarget& cmtarget,
+                                  cmGeneratorTarget *target,
                                   const std::vector<cmCustomCommand>&);
   void CreateReRunCMakeFile(cmLocalGenerator* root,
                             std::vector<cmLocalGenerator*> const& gens);
@@ -224,10 +224,9 @@ private:
   void PrintCompilerAdvice(std::ostream&, std::string const&,
                            const char*) const {}
 
-  std::string GetObjectsNormalDirectory(
-    const std::string &projName,
+  std::string GetObjectsNormalDirectory(const std::string &projName,
     const std::string &configName,
-    const cmTarget *t) const;
+    const cmGeneratorTarget *t) const;
 
   void addObject(cmXCodeObject *obj);
   std::string PostBuildMakeTarget(std::string const& tName,
@@ -249,7 +248,7 @@ private:
   std::map<std::string, cmXCodeObject* > GroupNameMap;
   std::map<std::string, cmXCodeObject* > TargetGroup;
   std::map<std::string, cmXCodeObject* > FileRefs;
-  std::map<cmTarget const*, cmXCodeObject* > XCodeObjectMap;
+  std::map<cmGeneratorTarget const*, cmXCodeObject* > XCodeObjectMap;
   std::vector<std::string> Architectures;
   std::string GeneratorToolset;
 };
diff --git a/Source/cmXCodeObject.h b/Source/cmXCodeObject.h
index ed2940a..0f0548b 100644
--- a/Source/cmXCodeObject.h
+++ b/Source/cmXCodeObject.h
@@ -13,7 +13,7 @@
 #define cmXCodeObject_h
 
 #include "cmStandardIncludes.h"
-class cmTarget;
+class cmGeneratorTarget;
 
 class cmXCodeObject
 {
@@ -87,11 +87,11 @@ public:
     {
       this->Id = id;
     }
-  cmTarget* GetTarget()
+  cmGeneratorTarget* GetTarget()
     {
       return this->Target;
     }
-  void SetTarget(cmTarget* t)
+  void SetTarget(cmGeneratorTarget* t)
     {
       this->Target = t;
     }
@@ -146,7 +146,7 @@ public:
 protected:
   void PrintString(std::ostream& os) const;
 
-  cmTarget* Target;
+  cmGeneratorTarget* Target;
   Type TypeValue;
   std::string Id;
   PBXType IsA;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=715a873cb5aed773241c28cfa24a490b105aca84
commit 715a873cb5aed773241c28cfa24a490b105aca84
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 21 20:36:59 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 22 18:26:31 2015 +0200

    Xcode: Prefer to get target state from cmGeneratorTarget.

diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 4438860..a2d87ff 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1110,13 +1110,13 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
       continue;
       }
 
-    if(cmtarget.GetType() == cmState::INTERFACE_LIBRARY)
+    if(gtgt->GetType() == cmState::INTERFACE_LIBRARY)
       {
       continue;
       }
 
-    if(cmtarget.GetType() == cmState::UTILITY ||
-       cmtarget.GetType() == cmState::GLOBAL_TARGET)
+    if(gtgt->GetType() == cmState::UTILITY ||
+       gtgt->GetType() == cmState::GLOBAL_TARGET)
       {
       cmXCodeObject* t = this->CreateUtilityTarget(cmtarget);
       if (!t)
@@ -1204,7 +1204,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
 
     // some build phases only apply to bundles and/or frameworks
     bool isFrameworkTarget = gtgt->IsFrameworkOnApple();
-    bool isBundleTarget = cmtarget.GetPropertyAsBool("MACOSX_BUNDLE");
+    bool isBundleTarget = gtgt->GetPropertyAsBool("MACOSX_BUNDLE");
     bool isCFBundleTarget = gtgt->IsCFBundleOnApple();
 
     cmXCodeObject* buildFiles = 0;
@@ -1479,7 +1479,7 @@ void cmGlobalXCodeGenerator::CreateCustomCommands(cmXCodeObject* buildPhases,
 
   cmGeneratorTarget* gtgt = this->GetGeneratorTarget(&cmtarget);
 
-  if(cmtarget.GetType() == cmState::SHARED_LIBRARY &&
+  if(gtgt->GetType() == cmState::SHARED_LIBRARY &&
     !gtgt->IsFrameworkOnApple())
     {
     cmCustomCommandLines cmd;
@@ -1488,13 +1488,13 @@ void cmGlobalXCodeGenerator::CreateCustomCommands(cmXCodeObject* buildPhases,
     cmd[0].push_back("-E");
     cmd[0].push_back("cmake_symlink_library");
     std::string str_file = "$<TARGET_FILE:";
-    str_file += cmtarget.GetName();
+    str_file += gtgt->GetName();
     str_file += ">";
     std::string str_so_file = "$<TARGET_SONAME_FILE:";
-    str_so_file += cmtarget.GetName();
+    str_so_file += gtgt->GetName();
     str_so_file += ">";
     std::string str_link_file = "$<TARGET_LINKER_FILE:";
-    str_link_file += cmtarget.GetName();
+    str_link_file += gtgt->GetName();
     str_link_file += ">";
     cmd[0].push_back(str_file);
     cmd[0].push_back(str_so_file);
@@ -1797,22 +1797,22 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
                                                 cmXCodeObject* buildSettings,
                                                 const std::string& configName)
 {
-  if(target.GetType() == cmState::INTERFACE_LIBRARY)
+  cmGeneratorTarget *gtgt = this->GetGeneratorTarget(&target);
+  if(gtgt->GetType() == cmState::INTERFACE_LIBRARY)
     {
     return;
     }
 
   std::string defFlags;
-  bool shared = ((target.GetType() == cmState::SHARED_LIBRARY) ||
-                 (target.GetType() == cmState::MODULE_LIBRARY));
-  bool binary = ((target.GetType() == cmState::OBJECT_LIBRARY) ||
-                 (target.GetType() == cmState::STATIC_LIBRARY) ||
-                 (target.GetType() == cmState::EXECUTABLE) ||
+  bool shared = ((gtgt->GetType() == cmState::SHARED_LIBRARY) ||
+                 (gtgt->GetType() == cmState::MODULE_LIBRARY));
+  bool binary = ((gtgt->GetType() == cmState::OBJECT_LIBRARY) ||
+                 (gtgt->GetType() == cmState::STATIC_LIBRARY) ||
+                 (gtgt->GetType() == cmState::EXECUTABLE) ||
                  shared);
 
   // Compute the compilation flags for each language.
   std::set<std::string> languages;
-  cmGeneratorTarget *gtgt = this->GetGeneratorTarget(&target);
   gtgt->GetLanguages(languages, configName);
   std::map<std::string, std::string> cflags;
   for (std::set<std::string>::iterator li = languages.begin();
@@ -1840,7 +1840,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
     {
     cmSystemTools::Error
       ("CMake can not determine linker language for target: ",
-       target.GetName().c_str());
+       gtgt->GetName().c_str());
     return;
     }
 
@@ -1869,15 +1869,15 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
 
   std::string extraLinkOptionsVar;
   std::string extraLinkOptions;
-  if(target.GetType() == cmState::EXECUTABLE)
+  if(gtgt->GetType() == cmState::EXECUTABLE)
     {
     extraLinkOptionsVar = "CMAKE_EXE_LINKER_FLAGS";
     }
-  else if(target.GetType() == cmState::SHARED_LIBRARY)
+  else if(gtgt->GetType() == cmState::SHARED_LIBRARY)
     {
     extraLinkOptionsVar = "CMAKE_SHARED_LINKER_FLAGS";
     }
-  else if(target.GetType() == cmState::MODULE_LIBRARY)
+  else if(gtgt->GetType() == cmState::MODULE_LIBRARY)
     {
     extraLinkOptionsVar = "CMAKE_MODULE_LINKER_FLAGS";
     }
@@ -1889,8 +1889,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
                                configName);
     }
 
-  if(target.GetType() == cmState::OBJECT_LIBRARY ||
-     target.GetType() == cmState::STATIC_LIBRARY)
+  if(gtgt->GetType() == cmState::OBJECT_LIBRARY ||
+     gtgt->GetType() == cmState::STATIC_LIBRARY)
     {
     this->CurrentLocalGenerator
       ->GetStaticLibraryFlags(extraLinkOptions,
@@ -1899,7 +1899,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
     }
   else
     {
-    const char* targetLinkFlags = target.GetProperty("LINK_FLAGS");
+    const char* targetLinkFlags = gtgt->GetProperty("LINK_FLAGS");
     if(targetLinkFlags)
       {
       this->CurrentLocalGenerator->
@@ -1909,7 +1909,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
       {
       std::string linkFlagsVar = "LINK_FLAGS_";
       linkFlagsVar += cmSystemTools::UpperCase(configName);
-      if(const char* linkFlags = target.GetProperty(linkFlagsVar.c_str()))
+      if(const char* linkFlags = gtgt->GetProperty(linkFlagsVar.c_str()))
         {
         this->CurrentLocalGenerator->
           AppendFlags(extraLinkOptions, linkFlags);
@@ -1952,8 +1952,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
   std::string pnsuffix;
   gtgt->GetFullNameComponents(pnprefix, pnbase, pnsuffix, configName);
 
-  const char* version = target.GetProperty("VERSION");
-  const char* soversion = target.GetProperty("SOVERSION");
+  const char* version = gtgt->GetProperty("VERSION");
+  const char* soversion = gtgt->GetProperty("SOVERSION");
   if(!gtgt->HasSOName(configName) || gtgt->IsFrameworkOnApple())
     {
     version = 0;
@@ -1980,10 +1980,10 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
 
   // Set attributes to specify the proper name for the target.
   std::string pndir = this->CurrentLocalGenerator->GetCurrentBinaryDirectory();
-  if(target.GetType() == cmState::STATIC_LIBRARY ||
-     target.GetType() == cmState::SHARED_LIBRARY ||
-     target.GetType() == cmState::MODULE_LIBRARY ||
-     target.GetType() == cmState::EXECUTABLE)
+  if(gtgt->GetType() == cmState::STATIC_LIBRARY ||
+     gtgt->GetType() == cmState::SHARED_LIBRARY ||
+     gtgt->GetType() == cmState::MODULE_LIBRARY ||
+     gtgt->GetType() == cmState::EXECUTABLE)
     {
     if(this->XcodeVersion >= 21)
       {
@@ -2011,10 +2011,10 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
     buildSettings->AddAttribute("EXECUTABLE_SUFFIX",
                                 this->CreateString(pnsuffix.c_str()));
     }
-  else if(target.GetType() == cmState::OBJECT_LIBRARY)
+  else if(gtgt->GetType() == cmState::OBJECT_LIBRARY)
     {
     pnprefix = "lib";
-    pnbase = target.GetName();
+    pnbase = gtgt->GetName();
     pnsuffix = ".a";
 
     if(this->XcodeVersion >= 21)
@@ -2040,7 +2040,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
                               this->CreateString(pndir.c_str()));
 
   // Handle settings for each target type.
-  switch(target.GetType())
+  switch(gtgt->GetType())
     {
     case cmState::OBJECT_LIBRARY:
     case cmState::STATIC_LIBRARY:
@@ -2111,7 +2111,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
     }
     case cmState::SHARED_LIBRARY:
     {
-    if(target.GetPropertyAsBool("FRAMEWORK"))
+    if(gtgt->GetPropertyAsBool("FRAMEWORK"))
       {
       std::string fw_version = target.GetFrameworkVersion();
       buildSettings->AddAttribute("FRAMEWORK_VERSION",
@@ -2158,7 +2158,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
       }
 
     // Handle bundles and normal executables separately.
-    if(target.GetPropertyAsBool("MACOSX_BUNDLE"))
+    if(gtgt->GetPropertyAsBool("MACOSX_BUNDLE"))
       {
       std::string plist = this->ComputeInfoPListLocation(target);
       // Xcode will create the final version of Info.plist at build time,
@@ -2323,7 +2323,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
 
   // Add Fortran source format attribute if property is set.
   const char* format = 0;
-  const char* tgtfmt = target.GetProperty("Fortran_FORMAT");
+  const char* tgtfmt = gtgt->GetProperty("Fortran_FORMAT");
   switch(this->CurrentLocalGenerator->GetFortranFormat(tgtfmt))
     {
     case cmLocalGenerator::FortranFormatFixed: format = "fixed"; break;
@@ -2338,7 +2338,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
 
   // Create the INSTALL_PATH attribute.
   std::string install_name_dir;
-  if(target.GetType() == cmState::SHARED_LIBRARY)
+  if(gtgt->GetType() == cmState::SHARED_LIBRARY)
     {
     // Get the install_name directory for the build tree.
     install_name_dir = gtgt->GetInstallNameDirForBuildTree(configName);
@@ -2426,7 +2426,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
     }
 
   // Runtime version information.
-  if(target.GetType() == cmState::SHARED_LIBRARY)
+  if(gtgt->GetType() == cmState::SHARED_LIBRARY)
     {
     int major;
     int minor;
@@ -2510,6 +2510,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
 cmXCodeObject*
 cmGlobalXCodeGenerator::CreateUtilityTarget(cmTarget& cmtarget)
 {
+  cmGeneratorTarget* gtgt = this->GetGeneratorTarget(&cmtarget);
   cmXCodeObject* shellBuildPhase =
     this->CreateObject(cmXCodeObject::PBXShellScriptBuildPhase);
   shellBuildPhase->AddAttribute("buildActionMask",
@@ -2532,7 +2533,7 @@ cmGlobalXCodeGenerator::CreateUtilityTarget(cmTarget& cmtarget)
 
   cmXCodeObject* target =
     this->CreateObject(cmXCodeObject::PBXAggregateTarget);
-  target->SetComment(cmtarget.GetName().c_str());
+  target->SetComment(gtgt->GetName().c_str());
   cmXCodeObject* buildPhases =
     this->CreateObject(cmXCodeObject::OBJECT_LIST);
   std::vector<cmXCodeObject*> emptyContentVector;
@@ -2555,16 +2556,15 @@ cmGlobalXCodeGenerator::CreateUtilityTarget(cmTarget& cmtarget)
   cmXCodeObject* dependencies =
     this->CreateObject(cmXCodeObject::OBJECT_LIST);
   target->AddAttribute("dependencies", dependencies);
-  target->AddAttribute("name", this->CreateString(cmtarget.GetName()));
-  target->AddAttribute("productName",this->CreateString(cmtarget.GetName()));
+  target->AddAttribute("name", this->CreateString(gtgt->GetName()));
+  target->AddAttribute("productName",this->CreateString(gtgt->GetName()));
   target->SetTarget(&cmtarget);
   this->XCodeObjectMap[&cmtarget] = target;
 
   // Add source files without build rules for editing convenience.
-  if(cmtarget.GetType() == cmState::UTILITY)
+  if(gtgt->GetType() == cmState::UTILITY)
     {
     std::vector<cmSourceFile*> sources;
-    cmGeneratorTarget* gtgt = this->GetGeneratorTarget(&cmtarget);
     if (!gtgt->GetConfigCommonSourceFiles(sources))
       {
       return 0;
@@ -2581,7 +2581,7 @@ cmGlobalXCodeGenerator::CreateUtilityTarget(cmTarget& cmtarget)
     }
 
   target->SetId(this->GetOrCreateId(
-    cmtarget.GetName(), target->GetId()).c_str());
+    gtgt->GetName(), target->GetId()).c_str());
 
   return target;
 }
@@ -2712,7 +2712,9 @@ cmXCodeObject*
 cmGlobalXCodeGenerator::CreateXCodeTarget(cmTarget& cmtarget,
                                           cmXCodeObject* buildPhases)
 {
-  if(cmtarget.GetType() == cmState::INTERFACE_LIBRARY)
+  cmGeneratorTarget *gtgt = this->GetGeneratorTarget(&cmtarget);
+
+  if(gtgt->GetType() == cmState::INTERFACE_LIBRARY)
     {
     return 0;
     }
@@ -2737,10 +2739,8 @@ cmGlobalXCodeGenerator::CreateXCodeTarget(cmTarget& cmtarget,
   cmXCodeObject* dependencies =
     this->CreateObject(cmXCodeObject::OBJECT_LIST);
   target->AddAttribute("dependencies", dependencies);
-  target->AddAttribute("name", this->CreateString(cmtarget.GetName()));
-  target->AddAttribute("productName",this->CreateString(cmtarget.GetName()));
-
-  cmGeneratorTarget *gtgt = this->GetGeneratorTarget(&cmtarget);
+  target->AddAttribute("name", this->CreateString(gtgt->GetName()));
+  target->AddAttribute("productName",this->CreateString(gtgt->GetName()));
 
   cmXCodeObject* fileRef =
     this->CreateObject(cmXCodeObject::PBXFileReference);
@@ -2749,10 +2749,10 @@ cmGlobalXCodeGenerator::CreateXCodeTarget(cmTarget& cmtarget,
     fileRef->AddAttribute("explicitFileType", this->CreateString(fileType));
     }
   std::string fullName;
-  if(cmtarget.GetType() == cmState::OBJECT_LIBRARY)
+  if(gtgt->GetType() == cmState::OBJECT_LIBRARY)
     {
     fullName = "lib";
-    fullName += cmtarget.GetName();
+    fullName += gtgt->GetName();
     fullName += ".a";
     }
   else
@@ -2763,7 +2763,7 @@ cmGlobalXCodeGenerator::CreateXCodeTarget(cmTarget& cmtarget,
   fileRef->AddAttribute("refType", this->CreateString("0"));
   fileRef->AddAttribute("sourceTree",
                         this->CreateString("BUILT_PRODUCTS_DIR"));
-  fileRef->SetComment(cmtarget.GetName().c_str());
+  fileRef->SetComment(gtgt->GetName().c_str());
   target->AddAttribute("productReference",
                        this->CreateObjectReference(fileRef));
   if(const char* productType = this->GetTargetProductType(gtgt))
@@ -2773,7 +2773,7 @@ cmGlobalXCodeGenerator::CreateXCodeTarget(cmTarget& cmtarget,
   target->SetTarget(&cmtarget);
   this->XCodeObjectMap[&cmtarget] = target;
   target->SetId(this->GetOrCreateId(
-    cmtarget.GetName(), target->GetId()).c_str());
+    gtgt->GetName(), target->GetId()).c_str());
   return target;
 }
 
@@ -2923,18 +2923,18 @@ void cmGlobalXCodeGenerator
 ::AddDependAndLinkInformation(cmXCodeObject* target)
 {
   cmTarget* cmtarget = target->GetTarget();
-  if(!cmtarget)
+  cmGeneratorTarget* gt = this->GetGeneratorTarget(cmtarget);
+  if(!gt)
     {
     cmSystemTools::Error("Error no target on xobject\n");
     return;
     }
-  if(cmtarget->GetType() == cmState::INTERFACE_LIBRARY)
+  if(gt->GetType() == cmState::INTERFACE_LIBRARY)
     {
     return;
     }
 
   // Add dependencies on other CMake targets.
-  cmGeneratorTarget* gt = this->GetGeneratorTarget(cmtarget);
   TargetDependSet const& deps = this->GetTargetDirectDepends(gt);
   for(TargetDependSet::const_iterator i = deps.begin(); i != deps.end(); ++i)
     {
@@ -2958,7 +2958,7 @@ void cmGlobalXCodeGenerator
       std::string linkObjs;
       const char* sep = "";
       std::vector<std::string> objs;
-      this->GetGeneratorTarget(cmtarget)->UseObjectLibraries(objs, "");
+      gt->UseObjectLibraries(objs, "");
       for(std::vector<std::string>::const_iterator
             oi = objs.begin(); oi != objs.end(); ++oi)
         {
@@ -2972,15 +2972,14 @@ void cmGlobalXCodeGenerator
       }
 
     // Skip link information for object libraries.
-    if(cmtarget->GetType() == cmState::OBJECT_LIBRARY ||
-       cmtarget->GetType() == cmState::STATIC_LIBRARY)
+    if(gt->GetType() == cmState::OBJECT_LIBRARY ||
+       gt->GetType() == cmState::STATIC_LIBRARY)
       {
       continue;
       }
 
     // Compute the link library and directory information.
-    cmGeneratorTarget* gtgt = this->GetGeneratorTarget(cmtarget);
-    cmComputeLinkInformation* pcli = gtgt->GetLinkInformation(configName);
+    cmComputeLinkInformation* pcli = gt->GetLinkInformation(configName);
     if(!pcli)
       {
       continue;
@@ -3637,21 +3636,21 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
       cmTarget* t =target->GetTarget();
       cmGeneratorTarget *gt = this->GetGeneratorTarget(t);
 
-      if(t->GetType() == cmState::EXECUTABLE ||
+      if(gt->GetType() == cmState::EXECUTABLE ||
 // Nope - no post-build for OBJECT_LIRBRARY
-//         t->GetType() == cmState::OBJECT_LIBRARY ||
-         t->GetType() == cmState::STATIC_LIBRARY ||
-         t->GetType() == cmState::SHARED_LIBRARY ||
-         t->GetType() == cmState::MODULE_LIBRARY)
+//         gt->GetType() == cmState::OBJECT_LIBRARY ||
+         gt->GetType() == cmState::STATIC_LIBRARY ||
+         gt->GetType() == cmState::SHARED_LIBRARY ||
+         gt->GetType() == cmState::MODULE_LIBRARY)
         {
         // Declare an entry point for the target post-build phase.
-        makefileStream << this->PostBuildMakeTarget(t->GetName(), *ct)
+        makefileStream << this->PostBuildMakeTarget(gt->GetName(), *ct)
                        << ":\n";
         }
 
-      if(t->GetType() == cmState::EXECUTABLE ||
-         t->GetType() == cmState::SHARED_LIBRARY ||
-         t->GetType() == cmState::MODULE_LIBRARY)
+      if(gt->GetType() == cmState::EXECUTABLE ||
+         gt->GetType() == cmState::SHARED_LIBRARY ||
+         gt->GetType() == cmState::MODULE_LIBRARY)
         {
         std::string tfull = gt->GetFullPath(configName);
         std::string trel = this->ConvertToRelativeForMake(tfull.c_str());

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d02435b24edd127ff33f2eb9ea3075b2898ec057
commit d02435b24edd127ff33f2eb9ea3075b2898ec057
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 21 21:14:00 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 22 18:26:31 2015 +0200

    Xcode: Re-order conditions.

diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index f00c9e5..4438860 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -2923,13 +2923,13 @@ void cmGlobalXCodeGenerator
 ::AddDependAndLinkInformation(cmXCodeObject* target)
 {
   cmTarget* cmtarget = target->GetTarget();
-  if(cmtarget->GetType() == cmState::INTERFACE_LIBRARY)
+  if(!cmtarget)
     {
+    cmSystemTools::Error("Error no target on xobject\n");
     return;
     }
-  if(!cmtarget)
+  if(cmtarget->GetType() == cmState::INTERFACE_LIBRARY)
     {
-    cmSystemTools::Error("Error no target on xobject\n");
     return;
     }
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7d88907a36306870673898a452cfa2ee77d3ea4d
commit 7d88907a36306870673898a452cfa2ee77d3ea4d
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 21 20:38:10 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 22 18:26:31 2015 +0200

    Xcode: Port ForceLinkerLanguage to cmGeneratorTarget.

diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 6e2e386..f00c9e5 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1368,22 +1368,22 @@ void cmGlobalXCodeGenerator::ForceLinkerLanguages()
   for(TargetMap::const_iterator
         ti = this->TotalTargets.begin(); ti != this->TotalTargets.end(); ++ti)
     {
-    this->ForceLinkerLanguage(*ti->second);
+    cmGeneratorTarget* gt = this->GetGeneratorTarget(ti->second);
+    this->ForceLinkerLanguage(gt);
     }
 }
 
 //----------------------------------------------------------------------------
-void cmGlobalXCodeGenerator::ForceLinkerLanguage(cmTarget& cmtarget)
+void cmGlobalXCodeGenerator::ForceLinkerLanguage(cmGeneratorTarget* gtgt)
 {
   // This matters only for targets that link.
-  if(cmtarget.GetType() != cmState::EXECUTABLE &&
-     cmtarget.GetType() != cmState::SHARED_LIBRARY &&
-     cmtarget.GetType() != cmState::MODULE_LIBRARY)
+  if(gtgt->GetType() != cmState::EXECUTABLE &&
+     gtgt->GetType() != cmState::SHARED_LIBRARY &&
+     gtgt->GetType() != cmState::MODULE_LIBRARY)
     {
     return;
     }
 
-  cmGeneratorTarget *gtgt = this->GetGeneratorTarget(&cmtarget);
   std::string llang = gtgt->GetLinkerLanguage("NOCONFIG");
   if(llang.empty()) { return; }
 
@@ -1399,11 +1399,11 @@ void cmGlobalXCodeGenerator::ForceLinkerLanguage(cmTarget& cmtarget)
   // Add an empty source file to the target that compiles with the
   // linker language.  This should convince Xcode to choose the proper
   // language.
-  cmMakefile* mf = cmtarget.GetMakefile();
+  cmMakefile* mf = gtgt->Target->GetMakefile();
   std::string fname = gtgt->GetLocalGenerator()->GetCurrentBinaryDirectory();
   fname += cmake::GetCMakeFilesDirectory();
   fname += "/";
-  fname += cmtarget.GetName();
+  fname += gtgt->GetName();
   fname += "-CMakeForceLinker";
   fname += ".";
   fname += cmSystemTools::LowerCase(llang);
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index feb5009..10d9bd6 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -135,7 +135,7 @@ private:
   cmXCodeObject* CreateXCodeTarget(cmTarget& target,
                                    cmXCodeObject* buildPhases);
   void ForceLinkerLanguages();
-  void ForceLinkerLanguage(cmTarget& cmtarget);
+  void ForceLinkerLanguage(cmGeneratorTarget* gtgt);
   const char* GetTargetLinkFlagsVar(cmTarget const& cmtarget) const;
   const char* GetTargetFileType(cmGeneratorTarget* target);
   const char* GetTargetProductType(cmGeneratorTarget* target);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4ab54236e329f882a31081780645cd853ea90a63
commit 4ab54236e329f882a31081780645cd853ea90a63
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 21 20:32:20 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 22 18:26:30 2015 +0200

    Xcode: Port loops to cmGeneratorTarget.

diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index fe115ac..6e2e386 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -514,18 +514,18 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
     for(std::vector<cmGeneratorTarget*>::iterator l = tgts.begin();
         l != tgts.end(); l++)
       {
-      cmTarget& target = *(*l)->Target;
+      cmGeneratorTarget* target = *l;
 
-      if (target.GetType() == cmState::GLOBAL_TARGET)
+      if (target->GetType() == cmState::GLOBAL_TARGET)
         {
         continue;
         }
 
-      std::string targetName = target.GetName();
+      std::string targetName = target->GetName();
 
       if (regenerate && (targetName != CMAKE_CHECK_BUILD_SYSTEM_TARGET))
         {
-        target.AddUtility(CMAKE_CHECK_BUILD_SYSTEM_TARGET);
+        target->Target->AddUtility(CMAKE_CHECK_BUILD_SYSTEM_TARGET);
         }
 
       // make all exe, shared libs and modules
@@ -533,19 +533,19 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
       // this will make sure that when the next target is built
       // things are up-to-date
       if(!makeHelper.empty() &&
-         (target.GetType() == cmState::EXECUTABLE ||
+         (target->GetType() == cmState::EXECUTABLE ||
 // Nope - no post-build for OBJECT_LIRBRARY
-//          target.GetType() == cmState::OBJECT_LIBRARY ||
-          target.GetType() == cmState::STATIC_LIBRARY ||
-          target.GetType() == cmState::SHARED_LIBRARY ||
-          target.GetType() == cmState::MODULE_LIBRARY))
+//          target->GetType() == cmState::OBJECT_LIBRARY ||
+          target->GetType() == cmState::STATIC_LIBRARY ||
+          target->GetType() == cmState::SHARED_LIBRARY ||
+          target->GetType() == cmState::MODULE_LIBRARY))
         {
         makeHelper[makeHelper.size()-1] = // fill placeholder
-          this->PostBuildMakeTarget(target.GetName(), "$(CONFIGURATION)");
+          this->PostBuildMakeTarget(target->GetName(), "$(CONFIGURATION)");
         cmCustomCommandLines commandLines;
         commandLines.push_back(makeHelper);
         std::vector<std::string> no_byproducts;
-        lg->GetMakefile()->AddCustomCommandToTarget(target.GetName(),
+        lg->GetMakefile()->AddCustomCommandToTarget(target->GetName(),
                                                     no_byproducts,
                                                     no_depends,
                                                     commandLines,
@@ -554,19 +554,17 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
                                                     dir.c_str());
         }
 
-      if(target.GetType() != cmState::INTERFACE_LIBRARY
-          && !target.GetPropertyAsBool("EXCLUDE_FROM_ALL"))
+      if(target->GetType() != cmState::INTERFACE_LIBRARY
+          && !target->GetPropertyAsBool("EXCLUDE_FROM_ALL"))
         {
-        allbuild->AddUtility(target.GetName());
+        allbuild->AddUtility(target->GetName());
         }
 
-      cmGeneratorTarget* targetGT = this->GetGeneratorTarget(&target);
-
       // Refer to the build configuration file for easy editing.
       listfile = lg->GetCurrentSourceDirectory();
       listfile += "/";
       listfile += "CMakeLists.txt";
-      targetGT->AddSource(listfile.c_str());
+      target->AddSource(listfile.c_str());
       }
     }
 }
@@ -3074,28 +3072,26 @@ bool cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root,
     for(std::vector<cmGeneratorTarget*>::iterator l = tgts.begin();
         l != tgts.end(); l++)
       {
-      cmTarget& cmtarget = *(*l)->Target;
+      cmGeneratorTarget* gtgt = *l;
 
       // Same skipping logic here as in CreateXCodeTargets so that we do not
       // end up with (empty anyhow) ALL_BUILD and XCODE_DEPEND_HELPER source
       // groups:
       //
-      if(cmtarget.GetType() == cmState::GLOBAL_TARGET)
+      if(gtgt->GetType() == cmState::GLOBAL_TARGET)
         {
         continue;
         }
-      if(cmtarget.GetType() == cmState::INTERFACE_LIBRARY)
+      if(gtgt->GetType() == cmState::INTERFACE_LIBRARY)
         {
         continue;
         }
 
-      cmGeneratorTarget* gtgt = this->GetGeneratorTarget(&cmtarget);
-
       // add the soon to be generated Info.plist file as a source for a
       // MACOSX_BUNDLE file
-      if(cmtarget.GetPropertyAsBool("MACOSX_BUNDLE"))
+      if(gtgt->GetPropertyAsBool("MACOSX_BUNDLE"))
         {
-        std::string plist = this->ComputeInfoPListLocation(cmtarget);
+        std::string plist = this->ComputeInfoPListLocation(*gtgt->Target);
         mf->GetOrCreateSource(plist, true);
         gtgt->AddSource(plist);
         }
@@ -3115,14 +3111,14 @@ bool cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root,
         cmSourceGroup* sourceGroup =
           mf->FindSourceGroup(source.c_str(), sourceGroups);
         cmXCodeObject* pbxgroup =
-          this->CreateOrGetPBXGroup(cmtarget, sourceGroup);
-        std::string key = GetGroupMapKey(cmtarget, sf);
+          this->CreateOrGetPBXGroup(*gtgt->Target, sourceGroup);
+        std::string key = GetGroupMapKey(*gtgt->Target, sf);
         this->GroupMap[key] = pbxgroup;
         }
 
       // Put OBJECT_LIBRARY objects in proper groups:
       std::vector<std::string> objs;
-      this->GetGeneratorTarget(&cmtarget)->UseObjectLibraries(objs, "");
+      gtgt->UseObjectLibraries(objs, "");
       for(std::vector<std::string>::const_iterator
             oi = objs.begin(); oi != objs.end(); ++oi)
         {
@@ -3130,8 +3126,8 @@ bool cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root,
         cmSourceGroup* sourceGroup =
           mf->FindSourceGroup(source.c_str(), sourceGroups);
         cmXCodeObject* pbxgroup =
-          this->CreateOrGetPBXGroup(cmtarget, sourceGroup);
-        std::string key = GetGroupMapKeyFromPath(cmtarget, source);
+          this->CreateOrGetPBXGroup(*gtgt->Target, sourceGroup);
+        std::string key = GetGroupMapKeyFromPath(*gtgt->Target, source);
         this->GroupMap[key] = pbxgroup;
         }
       }

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list