[Cmake-commits] CMake branch, next, updated. v3.3.0-1762-g6648c4d

Stephen Kelly steveire at gmail.com
Sun Aug 2 16:07:07 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  6648c4d2f8a390350e5361f4f7c5d1ee12911fae (commit)
       via  63ddd44c50cff1ec78513b97d1d7d45b3e2950fb (commit)
       via  e7c376aa9c250e79918b3a01db301308912cb41a (commit)
       via  875f5a9449cf2ec596566c2e7496c93c34320009 (commit)
       via  756e89674e89efb180380a4b87141ca0e90e6191 (commit)
       via  d96fe03397e73823846626446f1b9dbc11d7ed44 (commit)
       via  95e71fbe954c252fa8562507f52e2ada01ff160f (commit)
       via  ebef362af12f7be46edfce4af9e93e124ece17e3 (commit)
       via  520d76306f8eca0b3b6792e6734deb7f893d23a2 (commit)
       via  57c42044578479ca3e734eb251728627dfcb8c9a (commit)
       via  83bfb2dfe55e77b9a3d0e655bd30aa23399c29e6 (commit)
       via  3bb7b1f045b47e4f83ed2c9e07cc9bfc4285be7c (commit)
       via  fe5391eecaf19d2741cb25f6690dbc21c05aeae7 (commit)
       via  c0497de1233b363afd983bc97af00b5d7fe27950 (commit)
       via  4031d184b53b6cff621e30663f80c7d86bee7aa8 (commit)
       via  7c8954af013c05f373c6753e17860dddd42eaee1 (commit)
      from  0482b6b05eb3386880330ebbe0da534e88fed5cf (commit)

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

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6648c4d2f8a390350e5361f4f7c5d1ee12911fae
commit 6648c4d2f8a390350e5361f4f7c5d1ee12911fae
Merge: 0482b6b 63ddd44
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Aug 2 16:07:04 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Aug 2 16:07:04 2015 -0400

    Merge topic 'use-generator-target' into next
    
    63ddd44c cmOrderDirectories: Port to cmGeneratorTarget.
    e7c376aa cmMakefile: Remove unused method.
    875f5a94 cmGlobalGenerator: Base exclusion computation on cmGeneratorTarget.
    756e8967 cmGeneratorTarget: Move CompileInfoMap from cmTarget.
    d96fe033 cmGeneratorTarget: Move GetCompilePDBDirectory from cmTarget.
    95e71fbe cmGeneratorTarget: Move GetOutputName from cmTarget.
    ebef362a cmComputeLinkDepends: Port to cmGeneratorTarget.
    520d7630 cmComputeLinkInformation: Port to cmGeneratorTarget.
    57c42044 cmGeneratorTarget: Move IsBundleOnApple from cmTarget.
    83bfb2df cmMakefileTargetGenerator: Add accessor for GeneratorTarget.
    3bb7b1f0 cmGeneratorTarget: Move GetLinkClosure from cmTarget.
    fe5391ee cmGeneratorTarget: Move GetLinkerLanguage from cmTarget.
    c0497de1 cmGeneratorTarget: Move GetFrameworkDirectory from cmTarget.
    4031d184 cmGeneratorTarget: Move GetFullNameInternal from cmTarget.
    7c8954af cmGeneratorTarget: Move GetFullName from cmTarget.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=63ddd44c50cff1ec78513b97d1d7d45b3e2950fb
commit 63ddd44c50cff1ec78513b97d1d7d45b3e2950fb
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 1 09:48:04 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Aug 2 22:06:05 2015 +0200

    cmOrderDirectories: Port to cmGeneratorTarget.

diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index 5cd0d54..e0c6e86 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -260,10 +260,10 @@ cmComputeLinkInformation
 
   // Allocate internals.
   this->OrderLinkerSearchPath =
-    new cmOrderDirectories(this->GlobalGenerator, target->Target,
+    new cmOrderDirectories(this->GlobalGenerator, target,
                            "linker search path");
   this->OrderRuntimeSearchPath =
-    new cmOrderDirectories(this->GlobalGenerator, target->Target,
+    new cmOrderDirectories(this->GlobalGenerator, target,
                            "runtime search path");
   this->OrderDependentRPath = 0;
 
@@ -370,7 +370,7 @@ cmComputeLinkInformation
     {
     this->SharedDependencyMode = SharedDepModeDir;
     this->OrderDependentRPath =
-      new cmOrderDirectories(this->GlobalGenerator, target->Target,
+      new cmOrderDirectories(this->GlobalGenerator, target,
                              "dependent library path");
     }
 
diff --git a/Source/cmOrderDirectories.cxx b/Source/cmOrderDirectories.cxx
index a612437..35ee127 100644
--- a/Source/cmOrderDirectories.cxx
+++ b/Source/cmOrderDirectories.cxx
@@ -280,7 +280,7 @@ bool cmOrderDirectoriesConstraintLibrary::FindConflict(std::string const& dir)
 
 //----------------------------------------------------------------------------
 cmOrderDirectories::cmOrderDirectories(cmGlobalGenerator* gg,
-                                       cmTarget const* target,
+                                       const cmGeneratorTarget* target,
                                        const char* purpose)
 {
   this->GlobalGenerator = gg;
@@ -554,7 +554,8 @@ void cmOrderDirectories::FindImplicitConflicts()
     << text
     << "Some of these libraries may not be found correctly.";
   this->GlobalGenerator->GetCMakeInstance()
-    ->IssueMessage(cmake::WARNING, w.str(), this->Target->GetBacktrace());
+    ->IssueMessage(cmake::WARNING, w.str(),
+                   this->Target->Target->GetBacktrace());
 }
 
 //----------------------------------------------------------------------------
@@ -635,5 +636,6 @@ void cmOrderDirectories::DiagnoseCycle()
     }
   e << "Some of these libraries may not be found correctly.";
   this->GlobalGenerator->GetCMakeInstance()
-    ->IssueMessage(cmake::WARNING, e.str(), this->Target->GetBacktrace());
+    ->IssueMessage(cmake::WARNING, e.str(),
+                   this->Target->Target->GetBacktrace());
 }
diff --git a/Source/cmOrderDirectories.h b/Source/cmOrderDirectories.h
index cb5a51f..211c786 100644
--- a/Source/cmOrderDirectories.h
+++ b/Source/cmOrderDirectories.h
@@ -19,7 +19,7 @@
 class cmGlobalGenerator;
 class cmOrderDirectoriesConstraint;
 class cmOrderDirectoriesConstraintLibrary;
-class cmTarget;
+class cmGeneratorTarget;
 
 /** \class cmOrderDirectories
  * \brief Compute a safe runtime path order for a set of shared libraries.
@@ -27,7 +27,7 @@ class cmTarget;
 class cmOrderDirectories
 {
 public:
-  cmOrderDirectories(cmGlobalGenerator* gg, cmTarget const* target,
+  cmOrderDirectories(cmGlobalGenerator* gg, cmGeneratorTarget const* target,
                      const char* purpose);
   ~cmOrderDirectories();
   void AddRuntimeLibrary(std::string const& fullPath, const char* soname = 0);
@@ -41,7 +41,7 @@ public:
   std::vector<std::string> const& GetOrderedDirectories();
 private:
   cmGlobalGenerator* GlobalGenerator;
-  cmTarget const* Target;
+  cmGeneratorTarget const* Target;
   std::string Purpose;
 
   std::vector<std::string> OrderedDirectories;

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e7c376aa9c250e79918b3a01db301308912cb41a
commit e7c376aa9c250e79918b3a01db301308912cb41a
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jun 6 14:27:52 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Aug 2 22:06:05 2015 +0200

    cmMakefile: Remove unused method.

diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 1e5c301..00d4005 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -113,10 +113,6 @@ public:
 
   bool GetIsSourceFileTryCompile() const;
 
-  ///! Get the current makefile generator.
-  cmLocalGenerator* GetLocalGenerator() const
-    { return this->LocalGenerator;}
-
   /**
    * Help enforce global target name uniqueness.
    */

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=875f5a9449cf2ec596566c2e7496c93c34320009
commit 875f5a9449cf2ec596566c2e7496c93c34320009
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jun 6 14:09:35 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Aug 2 22:06:05 2015 +0200

    cmGlobalGenerator: Base exclusion computation on cmGeneratorTarget.

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 1d6608b..b14949a 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2022,10 +2022,10 @@ bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
 }
 
 bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
-                                   cmTarget const& target) const
+                                   cmGeneratorTarget* target) const
 {
-  if(target.GetType() == cmTarget::INTERFACE_LIBRARY
-      || target.GetPropertyAsBool("EXCLUDE_FROM_ALL"))
+  if(target->GetType() == cmTarget::INTERFACE_LIBRARY
+      || target->Target->GetPropertyAsBool("EXCLUDE_FROM_ALL"))
     {
     // This target is excluded from its directory.
     return true;
@@ -2034,7 +2034,7 @@ bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
     {
     // This target is included in its directory.  Check whether the
     // directory is excluded.
-    return this->IsExcluded(root, target.GetMakefile()->GetLocalGenerator());
+    return this->IsExcluded(root, target->GetLocalGenerator());
     }
 }
 
@@ -2095,15 +2095,16 @@ void cmGlobalGenerator::FillLocalGeneratorToTargetMap()
       {
       cmTarget const& target = t->second;
 
+      cmGeneratorTarget* gt = this->GetGeneratorTarget(&target);
+
       // Consider the directory containing the target and all its
       // parents until something excludes the target.
-      for(cmLocalGenerator* clg = lg; clg && !this->IsExcluded(clg, target);
+      for(cmLocalGenerator* clg = lg; clg && !this->IsExcluded(clg, gt);
           clg = clg->GetParent())
         {
         // This local generator includes the target.
         std::set<cmGeneratorTarget const*>& targetSet =
           this->LocalGeneratorToTargetMap[clg];
-        cmGeneratorTarget* gt = this->GetGeneratorTarget(&target);
         targetSet.insert(gt);
 
         // Add dependencies of the included target.  An excluded
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 9492372..3be76b6 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -398,7 +398,7 @@ protected:
   void FillProjectMap();
   void CheckLocalGenerators();
   bool IsExcluded(cmLocalGenerator* root, cmLocalGenerator* gen) const;
-  bool IsExcluded(cmLocalGenerator* root, cmTarget const& target) const;
+  bool IsExcluded(cmLocalGenerator* root, cmGeneratorTarget* target) const;
   void FillLocalGeneratorToTargetMap();
   void CreateDefaultGlobalTargets(cmTargets* targets);
   cmTarget CreateGlobalTarget(const std::string& name, const char* message,
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index 2a749c1..47822b4 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -289,7 +289,7 @@ public:
   const std::vector<cmLocalGenerator*>& GetLocalGenerators() const {
     return LocalGenerators; }
 
-  bool IsExcluded(cmLocalGenerator* root, cmTarget& target) {
+  bool IsExcluded(cmLocalGenerator* root, cmGeneratorTarget* target) {
     return cmGlobalGenerator::IsExcluded(root, target); }
 
   int GetRuleCmdLength(const std::string& name) {
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 69747a4..76d059ee 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -821,7 +821,7 @@ cmGlobalUnixMakefileGenerator3
                         localName, depends, commands, true);
 
       // add the all/all dependency
-      if(!this->IsExcluded(this->LocalGenerators[0], *gtarget->Target))
+      if(!this->IsExcluded(this->LocalGenerators[0], gtarget))
         {
         depends.clear();
         depends.push_back(localName);
@@ -889,7 +889,7 @@ cmGlobalUnixMakefileGenerator3
                           "Pre-install relink rule for target.",
                           localName, depends, commands, true);
 
-        if(!this->IsExcluded(this->LocalGenerators[0], *gtarget->Target))
+        if(!this->IsExcluded(this->LocalGenerators[0], gtarget))
           {
           depends.clear();
           depends.push_back(localName);
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index 2f9d79a..c06dfb3 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -111,17 +111,18 @@ bool cmGlobalVisualStudioGenerator::Compute()
       for(std::vector<cmLocalGenerator*>::iterator i = gen.begin();
           i != gen.end(); ++i)
         {
-        cmTargets& targets = (*i)->GetMakefile()->GetTargets();
-        for(cmTargets::iterator t = targets.begin();
+        cmGeneratorTargetsType targets =
+            (*i)->GetMakefile()->GetGeneratorTargets();
+        for(cmGeneratorTargetsType::iterator t = targets.begin();
             t != targets.end(); ++t)
           {
-          if (t->second.GetType() == cmTarget::GLOBAL_TARGET)
+          if (t->second->GetType() == cmTarget::GLOBAL_TARGET)
             {
             continue;
             }
           if(!this->IsExcluded(gen[0], t->second))
             {
-            allBuild->AddUtility(t->second.GetName());
+            allBuild->AddUtility(t->second->GetName());
             }
           }
         }
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 9889bd4..1822c97 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -90,7 +90,7 @@ void cmLocalNinjaGenerator::Generate()
       // Add the target to "all" if required.
       if (!this->GetGlobalNinjaGenerator()->IsExcluded(
             this->GetGlobalNinjaGenerator()->GetLocalGenerators()[0],
-            *t->second->Target))
+            t->second))
         this->GetGlobalNinjaGenerator()->AddDependencyToAll(t->second->Target);
       delete tg;
       }

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=756e89674e89efb180380a4b87141ca0e90e6191
commit 756e89674e89efb180380a4b87141ca0e90e6191
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Oct 20 21:02:16 2014 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Aug 2 22:06:05 2015 +0200

    cmGeneratorTarget: Move CompileInfoMap from cmTarget.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index c6f248c..c831704 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1356,6 +1356,46 @@ cmGeneratorTarget::GetMacContentDirectory(const std::string& config,
   return fpath;
 }
 
+
+//----------------------------------------------------------------------------
+cmGeneratorTarget::CompileInfo const* cmGeneratorTarget::GetCompileInfo(
+                                            const std::string& config) const
+{
+  // There is no compile information for imported targets.
+  if(this->IsImported())
+    {
+    return 0;
+    }
+
+  if(this->GetType() > cmTarget::OBJECT_LIBRARY)
+    {
+    std::string msg = "cmTarget::GetCompileInfo called for ";
+    msg += this->GetName();
+    msg += " which has type ";
+    msg += cmTarget::GetTargetTypeName(this->Target->GetType());
+    this->Makefile->IssueMessage(cmake::INTERNAL_ERROR, msg);
+    return 0;
+    }
+
+  // Lookup/compute/cache the compile information for this configuration.
+  std::string config_upper;
+  if(!config.empty())
+    {
+    config_upper = cmSystemTools::UpperCase(config);
+    }
+  CompileInfoMapType::const_iterator i =
+    this->CompileInfoMap.find(config_upper);
+  if(i == this->CompileInfoMap.end())
+    {
+    CompileInfo info;
+    this->Target
+        ->ComputePDBOutputDir("COMPILE_PDB", config, info.CompilePdbDir);
+    CompileInfoMapType::value_type entry(config_upper, info);
+    i = this->CompileInfoMap.insert(entry).first;
+    }
+  return &i->second;
+}
+
 //----------------------------------------------------------------------------
 std::string
 cmGeneratorTarget::GetModuleDefinitionFile(const std::string& config) const
@@ -1827,7 +1867,7 @@ void cmGeneratorTarget::TraceDependencies()
 std::string
 cmGeneratorTarget::GetCompilePDBDirectory(const std::string& config) const
 {
-  if(cmTarget::CompileInfo const* info = this->Target->GetCompileInfo(config))
+  if(CompileInfo const* info = this->GetCompileInfo(config))
     {
     return info->CompilePdbDir;
     }
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index c291919..1d7a411 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -230,6 +230,16 @@ public:
   /** Whether this library has soname enabled and platform supports it.  */
   bool HasSOName(const std::string& config) const;
 
+  struct CompileInfo
+  {
+    std::string CompilePdbDir;
+  };
+
+  CompileInfo const* GetCompileInfo(const std::string& config) const;
+
+  typedef std::map<std::string, CompileInfo> CompileInfoMapType;
+  mutable CompileInfoMapType CompileInfoMap;
+
   /** Get the name of the compiler pdb file for the target.  */
   std::string GetCompilePDBName(const std::string& config="") const;
 
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 9308113..1f8f07a 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -126,9 +126,6 @@ public:
   typedef std::map<std::string, cmTarget::ImportInfo> ImportInfoMapType;
   ImportInfoMapType ImportInfoMap;
 
-  typedef std::map<std::string, cmTarget::CompileInfo> CompileInfoMapType;
-  CompileInfoMapType CompileInfoMap;
-
   // Cache link implementation computation from each configuration.
   struct OptionalLinkImplementation: public cmTarget::LinkImplementation
   {
@@ -2598,45 +2595,6 @@ cmTarget::OutputInfo const* cmTarget::GetOutputInfo(
 }
 
 //----------------------------------------------------------------------------
-cmTarget::CompileInfo const* cmTarget::GetCompileInfo(
-                                            const std::string& config) const
-{
-  // There is no compile information for imported targets.
-  if(this->IsImported())
-    {
-    return 0;
-    }
-
-  if(this->GetType() > cmTarget::OBJECT_LIBRARY)
-    {
-    std::string msg = "cmTarget::GetCompileInfo called for ";
-    msg += this->GetName();
-    msg += " which has type ";
-    msg += cmTarget::GetTargetTypeName(this->GetType());
-    this->GetMakefile()->IssueMessage(cmake::INTERNAL_ERROR, msg);
-    return 0;
-    }
-
-  // Lookup/compute/cache the compile information for this configuration.
-  std::string config_upper;
-  if(!config.empty())
-    {
-    config_upper = cmSystemTools::UpperCase(config);
-    }
-  typedef cmTargetInternals::CompileInfoMapType CompileInfoMapType;
-  CompileInfoMapType::const_iterator i =
-    this->Internal->CompileInfoMap.find(config_upper);
-  if(i == this->Internal->CompileInfoMap.end())
-    {
-    CompileInfo info;
-    this->ComputePDBOutputDir("COMPILE_PDB", config, info.CompilePdbDir);
-    CompileInfoMapType::value_type entry(config_upper, info);
-    i = this->Internal->CompileInfoMap.insert(entry).first;
-    }
-  return &i->second;
-}
-
-//----------------------------------------------------------------------------
 std::string cmTarget::GetDirectory(const std::string& config,
                                    bool implib) const
 {
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 8689838..e3fbdfd 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -626,13 +626,6 @@ private:
   void ComputeImportInfo(std::string const& desired_config,
                          ImportInfo& info) const;
 
-  // Cache target compile paths for each configuration.
-  struct CompileInfo
-  {
-    std::string CompilePdbDir;
-  };
-
-  CompileInfo const* GetCompileInfo(const std::string& config) const;
 
   LinkInterface const*
     GetImportLinkInterface(const std::string& config, cmTarget const* head,

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d96fe03397e73823846626446f1b9dbc11d7ed44
commit d96fe03397e73823846626446f1b9dbc11d7ed44
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Oct 20 20:52:54 2014 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Aug 2 22:06:04 2015 +0200

    cmGeneratorTarget: Move GetCompilePDBDirectory from cmTarget.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index aac941e..c6f248c 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -743,7 +743,7 @@ cmGeneratorTarget::GetCompilePDBName(const std::string& config) const
 std::string
 cmGeneratorTarget::GetCompilePDBPath(const std::string& config) const
 {
-  std::string dir = this->Target->GetCompilePDBDirectory(config);
+  std::string dir = this->GetCompilePDBDirectory(config);
   std::string name = this->GetCompilePDBName(config);
   if(dir.empty() && !name.empty())
     {
@@ -1824,6 +1824,16 @@ void cmGeneratorTarget::TraceDependencies()
   tracer.Trace();
 }
 
+std::string
+cmGeneratorTarget::GetCompilePDBDirectory(const std::string& config) const
+{
+  if(cmTarget::CompileInfo const* info = this->Target->GetCompileInfo(config))
+    {
+    return info->CompilePdbDir;
+    }
+  return "";
+}
+
 //----------------------------------------------------------------------------
 void cmGeneratorTarget::GetAppleArchs(const std::string& config,
                              std::vector<std::string>& archVec) const
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 31b3178..c291919 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -214,6 +214,12 @@ public:
    */
   void TraceDependencies();
 
+  /** Get the directory in which to place the target compiler .pdb file.
+      If the configuration name is given then the generator will add its
+      subdirectory for that configuration.  Otherwise just the canonical
+      compiler pdb output directory is given.  */
+  std::string GetCompilePDBDirectory(const std::string& config = "") const;
+
   /** Get sources that must be built before the given source.  */
   std::vector<cmSourceFile*> const*
   GetSourceDepends(cmSourceFile const* sf) const;
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index afe145a..ccb0974 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -130,7 +130,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
     }
 
   std::string compilePdbOutputPath =
-    this->Target->GetCompilePDBDirectory(this->ConfigName);
+    this->GeneratorTarget->GetCompilePDBDirectory(this->ConfigName);
   cmSystemTools::MakeDirectory(compilePdbOutputPath.c_str());
 
   std::string pdbOutputPath = this->Target->GetPDBDirectory(this->ConfigName);
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index bb0f9dd..2f995e8 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -311,7 +311,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
     }
 
   std::string compilePdbOutputPath =
-    this->Target->GetCompilePDBDirectory(this->ConfigName);
+    this->GeneratorTarget->GetCompilePDBDirectory(this->ConfigName);
   cmSystemTools::MakeDirectory(compilePdbOutputPath.c_str());
 
   std::string pdbOutputPath = this->Target->GetPDBDirectory(this->ConfigName);
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 8b64bc4..9308113 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -69,12 +69,6 @@ struct cmTarget::OutputInfo
 };
 
 //----------------------------------------------------------------------------
-struct cmTarget::CompileInfo
-{
-  std::string CompilePdbDir;
-};
-
-//----------------------------------------------------------------------------
 class cmTargetInternals
 {
 public:
@@ -2673,16 +2667,6 @@ std::string cmTarget::GetPDBDirectory(const std::string& config) const
 }
 
 //----------------------------------------------------------------------------
-std::string cmTarget::GetCompilePDBDirectory(const std::string& config) const
-{
-  if(CompileInfo const* info = this->GetCompileInfo(config))
-    {
-    return info->CompilePdbDir;
-    }
-  return "";
-}
-
-//----------------------------------------------------------------------------
 const char* cmTarget::ImportedGetLocation(const std::string& config) const
 {
   static std::string location;
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index a6f2465..8689838 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -334,12 +334,6 @@ public:
       pdb output directory is given.  */
   std::string GetPDBDirectory(const std::string& config) const;
 
-  /** Get the directory in which to place the target compiler .pdb file.
-      If the configuration name is given then the generator will add its
-      subdirectory for that configuration.  Otherwise just the canonical
-      compiler pdb output directory is given.  */
-  std::string GetCompilePDBDirectory(const std::string& config = "") const;
-
   const char* ImportedGetLocation(const std::string& config) const;
 
   /** Get the target major and minor version numbers interpreted from
@@ -633,7 +627,11 @@ private:
                          ImportInfo& info) const;
 
   // Cache target compile paths for each configuration.
-  struct CompileInfo;
+  struct CompileInfo
+  {
+    std::string CompilePdbDir;
+  };
+
   CompileInfo const* GetCompileInfo(const std::string& config) const;
 
   LinkInterface const*

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=95e71fbe954c252fa8562507f52e2ada01ff160f
commit 95e71fbe954c252fa8562507f52e2ada01ff160f
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 1 07:04:23 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Aug 2 22:06:04 2015 +0200

    cmGeneratorTarget: Move GetOutputName from cmTarget.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 55e2922..aac941e 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -267,6 +267,54 @@ const char *cmGeneratorTarget::GetProperty(const std::string& prop) const
 }
 
 //----------------------------------------------------------------------------
+std::string cmGeneratorTarget::GetOutputName(const std::string& config,
+                                             bool implib) const
+{
+  std::vector<std::string> props;
+  std::string type = this->Target->GetOutputTargetType(implib);
+  std::string configUpper = cmSystemTools::UpperCase(config);
+  if(!type.empty() && !configUpper.empty())
+    {
+    // <ARCHIVE|LIBRARY|RUNTIME>_OUTPUT_NAME_<CONFIG>
+    props.push_back(type + "_OUTPUT_NAME_" + configUpper);
+    }
+  if(!type.empty())
+    {
+    // <ARCHIVE|LIBRARY|RUNTIME>_OUTPUT_NAME
+    props.push_back(type + "_OUTPUT_NAME");
+    }
+  if(!configUpper.empty())
+    {
+    // OUTPUT_NAME_<CONFIG>
+    props.push_back("OUTPUT_NAME_" + configUpper);
+    // <CONFIG>_OUTPUT_NAME
+    props.push_back(configUpper + "_OUTPUT_NAME");
+    }
+  // OUTPUT_NAME
+  props.push_back("OUTPUT_NAME");
+
+  std::string outName;
+  for(std::vector<std::string>::const_iterator i = props.begin();
+      i != props.end(); ++i)
+    {
+    if (const char* outNameProp = this->Target->GetProperty(*i))
+      {
+      outName = outNameProp;
+      break;
+      }
+    }
+
+  if (outName.empty())
+    {
+    outName = this->GetName();
+    }
+
+  cmGeneratorExpression ge;
+  cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(outName);
+  return cge->Evaluate(this->Makefile, config);
+}
+
+//----------------------------------------------------------------------------
 std::vector<cmSourceFile*> const*
 cmGeneratorTarget::GetSourceDepends(cmSourceFile const* sf) const
 {
@@ -922,7 +970,7 @@ std::string cmGeneratorTarget::GetCFBundleDirectory(const std::string& config,
                                                     bool contentOnly) const
 {
   std::string fpath;
-  fpath += this->Target->GetOutputName(config, false);
+  fpath += this->GetOutputName(config, false);
   fpath += ".";
   const char *ext = this->Target->GetProperty("BUNDLE_EXTENSION");
   if (!ext)
@@ -949,7 +997,7 @@ cmGeneratorTarget::GetFrameworkDirectory(const std::string& config,
                                          bool rootDir) const
 {
   std::string fpath;
-  fpath += this->Target->GetOutputName(config, false);
+  fpath += this->GetOutputName(config, false);
   fpath += ".framework";
   if(!rootDir)
     {
@@ -2247,7 +2295,7 @@ void cmGeneratorTarget::GetFullNameInternal(const std::string& config,
   std::string fw_prefix;
   if(this->Target->IsFrameworkOnApple())
     {
-    fw_prefix = this->Target->GetOutputName(config, false);
+    fw_prefix = this->GetOutputName(config, false);
     fw_prefix += ".framework/";
     targetPrefix = fw_prefix.c_str();
     targetSuffix = 0;
@@ -2265,7 +2313,7 @@ void cmGeneratorTarget::GetFullNameInternal(const std::string& config,
   outPrefix = targetPrefix?targetPrefix:"";
 
   // Append the target name or property-specified name.
-  outBase += this->Target->GetOutputName(config, implib);
+  outBase += this->GetOutputName(config, implib);
 
   // Append the per-configuration postfix.
   outBase += configPostfix?configPostfix:"";
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index d10cd1d..31b3178 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -230,6 +230,9 @@ public:
   /** Get the path for the MSVC /Fd option for this target.  */
   std::string GetCompilePDBPath(const std::string& config="") const;
 
+  // Get the target base name.
+  std::string GetOutputName(const std::string& config, bool implib) const;
+
   /**
    * Flags for a given source file as used in this target. Typically assigned
    * via SET_TARGET_PROPERTIES when the property is a list of source files.
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index e887ef3..8b64bc4 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -3663,54 +3663,6 @@ bool cmTarget::UsesDefaultOutputDir(const std::string& config,
 }
 
 //----------------------------------------------------------------------------
-std::string cmTarget::GetOutputName(const std::string& config,
-                                    bool implib) const
-{
-  std::vector<std::string> props;
-  std::string type = this->GetOutputTargetType(implib);
-  std::string configUpper = cmSystemTools::UpperCase(config);
-  if(!type.empty() && !configUpper.empty())
-    {
-    // <ARCHIVE|LIBRARY|RUNTIME>_OUTPUT_NAME_<CONFIG>
-    props.push_back(type + "_OUTPUT_NAME_" + configUpper);
-    }
-  if(!type.empty())
-    {
-    // <ARCHIVE|LIBRARY|RUNTIME>_OUTPUT_NAME
-    props.push_back(type + "_OUTPUT_NAME");
-    }
-  if(!configUpper.empty())
-    {
-    // OUTPUT_NAME_<CONFIG>
-    props.push_back("OUTPUT_NAME_" + configUpper);
-    // <CONFIG>_OUTPUT_NAME
-    props.push_back(configUpper + "_OUTPUT_NAME");
-    }
-  // OUTPUT_NAME
-  props.push_back("OUTPUT_NAME");
-
-  std::string outName;
-  for(std::vector<std::string>::const_iterator i = props.begin();
-      i != props.end(); ++i)
-    {
-    if (const char* outNameProp = this->GetProperty(*i))
-      {
-      outName = outNameProp;
-      break;
-      }
-    }
-
-  if (outName.empty())
-    {
-    outName = this->GetName();
-    }
-
-  cmGeneratorExpression ge;
-  cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(outName);
-  return cge->Evaluate(this->Makefile, config);
-}
-
-//----------------------------------------------------------------------------
 std::string cmTarget::GetFrameworkVersion() const
 {
   assert(this->GetType() != INTERFACE_LIBRARY);
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index e53afff..a6f2465 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -552,9 +552,6 @@ private:
   // Returns ARCHIVE, LIBRARY, or RUNTIME based on platform and type.
   const char* GetOutputTargetType(bool implib) const;
 
-  // Get the target base name.
-  std::string GetOutputName(const std::string& config, bool implib) const;
-
   std::string GetFullNameImported(const std::string& config,
                                   bool implib) const;
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ebef362af12f7be46edfce4af9e93e124ece17e3
commit ebef362af12f7be46edfce4af9e93e124ece17e3
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Jul 30 00:45:34 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Aug 2 22:06:04 2015 +0200

    cmComputeLinkDepends: Port to cmGeneratorTarget.

diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index abd9877..8ba8847 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -173,18 +173,19 @@ items that we know the linker will re-use automatically (shared libs).
 
 //----------------------------------------------------------------------------
 cmComputeLinkDepends
-::cmComputeLinkDepends(cmTarget const* target, const std::string& config)
+::cmComputeLinkDepends(const cmGeneratorTarget* target,
+                       const std::string& config)
 {
   // Store context information.
   this->Target = target;
-  this->Makefile = this->Target->GetMakefile();
+  this->Makefile = this->Target->Target->GetMakefile();
   this->GlobalGenerator = this->Makefile->GetGlobalGenerator();
   this->CMakeInstance = this->GlobalGenerator->GetCMakeInstance();
 
   // The configuration being linked.
   this->HasConfig = !config.empty();
   this->Config = (this->HasConfig)? config : std::string();
-  this->LinkType = this->Target->ComputeLinkType(this->Config);
+  this->LinkType = this->Target->Target->ComputeLinkType(this->Config);
 
   // Enable debug mode if requested.
   this->DebugMode = this->Makefile->IsOn("CMAKE_LINK_DEPENDS_DEBUG_MODE");
@@ -363,7 +364,7 @@ void cmComputeLinkDepends::FollowLinkEntry(BFSEntry const& qe)
     {
     // Follow the target dependencies.
     if(cmTarget::LinkInterface const* iface =
-       entry.Target->GetLinkInterface(this->Config, this->Target))
+       entry.Target->GetLinkInterface(this->Config, this->Target->Target))
       {
       const bool isIface =
                       entry.Target->GetType() == cmTarget::INTERFACE_LIBRARY;
@@ -461,7 +462,7 @@ void cmComputeLinkDepends::HandleSharedDependency(SharedDepEntry const& dep)
   if(entry.Target)
     {
     if(cmTarget::LinkInterface const* iface =
-       entry.Target->GetLinkInterface(this->Config, this->Target))
+       entry.Target->GetLinkInterface(this->Config, this->Target->Target))
       {
       // Follow public and private dependencies transitively.
       this->FollowSharedDeps(index, iface, true);
@@ -552,7 +553,7 @@ void cmComputeLinkDepends::AddDirectLinkEntries()
 {
   // Add direct link dependencies in this configuration.
   cmTarget::LinkImplementation const* impl =
-    this->Target->GetLinkImplementation(this->Config);
+    this->Target->Target->GetLinkImplementation(this->Config);
   this->AddLinkEntries(-1, impl->Libraries);
   for(std::vector<cmLinkItem>::const_iterator
         wi = impl->WrongConfigLibraries.begin();
@@ -634,7 +635,7 @@ cmTarget const* cmComputeLinkDepends::FindTargetToLink(int depender_index,
                                                  const std::string& name)
 {
   // Look for a target in the scope of the depender.
-  cmTarget const* from = this->Target;
+  cmTarget const* from = this->Target->Target;
   if(depender_index >= 0)
     {
     if(cmTarget const* depender = this->EntryList[depender_index].Target)
@@ -932,7 +933,7 @@ int cmComputeLinkDepends::ComputeComponentCount(NodeList const& nl)
     if(cmTarget const* target = this->EntryList[*ni].Target)
       {
       if(cmTarget::LinkInterface const* iface =
-         target->GetLinkInterface(this->Config, this->Target))
+         target->GetLinkInterface(this->Config, this->Target->Target))
         {
         if(iface->Multiplicity > count)
           {
diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h
index 51a08c5..b925a4f 100644
--- a/Source/cmComputeLinkDepends.h
+++ b/Source/cmComputeLinkDepends.h
@@ -22,6 +22,7 @@
 class cmComputeComponentGraph;
 class cmGlobalGenerator;
 class cmMakefile;
+class cmGeneratorTarget;
 class cmTarget;
 class cmake;
 
@@ -31,7 +32,8 @@ class cmake;
 class cmComputeLinkDepends
 {
 public:
-  cmComputeLinkDepends(cmTarget const* target, const std::string& config);
+  cmComputeLinkDepends(cmGeneratorTarget const* target,
+                       const std::string& config);
   ~cmComputeLinkDepends();
 
   // Basic information about each link item.
@@ -57,7 +59,7 @@ public:
 private:
 
   // Context information.
-  cmTarget const* Target;
+  cmGeneratorTarget const* Target;
   cmMakefile* Makefile;
   cmGlobalGenerator const* GlobalGenerator;
   cmake* CMakeInstance;
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index fb89319..5cd0d54 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -497,7 +497,7 @@ bool cmComputeLinkInformation::Compute()
     }
 
   // Compute the ordered link line items.
-  cmComputeLinkDepends cld(this->Target->Target, this->Config);
+  cmComputeLinkDepends cld(this->Target, this->Config);
   cld.SetOldLinkDirMode(this->OldLinkDirMode);
   cmComputeLinkDepends::EntryVector const& linkEntries = cld.Compute();
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=520d76306f8eca0b3b6792e6734deb7f893d23a2
commit 520d76306f8eca0b3b6792e6734deb7f893d23a2
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Jul 30 00:41:27 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Aug 2 22:06:04 2015 +0200

    cmComputeLinkInformation: Port to cmGeneratorTarget.

diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index f03c04a..fb89319 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -242,11 +242,12 @@ because this need be done only for shared libraries without soname-s.
 
 //----------------------------------------------------------------------------
 cmComputeLinkInformation
-::cmComputeLinkInformation(cmTarget const* target, const std::string& config)
+::cmComputeLinkInformation(const cmGeneratorTarget* target,
+                           const std::string& config)
 {
   // Store context information.
   this->Target = target;
-  this->Makefile = this->Target->GetMakefile();
+  this->Makefile = this->Target->Target->GetMakefile();
   this->GlobalGenerator = this->Makefile->GetGlobalGenerator();
   this->CMakeInstance = this->GlobalGenerator->GetCMakeInstance();
 
@@ -259,17 +260,15 @@ cmComputeLinkInformation
 
   // Allocate internals.
   this->OrderLinkerSearchPath =
-    new cmOrderDirectories(this->GlobalGenerator, target,
+    new cmOrderDirectories(this->GlobalGenerator, target->Target,
                            "linker search path");
   this->OrderRuntimeSearchPath =
-    new cmOrderDirectories(this->GlobalGenerator, target,
+    new cmOrderDirectories(this->GlobalGenerator, target->Target,
                            "runtime search path");
   this->OrderDependentRPath = 0;
 
-  cmGeneratorTarget *gtgt = this->GlobalGenerator
-                                ->GetGeneratorTarget(this->Target);
   // Get the language used for linking this target.
-  this->LinkLanguage = gtgt->GetLinkerLanguage(config);
+  this->LinkLanguage = this->Target->GetLinkerLanguage(config);
   if(this->LinkLanguage.empty())
     {
     // The Compute method will do nothing, so skip the rest of the
@@ -283,14 +282,14 @@ cmComputeLinkInformation
 
   // Check whether we should skip dependencies on shared library files.
   this->LinkDependsNoShared =
-    this->Target->GetPropertyAsBool("LINK_DEPENDS_NO_SHARED");
+    this->Target->Target->GetPropertyAsBool("LINK_DEPENDS_NO_SHARED");
 
   // On platforms without import libraries there may be a special flag
   // to use when creating a plugin (module) that obtains symbols from
   // the program that will load it.
   this->LoaderFlag = 0;
   if(!this->UseImportLibrary &&
-     this->Target->GetType() == cmTarget::MODULE_LIBRARY)
+     this->Target->Target->GetType() == cmTarget::MODULE_LIBRARY)
     {
     std::string loader_flag_var = "CMAKE_SHARED_MODULE_LOADER_";
     loader_flag_var += this->LinkLanguage;
@@ -308,10 +307,10 @@ cmComputeLinkInformation
 
   // Get options needed to specify RPATHs.
   this->RuntimeUseChrpath = false;
-  if(this->Target->GetType() != cmTarget::STATIC_LIBRARY)
+  if(this->Target->Target->GetType() != cmTarget::STATIC_LIBRARY)
     {
     const char* tType =
-      ((this->Target->GetType() == cmTarget::EXECUTABLE)?
+      ((this->Target->Target->GetType() == cmTarget::EXECUTABLE)?
        "EXECUTABLE" : "SHARED_LIBRARY");
     std::string rtVar = "CMAKE_";
     rtVar += tType;
@@ -325,7 +324,7 @@ cmComputeLinkInformation
       (this->Makefile->
        GetSafeDefinition("CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH"));
 
-    this->RuntimeUseChrpath = gtgt->IsChrpathUsed(config);
+    this->RuntimeUseChrpath = this->Target->IsChrpathUsed(config);
 
     // Get options needed to help find dependent libraries.
     std::string rlVar = "CMAKE_";
@@ -371,15 +370,15 @@ cmComputeLinkInformation
     {
     this->SharedDependencyMode = SharedDepModeDir;
     this->OrderDependentRPath =
-      new cmOrderDirectories(this->GlobalGenerator, target,
+      new cmOrderDirectories(this->GlobalGenerator, target->Target,
                              "dependent library path");
     }
 
   // Add the search path entries requested by the user to path ordering.
   this->OrderLinkerSearchPath
-    ->AddUserDirectories(this->Target->GetLinkDirectories());
+    ->AddUserDirectories(this->Target->Target->GetLinkDirectories());
   this->OrderRuntimeSearchPath
-    ->AddUserDirectories(this->Target->GetLinkDirectories());
+    ->AddUserDirectories(this->Target->Target->GetLinkDirectories());
 
   // Set up the implicit link directories.
   this->LoadImplicitLinkInfo();
@@ -407,12 +406,13 @@ cmComputeLinkInformation
   // order to support such projects we need to add the directories
   // containing libraries linked with a full path to the -L path.
   this->OldLinkDirMode =
-    this->Target->GetPolicyStatusCMP0003() != cmPolicies::NEW;
+    this->Target->Target->GetPolicyStatusCMP0003() != cmPolicies::NEW;
   if(this->OldLinkDirMode)
     {
     // Construct a mask to not bother with this behavior for link
     // directories already specified by the user.
-    std::vector<std::string> const& dirs = this->Target->GetLinkDirectories();
+    std::vector<std::string> const& dirs =
+        this->Target->Target->GetLinkDirectories();
     this->OldLinkDirMask.insert(dirs.begin(), dirs.end());
     }
 
@@ -497,7 +497,7 @@ bool cmComputeLinkInformation::Compute()
     }
 
   // Compute the ordered link line items.
-  cmComputeLinkDepends cld(this->Target, this->Config);
+  cmComputeLinkDepends cld(this->Target->Target, this->Config);
   cld.SetOldLinkDirMode(this->OldLinkDirMode);
   cmComputeLinkDepends::EntryVector const& linkEntries = cld.Compute();
 
@@ -518,7 +518,8 @@ bool cmComputeLinkInformation::Compute()
 
   // Restore the target link type so the correct system runtime
   // libraries are found.
-  const char* lss = this->Target->GetProperty("LINK_SEARCH_END_STATIC");
+  const char* lss =
+      this->Target->Target->GetProperty("LINK_SEARCH_END_STATIC");
   if(cmSystemTools::IsOn(lss))
     {
     this->SetCurrentLinkType(LinkStatic);
@@ -571,7 +572,7 @@ bool cmComputeLinkInformation::Compute()
       "name."
       ;
     this->CMakeInstance->IssueMessage(cmake::AUTHOR_WARNING, w.str(),
-                                      this->Target->GetBacktrace());
+                                      this->Target->Target->GetBacktrace());
     }
 
   return true;
@@ -580,12 +581,9 @@ bool cmComputeLinkInformation::Compute()
 //----------------------------------------------------------------------------
 void cmComputeLinkInformation::AddImplicitLinkInfo()
 {
-  cmGeneratorTarget *gtgt = this->Target->GetMakefile()
-                                ->GetGlobalGenerator()
-                                ->GetGeneratorTarget(this->Target);
-
   // The link closure lists all languages whose implicit info is needed.
-  cmGeneratorTarget::LinkClosure const* lc=gtgt->GetLinkClosure(this->Config);
+  cmGeneratorTarget::LinkClosure const* lc =
+      this->Target->GetLinkClosure(this->Config);
   for(std::vector<std::string>::const_iterator li = lc->Languages.begin();
       li != lc->Languages.end(); ++li)
     {
@@ -863,7 +861,8 @@ void cmComputeLinkInformation::ComputeLinkTypeInfo()
     }
 
   // Lookup the starting link type from the target (linked statically?).
-  const char* lss = this->Target->GetProperty("LINK_SEARCH_START_STATIC");
+  const char* lss =
+      this->Target->Target->GetProperty("LINK_SEARCH_START_STATIC");
   this->StartLinkType = cmSystemTools::IsOn(lss)? LinkStatic : LinkShared;
   this->CurrentLinkType = this->StartLinkType;
 }
@@ -1149,7 +1148,7 @@ void cmComputeLinkInformation::AddFullItem(std::string const& item)
   // Full path libraries should specify a valid library file name.
   // See documentation of CMP0008.
   std::string generator = this->GlobalGenerator->GetName();
-  if(this->Target->GetPolicyStatusCMP0008() != cmPolicies::NEW &&
+  if(this->Target->Target->GetPolicyStatusCMP0008() != cmPolicies::NEW &&
      (generator.find("Visual Studio") != generator.npos ||
       generator.find("Xcode") != generator.npos))
     {
@@ -1230,7 +1229,7 @@ bool cmComputeLinkInformation::CheckImplicitDirItem(std::string const& item)
     }
 
   // Check the policy for whether we should use the approach below.
-  switch (this->Target->GetPolicyStatusCMP0060())
+  switch (this->Target->Target->GetPolicyStatusCMP0060())
     {
     case cmPolicies::WARN:
       if (this->CMP0060Warn)
@@ -1540,7 +1539,7 @@ void cmComputeLinkInformation::HandleBadFullItem(std::string const& item,
   this->OrderLinkerSearchPath->AddLinkLibrary(item);
 
   // Produce any needed message.
-  switch(this->Target->GetPolicyStatusCMP0008())
+  switch(this->Target->Target->GetPolicyStatusCMP0008())
     {
     case cmPolicies::WARN:
       {
@@ -1557,7 +1556,7 @@ void cmComputeLinkInformation::HandleBadFullItem(std::string const& item,
           << "  " << item << "\n"
           << "which is a full-path but not a valid library file name.";
         this->CMakeInstance->IssueMessage(cmake::AUTHOR_WARNING, w.str(),
-                                          this->Target->GetBacktrace());
+                                        this->Target->Target->GetBacktrace());
         }
       }
     case cmPolicies::OLD:
@@ -1575,7 +1574,7 @@ void cmComputeLinkInformation::HandleBadFullItem(std::string const& item,
           << "  " << item << "\n"
           << "which is a full-path but not a valid library file name.";
       this->CMakeInstance->IssueMessage(cmake::FATAL_ERROR, e.str(),
-                                        this->Target->GetBacktrace());
+                                        this->Target->Target->GetBacktrace());
       }
       break;
     }
@@ -1592,7 +1591,7 @@ bool cmComputeLinkInformation::FinishLinkerSearchDirectories()
     }
 
   // Enforce policy constraints.
-  switch(this->Target->GetPolicyStatusCMP0003())
+  switch(this->Target->Target->GetPolicyStatusCMP0003())
     {
     case cmPolicies::WARN:
       if(!this->CMakeInstance->GetState()
@@ -1603,7 +1602,7 @@ bool cmComputeLinkInformation::FinishLinkerSearchDirectories()
         std::ostringstream w;
         this->PrintLinkPolicyDiagnosis(w);
         this->CMakeInstance->IssueMessage(cmake::AUTHOR_WARNING, w.str(),
-                                          this->Target->GetBacktrace());
+                                        this->Target->Target->GetBacktrace());
         }
     case cmPolicies::OLD:
       // OLD behavior is to add the paths containing libraries with
@@ -1619,7 +1618,7 @@ bool cmComputeLinkInformation::FinishLinkerSearchDirectories()
       e << cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0003) << "\n";
       this->PrintLinkPolicyDiagnosis(e);
       this->CMakeInstance->IssueMessage(cmake::FATAL_ERROR, e.str(),
-                                        this->Target->GetBacktrace());
+                                        this->Target->Target->GetBacktrace());
       return false;
       }
     }
@@ -1923,23 +1922,24 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
   // build tree.
   bool linking_for_install =
     (for_install ||
-     this->Target->GetPropertyAsBool("BUILD_WITH_INSTALL_RPATH"));
+     this->Target->Target->GetPropertyAsBool("BUILD_WITH_INSTALL_RPATH"));
   bool use_install_rpath =
-    (outputRuntime && this->Target->HaveInstallTreeRPATH() &&
+    (outputRuntime && this->Target->Target->HaveInstallTreeRPATH() &&
      linking_for_install);
   bool use_build_rpath =
-    (outputRuntime && this->Target->HaveBuildTreeRPATH(this->Config) &&
+    (outputRuntime && this->Target->Target->HaveBuildTreeRPATH(this->Config) &&
      !linking_for_install);
   bool use_link_rpath =
     outputRuntime && linking_for_install &&
     !this->Makefile->IsOn("CMAKE_SKIP_INSTALL_RPATH") &&
-    this->Target->GetPropertyAsBool("INSTALL_RPATH_USE_LINK_PATH");
+    this->Target->Target->GetPropertyAsBool("INSTALL_RPATH_USE_LINK_PATH");
 
   // Construct the RPATH.
   std::set<std::string> emitted;
   if(use_install_rpath)
     {
-    const char* install_rpath = this->Target->GetProperty("INSTALL_RPATH");
+    const char* install_rpath =
+        this->Target->Target->GetProperty("INSTALL_RPATH");
     cmCLI_ExpandListUnique(install_rpath, runtimeDirs, emitted);
     }
   if(use_build_rpath || use_link_rpath)
@@ -2011,12 +2011,8 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
   // Add runtime paths required by the languages to always be
   // present.  This is done even when skipping rpath support.
   {
-  cmGeneratorTarget *gtgt = this->Makefile
-                                ->GetGlobalGenerator()
-                                ->GetGeneratorTarget(this->Target);
-
   cmGeneratorTarget::LinkClosure const* lc =
-    gtgt->GetLinkClosure(this->Config);
+    this->Target->GetLinkClosure(this->Config);
   for(std::vector<std::string>::const_iterator li = lc->Languages.begin();
       li != lc->Languages.end(); ++li)
     {
diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h
index 2d7a5a5..8b83574 100644
--- a/Source/cmComputeLinkInformation.h
+++ b/Source/cmComputeLinkInformation.h
@@ -29,7 +29,8 @@ class cmOrderDirectories;
 class cmComputeLinkInformation
 {
 public:
-  cmComputeLinkInformation(cmTarget const* target, const std::string& config);
+  cmComputeLinkInformation(cmGeneratorTarget const* target,
+                           const std::string& config);
   ~cmComputeLinkInformation();
   bool Compute();
 
@@ -73,7 +74,7 @@ private:
   std::set<cmTarget const*> SharedLibrariesLinked;
 
   // Context information.
-  cmTarget const* Target;
+  cmGeneratorTarget const* Target;
   cmMakefile* Makefile;
   cmGlobalGenerator* GlobalGenerator;
   cmake* CMakeInstance;
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index c68c2b9..55e2922 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -3166,7 +3166,7 @@ cmGeneratorTarget::GetLinkInformation(const std::string& config) const
     {
     // Compute information for this configuration.
     cmComputeLinkInformation* info =
-      new cmComputeLinkInformation(this->Target, config);
+      new cmComputeLinkInformation(this, config);
     if(!info || !info->Compute())
       {
       delete info;

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=57c42044578479ca3e734eb251728627dfcb8c9a
commit 57c42044578479ca3e734eb251728627dfcb8c9a
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Jul 28 23:16:43 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Aug 2 22:06:04 2015 +0200

    cmGeneratorTarget: Move IsBundleOnApple from cmTarget.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index c314372..c68c2b9 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -910,6 +910,14 @@ cmGeneratorTarget::GetAppBundleDirectory(const std::string& config,
 }
 
 //----------------------------------------------------------------------------
+bool cmGeneratorTarget::IsBundleOnApple() const
+{
+  return this->Target->IsFrameworkOnApple()
+      || this->Target->IsAppBundleOnApple()
+      || this->Target->IsCFBundleOnApple();
+}
+
+//----------------------------------------------------------------------------
 std::string cmGeneratorTarget::GetCFBundleDirectory(const std::string& config,
                                                     bool contentOnly) const
 {
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 4299053..d10cd1d 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -119,6 +119,10 @@ public:
   std::string GetAppBundleDirectory(const std::string& config,
                                     bool contentOnly) const;
 
+  /** Return whether this target is an executable Bundle, a framework
+      or CFBundle on Apple.  */
+  bool IsBundleOnApple() const;
+
   /** Get the full name of the target according to the settings in its
       makefile.  */
   std::string GetFullName(const std::string& config="",
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index d38cf4c..0b3df90 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -313,7 +313,7 @@ cmMakefileTargetGenerator::MacOSXContentGeneratorType::operator()
   (cmSourceFile const& source, const char* pkgloc)
 {
   // Skip OS X content when not building a Framework or Bundle.
-  if(!this->Generator->GetTarget()->IsBundleOnApple())
+  if(!this->Generator->GetGeneratorTarget()->IsBundleOnApple())
     {
     return;
     }
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 16e1f48..07efa16 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -742,7 +742,7 @@ cmNinjaTargetGenerator::MacOSXContentGeneratorType::operator()(
   cmSourceFile const& source, const char* pkgloc)
 {
   // Skip OS X content when not building a Framework or Bundle.
-  if(!this->Generator->GetTarget()->IsBundleOnApple())
+  if(!this->Generator->GetGeneratorTarget()->IsBundleOnApple())
     {
     return;
     }
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 62aa12a..e887ef3 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -590,13 +590,6 @@ bool cmTarget::IsXCTestOnApple() const
 }
 
 //----------------------------------------------------------------------------
-bool cmTarget::IsBundleOnApple() const
-{
-  return this->IsFrameworkOnApple() || this->IsAppBundleOnApple() ||
-         this->IsCFBundleOnApple();
-}
-
-//----------------------------------------------------------------------------
 static bool processSources(cmTarget const* tgt,
       const std::vector<cmTargetInternals::TargetPropertyEntry*> &entries,
       std::vector<std::string> &srcs,
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 9a4915f..e53afff 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -424,10 +424,6 @@ public:
   /** Return whether this target is an executable Bundle on Apple.  */
   bool IsAppBundleOnApple() const;
 
-  /** Return whether this target is an executable Bundle, a framework
-      or CFBundle on Apple.  */
-  bool IsBundleOnApple() const;
-
   /** Return the framework version string.  Undefined if
       IsFrameworkOnApple returns false.  */
   std::string GetFrameworkVersion() const;

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=83bfb2dfe55e77b9a3d0e655bd30aa23399c29e6
commit 83bfb2dfe55e77b9a3d0e655bd30aa23399c29e6
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Jul 28 23:18:55 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Aug 2 22:06:03 2015 +0200

    cmMakefileTargetGenerator: Add accessor for GeneratorTarget.

diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h
index b885672..fd4527b 100644
--- a/Source/cmMakefileTargetGenerator.h
+++ b/Source/cmMakefileTargetGenerator.h
@@ -53,6 +53,7 @@ public:
     { return this->ProgressFileNameFull; }
 
   cmTarget* GetTarget() { return this->Target;}
+  cmGeneratorTarget* GetGeneratorTarget() { return this->GeneratorTarget;}
 
 protected:
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3bb7b1f045b47e4f83ed2c9e07cc9bfc4285be7c
commit 3bb7b1f045b47e4f83ed2c9e07cc9bfc4285be7c
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 10 21:43:28 2012 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Aug 2 22:06:03 2015 +0200

    cmGeneratorTarget: Move GetLinkClosure from cmTarget.

diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index 640e806..f03c04a 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -19,6 +19,7 @@
 #include "cmOutputConverter.h"
 #include "cmMakefile.h"
 #include "cmTarget.h"
+#include "cmGeneratorTarget.h"
 #include "cmake.h"
 #include "cmAlgorithms.h"
 
@@ -579,8 +580,12 @@ bool cmComputeLinkInformation::Compute()
 //----------------------------------------------------------------------------
 void cmComputeLinkInformation::AddImplicitLinkInfo()
 {
+  cmGeneratorTarget *gtgt = this->Target->GetMakefile()
+                                ->GetGlobalGenerator()
+                                ->GetGeneratorTarget(this->Target);
+
   // The link closure lists all languages whose implicit info is needed.
-  cmTarget::LinkClosure const* lc=this->Target->GetLinkClosure(this->Config);
+  cmGeneratorTarget::LinkClosure const* lc=gtgt->GetLinkClosure(this->Config);
   for(std::vector<std::string>::const_iterator li = lc->Languages.begin();
       li != lc->Languages.end(); ++li)
     {
@@ -2006,8 +2011,12 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
   // Add runtime paths required by the languages to always be
   // present.  This is done even when skipping rpath support.
   {
-  cmTarget::LinkClosure const* lc =
-    this->Target->GetLinkClosure(this->Config);
+  cmGeneratorTarget *gtgt = this->Makefile
+                                ->GetGlobalGenerator()
+                                ->GetGeneratorTarget(this->Target);
+
+  cmGeneratorTarget::LinkClosure const* lc =
+    gtgt->GetLinkClosure(this->Config);
   for(std::vector<std::string>::const_iterator li = lc->Languages.begin();
       li != lc->Languages.end(); ++li)
     {
diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h
index 3afbb92..2d7a5a5 100644
--- a/Source/cmComputeLinkInformation.h
+++ b/Source/cmComputeLinkInformation.h
@@ -20,6 +20,7 @@ class cmake;
 class cmGlobalGenerator;
 class cmMakefile;
 class cmTarget;
+class cmGeneratorTarget;
 class cmOrderDirectories;
 
 /** \class cmComputeLinkInformation
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 4de5e9c..c314372 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -27,6 +27,13 @@
 #include <errno.h>
 #include "assert.h"
 
+#if defined(CMAKE_BUILD_WITH_CMAKE)
+#include <cmsys/hash_set.hxx>
+#define UNORDERED_SET cmsys::hash_set
+#else
+#define UNORDERED_SET std::set
+#endif
+
 //----------------------------------------------------------------------------
 void reportBadObjLib(std::vector<cmSourceFile*> const& badObjLib,
                      cmTarget *target, cmake *cm)
@@ -1026,6 +1033,223 @@ std::string cmGeneratorTarget::GetInstallNameDirForInstallTree() const
 }
 
 //----------------------------------------------------------------------------
+class cmTargetCollectLinkLanguages
+{
+public:
+  cmTargetCollectLinkLanguages(cmGeneratorTarget const* target,
+                               const std::string& config,
+                               UNORDERED_SET<std::string>& languages,
+                               cmTarget const* head):
+    Config(config), Languages(languages), HeadTarget(head),
+    Makefile(target->Target->GetMakefile()), Target(target)
+  { this->Visited.insert(target->Target); }
+
+  void Visit(cmLinkItem const& item)
+    {
+    if(!item.Target)
+      {
+      if(item.find("::") != std::string::npos)
+        {
+        bool noMessage = false;
+        cmake::MessageType messageType = cmake::FATAL_ERROR;
+        std::stringstream e;
+        switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0028))
+          {
+          case cmPolicies::WARN:
+            {
+            e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0028) << "\n";
+            messageType = cmake::AUTHOR_WARNING;
+            }
+            break;
+          case cmPolicies::OLD:
+            noMessage = true;
+          case cmPolicies::REQUIRED_IF_USED:
+          case cmPolicies::REQUIRED_ALWAYS:
+          case cmPolicies::NEW:
+            // Issue the fatal message.
+            break;
+          }
+
+        if(!noMessage)
+          {
+          e << "Target \"" << this->Target->GetName()
+            << "\" links to target \"" << item
+            << "\" but the target was not found.  Perhaps a find_package() "
+            "call is missing for an IMPORTED target, or an ALIAS target is "
+            "missing?";
+          this->Makefile->GetCMakeInstance()->IssueMessage(
+            messageType, e.str(), this->Target->Target->GetBacktrace());
+          }
+        }
+      return;
+      }
+    if(!this->Visited.insert(item.Target).second)
+      {
+      return;
+      }
+
+    cmTarget::LinkInterface const* iface =
+      item.Target->GetLinkInterface(this->Config, this->HeadTarget);
+    if(!iface) { return; }
+
+    for(std::vector<std::string>::const_iterator
+          li = iface->Languages.begin(); li != iface->Languages.end(); ++li)
+      {
+      this->Languages.insert(*li);
+      }
+
+    for(std::vector<cmLinkItem>::const_iterator
+          li = iface->Libraries.begin(); li != iface->Libraries.end(); ++li)
+      {
+      this->Visit(*li);
+      }
+    }
+private:
+  std::string Config;
+  UNORDERED_SET<std::string>& Languages;
+  cmTarget const* HeadTarget;
+  cmMakefile* Makefile;
+  const cmGeneratorTarget* Target;
+  std::set<cmTarget const*> Visited;
+};
+
+//----------------------------------------------------------------------------
+cmGeneratorTarget::LinkClosure const*
+cmGeneratorTarget::GetLinkClosure(const std::string& config) const
+{
+  std::string key(cmSystemTools::UpperCase(config));
+  LinkClosureMapType::iterator
+    i = this->LinkClosureMap.find(key);
+  if(i == this->LinkClosureMap.end())
+    {
+    LinkClosure lc;
+    this->ComputeLinkClosure(config, lc);
+    LinkClosureMapType::value_type entry(key, lc);
+    i = this->LinkClosureMap.insert(entry).first;
+    }
+  return &i->second;
+}
+
+//----------------------------------------------------------------------------
+class cmTargetSelectLinker
+{
+  int Preference;
+  cmGeneratorTarget const* Target;
+  cmMakefile* Makefile;
+  cmGlobalGenerator* GG;
+  std::set<std::string> Preferred;
+public:
+  cmTargetSelectLinker(cmGeneratorTarget const* target)
+      : Preference(0), Target(target)
+    {
+    this->Makefile = this->Target->Makefile;
+    this->GG = this->Makefile->GetGlobalGenerator();
+    }
+  void Consider(const char* lang)
+    {
+    int preference = this->GG->GetLinkerPreference(lang);
+    if(preference > this->Preference)
+      {
+      this->Preference = preference;
+      this->Preferred.clear();
+      }
+    if(preference == this->Preference)
+      {
+      this->Preferred.insert(lang);
+      }
+    }
+  std::string Choose()
+    {
+    if(this->Preferred.empty())
+      {
+      return "";
+      }
+    else if(this->Preferred.size() > 1)
+      {
+      std::stringstream e;
+      e << "Target " << this->Target->GetName()
+        << " contains multiple languages with the highest linker preference"
+        << " (" << this->Preference << "):\n";
+      for(std::set<std::string>::const_iterator
+            li = this->Preferred.begin(); li != this->Preferred.end(); ++li)
+        {
+        e << "  " << *li << "\n";
+        }
+      e << "Set the LINKER_LANGUAGE property for this target.";
+      cmake* cm = this->Makefile->GetCMakeInstance();
+      cm->IssueMessage(cmake::FATAL_ERROR, e.str(),
+                       this->Target->Target->GetBacktrace());
+      }
+    return *this->Preferred.begin();
+    }
+};
+
+//----------------------------------------------------------------------------
+void cmGeneratorTarget::ComputeLinkClosure(const std::string& config,
+                                           LinkClosure& lc) const
+{
+  // Get languages built in this target.
+  UNORDERED_SET<std::string> languages;
+  cmTarget::LinkImplementation const* impl =
+                            this->Target->GetLinkImplementation(config);
+  for(std::vector<std::string>::const_iterator li = impl->Languages.begin();
+      li != impl->Languages.end(); ++li)
+    {
+    languages.insert(*li);
+    }
+
+  // Add interface languages from linked targets.
+  cmTargetCollectLinkLanguages cll(this, config, languages, this->Target);
+  for(std::vector<cmLinkImplItem>::const_iterator li = impl->Libraries.begin();
+      li != impl->Libraries.end(); ++li)
+    {
+    cll.Visit(*li);
+    }
+
+  // Store the transitive closure of languages.
+  for(UNORDERED_SET<std::string>::const_iterator li = languages.begin();
+      li != languages.end(); ++li)
+    {
+    lc.Languages.push_back(*li);
+    }
+
+  // Choose the language whose linker should be used.
+  if(this->GetProperty("HAS_CXX"))
+    {
+    lc.LinkerLanguage = "CXX";
+    }
+  else if(const char* linkerLang = this->GetProperty("LINKER_LANGUAGE"))
+    {
+    lc.LinkerLanguage = linkerLang;
+    }
+  else
+    {
+    // Find the language with the highest preference value.
+    cmTargetSelectLinker tsl(this);
+
+    // First select from the languages compiled directly in this target.
+    for(std::vector<std::string>::const_iterator li = impl->Languages.begin();
+        li != impl->Languages.end(); ++li)
+      {
+      tsl.Consider(li->c_str());
+      }
+
+    // Now consider languages that propagate from linked targets.
+    for(UNORDERED_SET<std::string>::const_iterator sit = languages.begin();
+        sit != languages.end(); ++sit)
+      {
+      std::string propagates = "CMAKE_"+*sit+"_LINKER_PREFERENCE_PROPAGATES";
+      if(this->Makefile->IsOn(propagates))
+        {
+        tsl.Consider(sit->c_str());
+        }
+      }
+
+    lc.LinkerLanguage = tsl.Choose();
+    }
+}
+
+//----------------------------------------------------------------------------
 void cmGeneratorTarget::GetFullNameComponents(std::string& prefix,
                                               std::string& base,
                                               std::string& suffix,
@@ -2058,7 +2282,7 @@ void cmGeneratorTarget::GetFullNameInternal(const std::string& config,
 std::string
 cmGeneratorTarget::GetLinkerLanguage(const std::string& config) const
 {
-  return this->Target->GetLinkClosure(config)->LinkerLanguage;
+  return this->GetLinkClosure(config)->LinkerLanguage;
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 2799371..4299053 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -165,6 +165,20 @@ public:
 
   std::string GetModuleDefinitionFile(const std::string& config) const;
 
+  /** Link information from the transitive closure of the link
+      implementation and the interfaces of its dependencies.  */
+  struct LinkClosure
+  {
+    // The preferred linker language.
+    std::string LinkerLanguage;
+
+    // Languages whose runtime libraries must be linked.
+    std::vector<std::string> Languages;
+  };
+
+  LinkClosure const* GetLinkClosure(const std::string& config) const;
+  void ComputeLinkClosure(const std::string& config, LinkClosure& lc) const;
+
   /** Full path with trailing slash to the top-level directory
       holding object files for this target.  Includes the build
       time config name placeholder if needed for the generator.  */
@@ -300,6 +314,9 @@ private:
                            std::string& outPrefix, std::string& outBase,
                            std::string& outSuffix) const;
 
+  typedef std::map<std::string, LinkClosure> LinkClosureMapType;
+  mutable LinkClosureMapType LinkClosureMap;
+
   struct CompatibleInterfacesBase
   {
     std::set<std::string> PropsBool;
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index c7118dc..62aa12a 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -160,9 +160,6 @@ public:
                    HeadToLinkImplementationMap> LinkImplMapType;
   LinkImplMapType LinkImplMap;
 
-  typedef std::map<std::string, cmTarget::LinkClosure> LinkClosureMapType;
-  LinkClosureMapType LinkClosureMap;
-
   typedef std::map<std::string, std::vector<cmSourceFile*> >
                                                        SourceFilesMapType;
   SourceFilesMapType SourceFilesMap;
@@ -511,7 +508,6 @@ void cmTarget::ClearLinkMaps()
   this->Internal->LinkImplMap.clear();
   this->Internal->LinkInterfaceMap.clear();
   this->Internal->LinkInterfaceUsageRequirementsOnlyMap.clear();
-  this->Internal->LinkClosureMap.clear();
   this->Internal->SourceFilesMap.clear();
 }
 
@@ -3136,223 +3132,6 @@ bool cmTarget::GetPropertyAsBool(const std::string& prop) const
 }
 
 //----------------------------------------------------------------------------
-class cmTargetCollectLinkLanguages
-{
-public:
-  cmTargetCollectLinkLanguages(cmTarget const* target,
-                               const std::string& config,
-                               UNORDERED_SET<std::string>& languages,
-                               cmTarget const* head):
-    Config(config), Languages(languages), HeadTarget(head),
-    Makefile(target->GetMakefile()), Target(target)
-  { this->Visited.insert(target); }
-
-  void Visit(cmLinkItem const& item)
-    {
-    if(!item.Target)
-      {
-      if(item.find("::") != std::string::npos)
-        {
-        bool noMessage = false;
-        cmake::MessageType messageType = cmake::FATAL_ERROR;
-        std::ostringstream e;
-        switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0028))
-          {
-          case cmPolicies::WARN:
-            {
-            e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0028) << "\n";
-            messageType = cmake::AUTHOR_WARNING;
-            }
-            break;
-          case cmPolicies::OLD:
-            noMessage = true;
-          case cmPolicies::REQUIRED_IF_USED:
-          case cmPolicies::REQUIRED_ALWAYS:
-          case cmPolicies::NEW:
-            // Issue the fatal message.
-            break;
-          }
-
-        if(!noMessage)
-          {
-          e << "Target \"" << this->Target->GetName()
-            << "\" links to target \"" << item
-            << "\" but the target was not found.  Perhaps a find_package() "
-            "call is missing for an IMPORTED target, or an ALIAS target is "
-            "missing?";
-          this->Makefile->GetCMakeInstance()->IssueMessage(messageType,
-                                                e.str(),
-                                                this->Target->GetBacktrace());
-          }
-        }
-      return;
-      }
-    if(!this->Visited.insert(item.Target).second)
-      {
-      return;
-      }
-
-    cmTarget::LinkInterface const* iface =
-      item.Target->GetLinkInterface(this->Config, this->HeadTarget);
-    if(!iface) { return; }
-
-    for(std::vector<std::string>::const_iterator
-          li = iface->Languages.begin(); li != iface->Languages.end(); ++li)
-      {
-      this->Languages.insert(*li);
-      }
-
-    for(std::vector<cmLinkItem>::const_iterator
-          li = iface->Libraries.begin(); li != iface->Libraries.end(); ++li)
-      {
-      this->Visit(*li);
-      }
-    }
-private:
-  std::string Config;
-  UNORDERED_SET<std::string>& Languages;
-  cmTarget const* HeadTarget;
-  cmMakefile* Makefile;
-  const cmTarget* Target;
-  std::set<cmTarget const*> Visited;
-};
-
-//----------------------------------------------------------------------------
-cmTarget::LinkClosure const*
-cmTarget::GetLinkClosure(const std::string& config) const
-{
-  std::string key(cmSystemTools::UpperCase(config));
-  cmTargetInternals::LinkClosureMapType::iterator
-    i = this->Internal->LinkClosureMap.find(key);
-  if(i == this->Internal->LinkClosureMap.end())
-    {
-    LinkClosure lc;
-    this->ComputeLinkClosure(config, lc);
-    cmTargetInternals::LinkClosureMapType::value_type entry(key, lc);
-    i = this->Internal->LinkClosureMap.insert(entry).first;
-    }
-  return &i->second;
-}
-
-//----------------------------------------------------------------------------
-class cmTargetSelectLinker
-{
-  int Preference;
-  cmTarget const* Target;
-  cmMakefile* Makefile;
-  cmGlobalGenerator* GG;
-  UNORDERED_SET<std::string> Preferred;
-public:
-  cmTargetSelectLinker(cmTarget const* target): Preference(0), Target(target)
-    {
-    this->Makefile = this->Target->GetMakefile();
-    this->GG = this->Makefile->GetGlobalGenerator();
-    }
-  void Consider(const std::string& lang)
-    {
-    int preference = this->GG->GetLinkerPreference(lang);
-    if(preference > this->Preference)
-      {
-      this->Preference = preference;
-      this->Preferred.clear();
-      }
-    if(preference == this->Preference)
-      {
-      this->Preferred.insert(lang);
-      }
-    }
-  std::string Choose()
-    {
-    if(this->Preferred.empty())
-      {
-      return "";
-      }
-    else if(this->Preferred.size() > 1)
-      {
-      std::ostringstream e;
-      e << "Target " << this->Target->GetName()
-        << " contains multiple languages with the highest linker preference"
-        << " (" << this->Preference << "):\n";
-      for(UNORDERED_SET<std::string>::const_iterator
-            li = this->Preferred.begin(); li != this->Preferred.end(); ++li)
-        {
-        e << "  " << *li << "\n";
-        }
-      e << "Set the LINKER_LANGUAGE property for this target.";
-      cmake* cm = this->Makefile->GetCMakeInstance();
-      cm->IssueMessage(cmake::FATAL_ERROR, e.str(),
-                       this->Target->GetBacktrace());
-      }
-    return *this->Preferred.begin();
-    }
-};
-
-//----------------------------------------------------------------------------
-void cmTarget::ComputeLinkClosure(const std::string& config,
-                                  LinkClosure& lc) const
-{
-  // Get languages built in this target.
-  UNORDERED_SET<std::string> languages;
-  LinkImplementation const* impl = this->GetLinkImplementation(config);
-  for(std::vector<std::string>::const_iterator li = impl->Languages.begin();
-      li != impl->Languages.end(); ++li)
-    {
-    languages.insert(*li);
-    }
-
-  // Add interface languages from linked targets.
-  cmTargetCollectLinkLanguages cll(this, config, languages, this);
-  for(std::vector<cmLinkImplItem>::const_iterator
-        li = impl->Libraries.begin();
-      li != impl->Libraries.end(); ++li)
-    {
-    cll.Visit(*li);
-    }
-
-  // Store the transitive closure of languages.
-  for(UNORDERED_SET<std::string>::const_iterator li = languages.begin();
-      li != languages.end(); ++li)
-    {
-    lc.Languages.push_back(*li);
-    }
-
-  // Choose the language whose linker should be used.
-  if(this->GetProperty("HAS_CXX"))
-    {
-    lc.LinkerLanguage = "CXX";
-    }
-  else if(const char* linkerLang = this->GetProperty("LINKER_LANGUAGE"))
-    {
-    lc.LinkerLanguage = linkerLang;
-    }
-  else
-    {
-    // Find the language with the highest preference value.
-    cmTargetSelectLinker tsl(this);
-
-    // First select from the languages compiled directly in this target.
-    for(std::vector<std::string>::const_iterator li = impl->Languages.begin();
-        li != impl->Languages.end(); ++li)
-      {
-      tsl.Consider(*li);
-      }
-
-    // Now consider languages that propagate from linked targets.
-    for(UNORDERED_SET<std::string>::const_iterator sit = languages.begin();
-        sit != languages.end(); ++sit)
-      {
-      std::string propagates = "CMAKE_"+*sit+"_LINKER_PREFERENCE_PROPAGATES";
-      if(this->Makefile->IsOn(propagates))
-        {
-        tsl.Consider(*sit);
-        }
-      }
-
-    lc.LinkerLanguage = tsl.Choose();
-    }
-}
-
-//----------------------------------------------------------------------------
 void cmTarget::ExpandLinkItems(std::string const& prop,
                                std::string const& value,
                                std::string const& config,
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index dea9bef..9a4915f 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -315,18 +315,6 @@ public:
   LinkImplementationLibraries const*
     GetLinkImplementationLibraries(const std::string& config) const;
 
-  /** Link information from the transitive closure of the link
-      implementation and the interfaces of its dependencies.  */
-  struct LinkClosure
-  {
-    // The preferred linker language.
-    std::string LinkerLanguage;
-
-    // Languages whose runtime libraries must be linked.
-    std::vector<std::string> Languages;
-  };
-  LinkClosure const* GetLinkClosure(const std::string& config) const;
-
   cmTarget const* FindTargetToLink(std::string const& name) const;
 
   /** Strip off leading and trailing whitespace from an item named in
@@ -662,7 +650,6 @@ private:
   LinkImplementationLibraries const*
     GetLinkImplementationLibrariesInternal(const std::string& config,
                                            cmTarget const* head) const;
-  void ComputeLinkClosure(const std::string& config, LinkClosure& lc) const;
 
   void ExpandLinkItems(std::string const& prop, std::string const& value,
                        std::string const& config, cmTarget const* headTarget,

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fe5391eecaf19d2741cb25f6690dbc21c05aeae7
commit fe5391eecaf19d2741cb25f6690dbc21c05aeae7
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Nov 3 16:33:25 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Aug 2 22:06:03 2015 +0200

    cmGeneratorTarget: Move GetLinkerLanguage from cmTarget.

diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index fee921c..640e806 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -265,8 +265,10 @@ cmComputeLinkInformation
                            "runtime search path");
   this->OrderDependentRPath = 0;
 
+  cmGeneratorTarget *gtgt = this->GlobalGenerator
+                                ->GetGeneratorTarget(this->Target);
   // Get the language used for linking this target.
-  this->LinkLanguage = this->Target->GetLinkerLanguage(config);
+  this->LinkLanguage = gtgt->GetLinkerLanguage(config);
   if(this->LinkLanguage.empty())
     {
     // The Compute method will do nothing, so skip the rest of the
@@ -322,9 +324,6 @@ cmComputeLinkInformation
       (this->Makefile->
        GetSafeDefinition("CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH"));
 
-    cmGeneratorTarget *gtgt = this->Target->GetMakefile()
-                                  ->GetGlobalGenerator()
-                                  ->GetGeneratorTarget(this->Target);
     this->RuntimeUseChrpath = gtgt->IsChrpathUsed(config);
 
     // Get options needed to help find dependent libraries.
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index 49fc96b..a86c2bc 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -990,6 +990,9 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
 
     assert(target);
 
+    cmGeneratorTarget* gtgt =
+        context->Makefile->GetGlobalGenerator()->GetGeneratorTarget(target);
+
     if (propertyName == "LINKER_LANGUAGE")
       {
       if (target->LinkLanguagePropagatesToDependents() &&
@@ -1001,7 +1004,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
             "link libraries for a static library");
         return std::string();
         }
-      return target->GetLinkerLanguage(context->Config);
+      return gtgt->GetLinkerLanguage(context->Config);
       }
 
     cmGeneratorExpressionDAGChecker dagChecker(context->Backtrace,
@@ -1128,9 +1131,6 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
         }
       }
 
-    cmGeneratorTarget* gtgt =
-        context->Makefile->GetGlobalGenerator()->GetGeneratorTarget(target);
-
     if (!prop)
       {
       if (target->IsImported()
@@ -1600,7 +1600,7 @@ struct TargetFilesystemArtifactResultCreator<ArtifactPdbTag>
                             cmGeneratorExpressionContext *context,
                             const GeneratorExpressionContent *content)
   {
-    std::string language = target->Target->GetLinkerLanguage(context->Config);
+    std::string language = target->GetLinkerLanguage(context->Config);
 
     std::string pdbSupportVar = "CMAKE_" + language + "_LINKER_SUPPORTS_PDB";
 
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 834a2e3..4de5e9c 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -709,8 +709,7 @@ bool cmGeneratorTarget::HasSOName(const std::string& config) const
   return ((this->GetType() == cmTarget::SHARED_LIBRARY ||
            this->GetType() == cmTarget::MODULE_LIBRARY) &&
           !this->GetPropertyAsBool("NO_SONAME") &&
-          this->Makefile->GetSONameFlag(
-            this->Target->GetLinkerLanguage(config)));
+          this->Makefile->GetSONameFlag(this->GetLinkerLanguage(config)));
 }
 
 //----------------------------------------------------------------------------
@@ -752,7 +751,7 @@ cmGeneratorTarget::NeedRelinkBeforeInstall(const std::string& config) const
     }
 
   // Check for rpath support on this platform.
-  std::string ll = this->Target->GetLinkerLanguage(config);
+  std::string ll = this->GetLinkerLanguage(config);
   if(!ll.empty())
     {
     std::string flagVar = "CMAKE_SHARED_LIBRARY_RUNTIME_";
@@ -823,7 +822,7 @@ bool cmGeneratorTarget::IsChrpathUsed(const std::string& config) const
 #if defined(CMAKE_USE_ELF_PARSER)
   // Enable if the rpath flag uses a separator and the target uses ELF
   // binaries.
-  std::string ll = this->Target->GetLinkerLanguage(config);
+  std::string ll = this->GetLinkerLanguage(config);
   if(!ll.empty())
     {
     std::string sepVar = "CMAKE_SHARED_LIBRARY_RUNTIME_";
@@ -1986,7 +1985,7 @@ void cmGeneratorTarget::GetFullNameInternal(const std::string& config,
   const char* suffixVar = this->Target->GetSuffixVariableInternal(implib);
 
   // Check for language-specific default prefix and suffix.
-  std::string ll = this->Target->GetLinkerLanguage(config);
+  std::string ll = this->GetLinkerLanguage(config);
   if(!ll.empty())
     {
     if(!targetSuffix && suffixVar && *suffixVar)
@@ -2056,6 +2055,13 @@ void cmGeneratorTarget::GetFullNameInternal(const std::string& config,
 
 
 //----------------------------------------------------------------------------
+std::string
+cmGeneratorTarget::GetLinkerLanguage(const std::string& config) const
+{
+  return this->Target->GetLinkClosure(config)->LinkerLanguage;
+}
+
+//----------------------------------------------------------------------------
 std::string cmGeneratorTarget::GetPDBName(const std::string& config) const
 {
   std::string prefix;
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 372bbe1..2799371 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -258,6 +258,9 @@ public:
   /** Return true if builtin chrpath will work for this target */
   bool IsChrpathUsed(const std::string& config) const;
 
+  ///! Return the preferred linker language for this target
+  std::string GetLinkerLanguage(const std::string& config = "") const;
+
   struct SourceFileFlags
   GetTargetSourceFileFlags(const cmSourceFile* sf) const;
 
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 2f9265a..1e57c33 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -128,7 +128,8 @@ void cmGhsMultiTargetGenerator::Generate()
       {
       config = "RELEASE";
       }
-    const std::string language(this->Target->GetLinkerLanguage(config));
+    const std::string language(
+          this->GeneratorTarget->GetLinkerLanguage(config));
     config = cmSystemTools::UpperCase(config);
     this->DynamicDownload = this->DetermineIfDynamicDownload(config, language);
     if (this->DynamicDownload)
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 7b0e153..5006828 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1376,7 +1376,8 @@ void cmGlobalXCodeGenerator::ForceLinkerLanguage(cmTarget& cmtarget)
     return;
     }
 
-  std::string llang = cmtarget.GetLinkerLanguage("NOCONFIG");
+  cmGeneratorTarget *gtgt = this->GetGeneratorTarget(&cmtarget);
+  std::string llang = gtgt->GetLinkerLanguage("NOCONFIG");
   if(llang.empty()) { return; }
 
   // If the language is compiled as a source trust Xcode to link with it.
@@ -1824,7 +1825,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
       AddCompileOptions(flags, &target, lang, configName);
     }
 
-  std::string llang = target.GetLinkerLanguage(configName);
+  cmGeneratorTarget *gtgt = this->GetGeneratorTarget(&target);
+  std::string llang = gtgt->GetLinkerLanguage(configName);
   if(binary && llang.empty())
     {
     cmSystemTools::Error
@@ -1850,7 +1852,6 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
     // Add the export symbol definition for shared library objects.
     this->AppendDefines(ppDefs, exportMacro);
     }
-  cmGeneratorTarget *gtgt = this->GetGeneratorTarget(&target);
   std::vector<std::string> targetDefines;
   target.GetCompileDefinitions(targetDefines, configName, "C");
   this->AppendDefines(ppDefs, targetDefines);
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 3ab501d..4ec77a1 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1353,7 +1353,7 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
         linkFlags += this->Makefile->GetSafeDefinition(build);
         linkFlags += " ";
         }
-      std::string linkLanguage = target->Target->GetLinkerLanguage(buildType);
+      std::string linkLanguage = target->GetLinkerLanguage(buildType);
       if(linkLanguage.empty())
         {
         cmSystemTools::Error
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index 94457bb..e1fa7d4 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -1259,8 +1259,8 @@ void cmLocalVisualStudio6Generator
     extraLinkOptionsRelWithDebInfo += targetLinkFlags;
     }
 
-
-
+  cmGeneratorTarget* gt =
+    this->GlobalGenerator->GetGeneratorTarget(&target);
 
   // Get standard libraries for this language.
   if(targetBuilds)
@@ -1269,10 +1269,10 @@ void cmLocalVisualStudio6Generator
     std::vector<std::string> configs;
     target.GetMakefile()->GetConfigurations(configs);
     std::vector<std::string>::const_iterator it = configs.begin();
-    const std::string& linkLanguage = target.GetLinkerLanguage(*it);
+    const std::string& linkLanguage = gt->GetLinkerLanguage(*it);
     for ( ; it != configs.end(); ++it)
       {
-      const std::string& configLinkLanguage = target.GetLinkerLanguage(*it);
+      const std::string& configLinkLanguage = gt->GetLinkerLanguage(*it);
       if (configLinkLanguage != linkLanguage)
         {
         cmSystemTools::Error
@@ -1702,10 +1702,10 @@ void cmLocalVisualStudio6Generator
       std::vector<std::string> configs;
       target.GetMakefile()->GetConfigurations(configs);
       std::vector<std::string>::const_iterator it = configs.begin();
-      const std::string& linkLanguage = target.GetLinkerLanguage(*it);
+      const std::string& linkLanguage = gt->GetLinkerLanguage(*it);
       for ( ; it != configs.end(); ++it)
         {
-        const std::string& configLinkLanguage = target.GetLinkerLanguage(*it);
+        const std::string& configLinkLanguage = gt->GetLinkerLanguage(*it);
         if (configLinkLanguage != linkLanguage)
           {
           cmSystemTools::Error
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 9f26712..a38a061 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -664,6 +664,10 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
   const char* configType = "10";
   const char* projectType = 0;
   bool targetBuilds = true;
+
+  cmGeneratorTarget* gt =
+    this->GlobalGenerator->GetGeneratorTarget(&target);
+
   switch(target.GetType())
     {
     case cmTarget::OBJECT_LIBRARY:
@@ -696,7 +700,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
     {
     const std::string& linkLanguage = (this->FortranProject?
                                        std::string("Fortran"):
-                                target.GetLinkerLanguage(configName));
+                                gt->GetLinkerLanguage(configName));
     if(linkLanguage.empty())
       {
       cmSystemTools::Error
@@ -758,8 +762,6 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
   targetOptions.Parse(flags.c_str());
   targetOptions.Parse(defineFlags.c_str());
   targetOptions.ParseFinish();
-  cmGeneratorTarget* gt =
-    this->GlobalGenerator->GetGeneratorTarget(&target);
   std::vector<std::string> targetDefines;
   target.GetCompileDefinitions(targetDefines, configName, "CXX");
   targetOptions.AddDefines(targetDefines);
@@ -1635,7 +1637,7 @@ cmLocalVisualStudio7GeneratorFCInfo
       lg->GlobalGenerator->GetLanguageFromExtension
       (sf.GetExtension().c_str());
     const std::string& sourceLang = lg->GetSourceFileLanguage(sf);
-    const std::string& linkLanguage = target.GetLinkerLanguage(i->c_str());
+    const std::string& linkLanguage = gt->GetLinkerLanguage(i->c_str());
     bool needForceLang = false;
     // source file does not match its extension language
     if(lang != sourceLang)
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 2fd77c9..afe145a 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -161,7 +161,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
 
   // Get the language to use for linking this executable.
   std::string linkLanguage =
-    this->Target->GetLinkerLanguage(this->ConfigName);
+    this->GeneratorTarget->GetLinkerLanguage(this->ConfigName);
 
   // Make sure we have a link language.
   if(linkLanguage.empty())
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index b85b8a8..bb0f9dd 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -133,7 +133,7 @@ void cmMakefileLibraryTargetGenerator::WriteObjectLibraryRules()
 void cmMakefileLibraryTargetGenerator::WriteStaticLibraryRules()
 {
   std::string linkLanguage =
-    this->Target->GetLinkerLanguage(this->ConfigName);
+    this->GeneratorTarget->GetLinkerLanguage(this->ConfigName);
   std::string linkRuleVar = "CMAKE_";
   linkRuleVar += linkLanguage;
   linkRuleVar += "_CREATE_STATIC_LIBRARY";
@@ -159,7 +159,7 @@ void cmMakefileLibraryTargetGenerator::WriteSharedLibraryRules(bool relink)
     return;
     }
   std::string linkLanguage =
-    this->Target->GetLinkerLanguage(this->ConfigName);
+    this->GeneratorTarget->GetLinkerLanguage(this->ConfigName);
   std::string linkRuleVar = "CMAKE_";
   linkRuleVar += linkLanguage;
   linkRuleVar += "_CREATE_SHARED_LIBRARY";
@@ -183,7 +183,7 @@ void cmMakefileLibraryTargetGenerator::WriteSharedLibraryRules(bool relink)
 void cmMakefileLibraryTargetGenerator::WriteModuleLibraryRules(bool relink)
 {
   std::string linkLanguage =
-    this->Target->GetLinkerLanguage(this->ConfigName);
+    this->GeneratorTarget->GetLinkerLanguage(this->ConfigName);
   std::string linkRuleVar = "CMAKE_";
   linkRuleVar += linkLanguage;
   linkRuleVar += "_CREATE_SHARED_MODULE";
@@ -206,7 +206,7 @@ void cmMakefileLibraryTargetGenerator::WriteModuleLibraryRules(bool relink)
 void cmMakefileLibraryTargetGenerator::WriteFrameworkRules(bool relink)
 {
   std::string linkLanguage =
-    this->Target->GetLinkerLanguage(this->ConfigName);
+    this->GeneratorTarget->GetLinkerLanguage(this->ConfigName);
   std::string linkRuleVar = "CMAKE_";
   linkRuleVar += linkLanguage;
   linkRuleVar += "_CREATE_MACOSX_FRAMEWORK";
@@ -238,7 +238,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
 
   // Get the language to use for linking this library.
   std::string linkLanguage =
-    this->Target->GetLinkerLanguage(this->ConfigName);
+    this->GeneratorTarget->GetLinkerLanguage(this->ConfigName);
 
   // Make sure we have a link language.
   if(linkLanguage.empty())
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index b94e151..d38cf4c 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1509,7 +1509,7 @@ std::string cmMakefileTargetGenerator::GetLinkRule(
   if(this->Target->HasImplibGNUtoMS())
     {
     std::string ruleVar = "CMAKE_";
-    ruleVar += this->Target->GetLinkerLanguage(this->ConfigName);
+    ruleVar += this->GeneratorTarget->GetLinkerLanguage(this->ConfigName);
     ruleVar += "_GNUtoMS_RULE";
     if(const char* rule = this->Makefile->GetDefinition(ruleVar))
       {
@@ -1663,7 +1663,8 @@ cmMakefileTargetGenerator
     {
     // Lookup the response file reference flag.
     std::string responseFlagVar = "CMAKE_";
-    responseFlagVar += this->Target->GetLinkerLanguage(this->ConfigName);
+    responseFlagVar += this->GeneratorTarget
+                           ->GetLinkerLanguage(this->ConfigName);
     responseFlagVar += "_RESPONSE_FILE_LINK_FLAG";
     const char* responseFlag =
       this->Makefile->GetDefinition(responseFlagVar);
@@ -1707,7 +1708,8 @@ cmMakefileTargetGenerator
 
     // Lookup the response file reference flag.
     std::string responseFlagVar = "CMAKE_";
-    responseFlagVar += this->Target->GetLinkerLanguage(this->ConfigName);
+    responseFlagVar += this->GeneratorTarget
+                           ->GetLinkerLanguage(this->ConfigName);
     responseFlagVar += "_RESPONSE_FILE_LINK_FLAG";
     const char* responseFlag =
       this->Makefile->GetDefinition(responseFlagVar);
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 1835841..b855bea 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -40,8 +40,7 @@ cmNinjaNormalTargetGenerator(cmGeneratorTarget* target)
   , TargetNamePDB()
   , TargetLinkLanguage("")
 {
-  this->TargetLinkLanguage = target->Target
-                                   ->GetLinkerLanguage(this->GetConfigName());
+  this->TargetLinkLanguage = target->GetLinkerLanguage(this->GetConfigName());
   if (target->GetType() == cmTarget::EXECUTABLE)
     this->GetGeneratorTarget()->GetExecutableNames(this->TargetNameOut,
                                this->TargetNameReal,
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 37b788d..c7118dc 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -3218,12 +3218,6 @@ private:
 };
 
 //----------------------------------------------------------------------------
-std::string cmTarget::GetLinkerLanguage(const std::string& config) const
-{
-  return this->GetLinkClosure(config)->LinkerLanguage;
-}
-
-//----------------------------------------------------------------------------
 cmTarget::LinkClosure const*
 cmTarget::GetLinkClosure(const std::string& config) const
 {
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index d0cbc66..dea9bef 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -365,9 +365,6 @@ public:
   void
   GetTargetVersion(bool soversion, int& major, int& minor, int& patch) const;
 
-  ///! Return the preferred linker language for this target
-  std::string GetLinkerLanguage(const std::string& config = "") const;
-
   /** Whether this library has \@rpath and platform supports it.  */
   bool HasMacOSXRpathInstallNameDir(const std::string& config) const;
 
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 2b33c2c..80b8591 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1627,7 +1627,7 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
     this->GlobalGenerator->GetLanguageFromExtension
     (sf.GetExtension().c_str());
   std::string sourceLang = this->LocalGenerator->GetSourceFileLanguage(sf);
-  const std::string& linkLanguage = this->Target->GetLinkerLanguage();
+  const std::string& linkLanguage = this->GeneratorTarget->GetLinkerLanguage();
   bool needForceLang = false;
   // source file does not match its extension language
   if(lang != sourceLang)
@@ -1888,7 +1888,7 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
 
   std::string flags;
   const std::string& linkLanguage =
-    this->Target->GetLinkerLanguage(configName.c_str());
+    this->GeneratorTarget->GetLinkerLanguage(configName.c_str());
   if(linkLanguage.empty())
     {
     cmSystemTools::Error
@@ -2371,7 +2371,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
   Options& linkOptions = *pOptions;
 
   const std::string& linkLanguage =
-    this->Target->GetLinkerLanguage(config.c_str());
+    this->GeneratorTarget->GetLinkerLanguage(config.c_str());
   if(linkLanguage.empty())
     {
     cmSystemTools::Error

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c0497de1233b363afd983bc97af00b5d7fe27950
commit c0497de1233b363afd983bc97af00b5d7fe27950
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Oct 9 01:22:42 2012 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Aug 2 22:06:03 2015 +0200

    cmGeneratorTarget: Move GetFrameworkDirectory from cmTarget.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 436e5dd..834a2e3 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -904,6 +904,48 @@ cmGeneratorTarget::GetAppBundleDirectory(const std::string& config,
 }
 
 //----------------------------------------------------------------------------
+std::string cmGeneratorTarget::GetCFBundleDirectory(const std::string& config,
+                                                    bool contentOnly) const
+{
+  std::string fpath;
+  fpath += this->Target->GetOutputName(config, false);
+  fpath += ".";
+  const char *ext = this->Target->GetProperty("BUNDLE_EXTENSION");
+  if (!ext)
+    {
+    if (this->Target->IsXCTestOnApple())
+      {
+      ext = "xctest";
+      }
+    else
+      {
+      ext = "bundle";
+      }
+    }
+  fpath += ext;
+  fpath += "/Contents";
+  if(!contentOnly)
+    fpath += "/MacOS";
+  return fpath;
+}
+
+//----------------------------------------------------------------------------
+std::string
+cmGeneratorTarget::GetFrameworkDirectory(const std::string& config,
+                                         bool rootDir) const
+{
+  std::string fpath;
+  fpath += this->Target->GetOutputName(config, false);
+  fpath += ".framework";
+  if(!rootDir)
+    {
+    fpath += "/Versions/";
+    fpath += this->Target->GetFrameworkVersion();
+    }
+  return fpath;
+}
+
+//----------------------------------------------------------------------------
 std::string
 cmGeneratorTarget::GetFullName(const std::string& config, bool implib) const
 {
@@ -1007,11 +1049,11 @@ cmGeneratorTarget::BuildMacContentDirectory(const std::string& base,
     }
   if(this->Target->IsFrameworkOnApple())
     {
-    fpath += this->Target->GetFrameworkDirectory(config, contentOnly);
+    fpath += this->GetFrameworkDirectory(config, contentOnly);
     }
   if(this->Target->IsCFBundleOnApple())
     {
-    fpath += this->Target->GetCFBundleDirectory(config, contentOnly);
+    fpath += this->GetCFBundleDirectory(config, contentOnly);
     }
   return fpath;
 }
@@ -1982,7 +2024,7 @@ void cmGeneratorTarget::GetFullNameInternal(const std::string& config,
 
   if(this->Target->IsCFBundleOnApple())
     {
-    fw_prefix = this->Target->GetCFBundleDirectory(config, false);
+    fw_prefix = this->GetCFBundleDirectory(config, false);
     fw_prefix += "/";
     targetPrefix = fw_prefix.c_str();
     targetSuffix = 0;
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 8ccd6d0..372bbe1 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -124,6 +124,14 @@ public:
   std::string GetFullName(const std::string& config="",
                           bool implib = false) const;
 
+  /** @return the Mac framework directory without the base. */
+  std::string GetFrameworkDirectory(const std::string& config,
+                                    bool rootDir) const;
+
+  /** @return the Mac CFBundle directory without the base */
+  std::string GetCFBundleDirectory(const std::string& config,
+                                   bool contentOnly) const;
+
   /** Return the install name directory for the target in the
     * build tree.  For example: "\@rpath/", "\@loader_path/",
     * or "/full/path/to/library".  */
diff --git a/Source/cmOSXBundleGenerator.cxx b/Source/cmOSXBundleGenerator.cxx
index 1d85d9c..4fe99e3 100644
--- a/Source/cmOSXBundleGenerator.cxx
+++ b/Source/cmOSXBundleGenerator.cxx
@@ -77,11 +77,11 @@ void cmOSXBundleGenerator::CreateFramework(
 
   // Compute the location of the top-level foo.framework directory.
   std::string contentdir = outpath + "/" +
-    this->GT->Target->GetFrameworkDirectory(this->ConfigName, true);
+    this->GT->GetFrameworkDirectory(this->ConfigName, true);
   contentdir += "/";
 
   std::string newoutpath = outpath + "/" +
-    this->GT->Target->GetFrameworkDirectory(this->ConfigName, false);
+    this->GT->GetFrameworkDirectory(this->ConfigName, false);
 
   std::string frameworkVersion = this->GT->Target->GetFrameworkVersion();
 
@@ -172,14 +172,14 @@ void cmOSXBundleGenerator::CreateCFBundle(const std::string& targetName,
   // Compute bundle directory names.
   std::string out = root;
   out += "/";
-  out += this->GT->Target->GetCFBundleDirectory(this->ConfigName, false);
+  out += this->GT->GetCFBundleDirectory(this->ConfigName, false);
   cmSystemTools::MakeDirectory(out.c_str());
   this->Makefile->AddCMakeOutputFile(out);
 
   // Configure the Info.plist file.  Note that it needs the executable name
   // to be set.
   std::string plist = root + "/" +
-    this->GT->Target->GetCFBundleDirectory(this->ConfigName, true);
+    this->GT->GetCFBundleDirectory(this->ConfigName, true);
   plist += "/Info.plist";
   std::string name = cmSystemTools::GetFilenameName(targetName);
   this->LocalGenerator->GenerateAppleInfoPList(this->GT->Target,
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index a5ff829..37b788d 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -5126,47 +5126,6 @@ std::string cmTarget::CheckCMP0004(std::string const& item) const
 }
 
 //----------------------------------------------------------------------------
-std::string cmTarget::GetFrameworkDirectory(const std::string& config,
-                                            bool rootDir) const
-{
-  std::string fpath;
-  fpath += this->GetOutputName(config, false);
-  fpath += ".framework";
-  if(!rootDir)
-    {
-    fpath += "/Versions/";
-    fpath += this->GetFrameworkVersion();
-    }
-  return fpath;
-}
-
-//----------------------------------------------------------------------------
-std::string cmTarget::GetCFBundleDirectory(const std::string& config,
-                                           bool contentOnly) const
-{
-  std::string fpath;
-  fpath += this->GetOutputName(config, false);
-  fpath += ".";
-  const char *ext = this->GetProperty("BUNDLE_EXTENSION");
-  if (!ext)
-    {
-    if (this->IsXCTestOnApple())
-      {
-      ext = "xctest";
-      }
-    else
-      {
-      ext = "bundle";
-      }
-    }
-  fpath += ext;
-  fpath += "/Contents";
-  if(!contentOnly)
-    fpath += "/MacOS";
-  return fpath;
-}
-
-//----------------------------------------------------------------------------
 cmTargetInternalPointer::cmTargetInternalPointer()
 {
   this->Pointer = new cmTargetInternals;
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index e22d3af..d0cbc66 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -460,14 +460,6 @@ public:
   /** @return whether this target have a well defined output file name. */
   bool HaveWellDefinedOutputFiles() const;
 
-  /** @return the Mac framework directory without the base. */
-  std::string GetFrameworkDirectory(const std::string& config,
-                                    bool rootDir) const;
-
-  /** @return the Mac CFBundle directory without the base */
-  std::string GetCFBundleDirectory(const std::string& config,
-                                   bool contentOnly) const;
-
   std::vector<std::string> GetIncludeDirectories(
                      const std::string& config,
                      const std::string& language) const;

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4031d184b53b6cff621e30663f80c7d86bee7aa8
commit 4031d184b53b6cff621e30663f80c7d86bee7aa8
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Oct 9 19:01:39 2012 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Aug 2 22:06:03 2015 +0200

    cmGeneratorTarget: Move GetFullNameInternal from cmTarget.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index cdacfcb..436e5dd 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -663,7 +663,7 @@ cmGeneratorTarget::GetCompilePDBName(const std::string& config) const
   std::string prefix;
   std::string base;
   std::string suffix;
-  this->Target->GetFullNameInternal(config, false, prefix, base, suffix);
+  this->GetFullNameInternal(config, false, prefix, base, suffix);
 
   // Check for a per-configuration output directory target property.
   std::string configUpper = cmSystemTools::UpperCase(config);
@@ -905,6 +905,20 @@ cmGeneratorTarget::GetAppBundleDirectory(const std::string& config,
 
 //----------------------------------------------------------------------------
 std::string
+cmGeneratorTarget::GetFullName(const std::string& config, bool implib) const
+{
+  if(this->Target->IsImported())
+    {
+    return this->Target->GetFullNameImported(config, implib);
+    }
+  else
+    {
+    return this->GetFullNameInternal(config, implib);
+    }
+}
+
+//----------------------------------------------------------------------------
+std::string
 cmGeneratorTarget::GetInstallNameDirForBuildTree(
                                             const std::string& config) const
 {
@@ -977,7 +991,7 @@ void cmGeneratorTarget::GetFullNameComponents(std::string& prefix,
                                               const std::string& config,
                                               bool implib) const
 {
-  this->Target->GetFullNameInternal(config, implib, prefix, base, suffix);
+  this->GetFullNameInternal(config, implib, prefix, base, suffix);
 }
 
 //----------------------------------------------------------------------------
@@ -1753,7 +1767,7 @@ void cmGeneratorTarget::GetLibraryNames(std::string& name,
   std::string prefix;
   std::string base;
   std::string suffix;
-  this->Target->GetFullNameInternal(config, false, prefix, base, suffix);
+  this->GetFullNameInternal(config, false, prefix, base, suffix);
 
   // The library name.
   name = prefix+base+suffix;
@@ -1782,7 +1796,7 @@ void cmGeneratorTarget::GetLibraryNames(std::string& name,
   if(this->GetType() == cmTarget::SHARED_LIBRARY ||
      this->GetType() == cmTarget::MODULE_LIBRARY)
     {
-    impName = this->Target->GetFullNameInternal(config, true);
+    impName = this->GetFullNameInternal(config, true);
     }
   else
     {
@@ -1828,7 +1842,7 @@ void cmGeneratorTarget::GetExecutableNames(std::string& name,
   std::string prefix;
   std::string base;
   std::string suffix;
-  this->Target->GetFullNameInternal(config, false, prefix, base, suffix);
+  this->GetFullNameInternal(config, false, prefix, base, suffix);
 
   // The executable name.
   name = prefix+base+suffix;
@@ -1849,19 +1863,163 @@ void cmGeneratorTarget::GetExecutableNames(std::string& name,
 #endif
 
   // The import library name.
-  impName = this->Target->GetFullNameInternal(config, true);
+  impName = this->GetFullNameInternal(config, true);
 
   // The program database file name.
   pdbName = this->GetPDBName(config);
 }
 
 //----------------------------------------------------------------------------
+std::string cmGeneratorTarget::GetFullNameInternal(const std::string& config,
+                                                   bool implib) const
+{
+  std::string prefix;
+  std::string base;
+  std::string suffix;
+  this->GetFullNameInternal(config, implib, prefix, base, suffix);
+  return prefix+base+suffix;
+}
+
+//----------------------------------------------------------------------------
+void cmGeneratorTarget::GetFullNameInternal(const std::string& config,
+                                            bool implib,
+                                            std::string& outPrefix,
+                                            std::string& outBase,
+                                            std::string& outSuffix) const
+{
+  // Use just the target name for non-main target types.
+  if(this->GetType() != cmTarget::STATIC_LIBRARY &&
+     this->GetType() != cmTarget::SHARED_LIBRARY &&
+     this->GetType() != cmTarget::MODULE_LIBRARY &&
+     this->GetType() != cmTarget::EXECUTABLE)
+    {
+    outPrefix = "";
+    outBase = this->GetName();
+    outSuffix = "";
+    return;
+    }
+
+  // Return an empty name for the import library if this platform
+  // does not support import libraries.
+  if(implib &&
+     !this->Makefile->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX"))
+    {
+    outPrefix = "";
+    outBase = "";
+    outSuffix = "";
+    return;
+    }
+
+  // The implib option is only allowed for shared libraries, module
+  // libraries, and executables.
+  if(this->GetType() != cmTarget::SHARED_LIBRARY &&
+     this->GetType() != cmTarget::MODULE_LIBRARY &&
+     this->GetType() != cmTarget::EXECUTABLE)
+    {
+    implib = false;
+    }
+
+  // Compute the full name for main target types.
+  const char* targetPrefix = (implib
+                              ? this->GetProperty("IMPORT_PREFIX")
+                              : this->GetProperty("PREFIX"));
+  const char* targetSuffix = (implib
+                              ? this->GetProperty("IMPORT_SUFFIX")
+                              : this->GetProperty("SUFFIX"));
+  const char* configPostfix = 0;
+  if(!config.empty())
+    {
+    std::string configProp = cmSystemTools::UpperCase(config);
+    configProp += "_POSTFIX";
+    configPostfix = this->GetProperty(configProp);
+    // Mac application bundles and frameworks have no postfix.
+    if(configPostfix &&
+       (this->Target->IsAppBundleOnApple()
+         || this->Target->IsFrameworkOnApple()))
+      {
+      configPostfix = 0;
+      }
+    }
+  const char* prefixVar = this->Target->GetPrefixVariableInternal(implib);
+  const char* suffixVar = this->Target->GetSuffixVariableInternal(implib);
+
+  // Check for language-specific default prefix and suffix.
+  std::string ll = this->Target->GetLinkerLanguage(config);
+  if(!ll.empty())
+    {
+    if(!targetSuffix && suffixVar && *suffixVar)
+      {
+      std::string langSuff = suffixVar + std::string("_") + ll;
+      targetSuffix = this->Makefile->GetDefinition(langSuff);
+      }
+    if(!targetPrefix && prefixVar && *prefixVar)
+      {
+      std::string langPrefix = prefixVar + std::string("_") + ll;
+      targetPrefix = this->Makefile->GetDefinition(langPrefix);
+      }
+    }
+
+  // if there is no prefix on the target use the cmake definition
+  if(!targetPrefix && prefixVar)
+    {
+    targetPrefix = this->Makefile->GetSafeDefinition(prefixVar);
+    }
+  // if there is no suffix on the target use the cmake definition
+  if(!targetSuffix && suffixVar)
+    {
+    targetSuffix = this->Makefile->GetSafeDefinition(suffixVar);
+    }
+
+  // frameworks have directory prefix but no suffix
+  std::string fw_prefix;
+  if(this->Target->IsFrameworkOnApple())
+    {
+    fw_prefix = this->Target->GetOutputName(config, false);
+    fw_prefix += ".framework/";
+    targetPrefix = fw_prefix.c_str();
+    targetSuffix = 0;
+    }
+
+  if(this->Target->IsCFBundleOnApple())
+    {
+    fw_prefix = this->Target->GetCFBundleDirectory(config, false);
+    fw_prefix += "/";
+    targetPrefix = fw_prefix.c_str();
+    targetSuffix = 0;
+    }
+
+  // Begin the final name with the prefix.
+  outPrefix = targetPrefix?targetPrefix:"";
+
+  // Append the target name or property-specified name.
+  outBase += this->Target->GetOutputName(config, implib);
+
+  // Append the per-configuration postfix.
+  outBase += configPostfix?configPostfix:"";
+
+  // Name shared libraries with their version number on some platforms.
+  if(const char* soversion = this->GetProperty("SOVERSION"))
+    {
+    if(this->GetType() == cmTarget::SHARED_LIBRARY && !implib &&
+       this->Makefile->IsOn("CMAKE_SHARED_LIBRARY_NAME_WITH_VERSION"))
+      {
+      outBase += "-";
+      outBase += soversion;
+      }
+    }
+
+  // Append the suffix.
+  outSuffix = targetSuffix?targetSuffix:"";
+}
+
+
+//----------------------------------------------------------------------------
 std::string cmGeneratorTarget::GetPDBName(const std::string& config) const
 {
   std::string prefix;
   std::string base;
   std::string suffix;
-  this->Target->GetFullNameInternal(config, false, prefix, base, suffix);
+  this->GetFullNameInternal(config, false, prefix, base, suffix);
 
   std::vector<std::string> props;
   std::string configUpper =
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index d0d6709..8ccd6d0 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -284,6 +284,11 @@ private:
 
   mutable std::map<std::string, bool> DebugCompatiblePropertiesDone;
 
+  std::string GetFullNameInternal(const std::string& config, bool implib) const;
+  void GetFullNameInternal(const std::string& config, bool implib,
+                           std::string& outPrefix, std::string& outBase,
+                           std::string& outSuffix) const;
+
   struct CompatibleInterfacesBase
   {
     std::set<std::string> PropsBool;
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index c484417..a5ff829 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -3612,148 +3612,6 @@ cmTarget::ImportedGetFullPath(const std::string& config, bool implib) const
 }
 
 //----------------------------------------------------------------------------
-std::string
-cmTarget::GetFullNameInternal(const std::string& config, bool implib) const
-{
-  std::string prefix;
-  std::string base;
-  std::string suffix;
-  this->GetFullNameInternal(config, implib, prefix, base, suffix);
-  return prefix+base+suffix;
-}
-
-//----------------------------------------------------------------------------
-void cmTarget::GetFullNameInternal(const std::string& config,
-                                   bool implib,
-                                   std::string& outPrefix,
-                                   std::string& outBase,
-                                   std::string& outSuffix) const
-{
-  // Use just the target name for non-main target types.
-  if(this->GetType() != cmTarget::STATIC_LIBRARY &&
-     this->GetType() != cmTarget::SHARED_LIBRARY &&
-     this->GetType() != cmTarget::MODULE_LIBRARY &&
-     this->GetType() != cmTarget::EXECUTABLE)
-    {
-    outPrefix = "";
-    outBase = this->GetName();
-    outSuffix = "";
-    return;
-    }
-
-  // Return an empty name for the import library if this platform
-  // does not support import libraries.
-  if(implib &&
-     !this->Makefile->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX"))
-    {
-    outPrefix = "";
-    outBase = "";
-    outSuffix = "";
-    return;
-    }
-
-  // The implib option is only allowed for shared libraries, module
-  // libraries, and executables.
-  if(this->GetType() != cmTarget::SHARED_LIBRARY &&
-     this->GetType() != cmTarget::MODULE_LIBRARY &&
-     this->GetType() != cmTarget::EXECUTABLE)
-    {
-    implib = false;
-    }
-
-  // Compute the full name for main target types.
-  const char* targetPrefix = (implib
-                              ? this->GetProperty("IMPORT_PREFIX")
-                              : this->GetProperty("PREFIX"));
-  const char* targetSuffix = (implib
-                              ? this->GetProperty("IMPORT_SUFFIX")
-                              : this->GetProperty("SUFFIX"));
-  const char* configPostfix = 0;
-  if(!config.empty())
-    {
-    std::string configProp = cmSystemTools::UpperCase(config);
-    configProp += "_POSTFIX";
-    configPostfix = this->GetProperty(configProp);
-    // Mac application bundles and frameworks have no postfix.
-    if(configPostfix &&
-       (this->IsAppBundleOnApple() || this->IsFrameworkOnApple()))
-      {
-      configPostfix = 0;
-      }
-    }
-  const char* prefixVar = this->GetPrefixVariableInternal(implib);
-  const char* suffixVar = this->GetSuffixVariableInternal(implib);
-
-  // Check for language-specific default prefix and suffix.
-  std::string ll = this->GetLinkerLanguage(config);
-  if(!ll.empty())
-    {
-    if(!targetSuffix && suffixVar && *suffixVar)
-      {
-      std::string langSuff = suffixVar + std::string("_") + ll;
-      targetSuffix = this->Makefile->GetDefinition(langSuff);
-      }
-    if(!targetPrefix && prefixVar && *prefixVar)
-      {
-      std::string langPrefix = prefixVar + std::string("_") + ll;
-      targetPrefix = this->Makefile->GetDefinition(langPrefix);
-      }
-    }
-
-  // if there is no prefix on the target use the cmake definition
-  if(!targetPrefix && prefixVar)
-    {
-    targetPrefix = this->Makefile->GetSafeDefinition(prefixVar);
-    }
-  // if there is no suffix on the target use the cmake definition
-  if(!targetSuffix && suffixVar)
-    {
-    targetSuffix = this->Makefile->GetSafeDefinition(suffixVar);
-    }
-
-  // frameworks have directory prefix but no suffix
-  std::string fw_prefix;
-  if(this->IsFrameworkOnApple())
-    {
-    fw_prefix = this->GetOutputName(config, false);
-    fw_prefix += ".framework/";
-    targetPrefix = fw_prefix.c_str();
-    targetSuffix = 0;
-    }
-
-  if(this->IsCFBundleOnApple())
-    {
-    fw_prefix = this->GetCFBundleDirectory(config, false);
-    fw_prefix += "/";
-    targetPrefix = fw_prefix.c_str();
-    targetSuffix = 0;
-    }
-
-  // Begin the final name with the prefix.
-  outPrefix = targetPrefix?targetPrefix:"";
-
-  // Append the target name or property-specified name.
-  outBase += this->GetOutputName(config, implib);
-
-  // Append the per-configuration postfix.
-  outBase += configPostfix?configPostfix:"";
-
-  // Name shared libraries with their version number on some platforms.
-  if(const char* soversion = this->GetProperty("SOVERSION"))
-    {
-    if(this->GetType() == cmTarget::SHARED_LIBRARY && !implib &&
-       this->Makefile->IsOn("CMAKE_SHARED_LIBRARY_NAME_WITH_VERSION"))
-      {
-      outBase += "-";
-      outBase += soversion;
-      }
-    }
-
-  // Append the suffix.
-  outSuffix = targetSuffix?targetSuffix:"";
-}
-
-//----------------------------------------------------------------------------
 void cmTarget::ComputeVersionedName(std::string& vName,
                                     std::string const& prefix,
                                     std::string const& base,
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 633e0ee..e22d3af 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -570,11 +570,6 @@ private:
 
   const char* GetSuffixVariableInternal(bool implib) const;
   const char* GetPrefixVariableInternal(bool implib) const;
-  std::string GetFullNameInternal(const std::string& config,
-                                  bool implib) const;
-  void GetFullNameInternal(const std::string& config, bool implib,
-                           std::string& outPrefix, std::string& outBase,
-                           std::string& outSuffix) const;
 
   // Use a makefile variable to set a default for the given property.
   // If the variable is not defined use the given default instead.

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7c8954af013c05f373c6753e17860dddd42eaee1
commit 7c8954af013c05f373c6753e17860dddd42eaee1
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Oct 9 01:26:16 2012 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Aug 2 22:06:02 2015 +0200

    cmGeneratorTarget: Move GetFullName from cmTarget.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 0fdf646..cdacfcb 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -576,7 +576,7 @@ const char* cmGeneratorTarget::GetLocationForBuild() const
       }
     }
   location += "/";
-  location += this->Target->GetFullName("", false);
+  location += this->GetFullName("", false);
   return location.c_str();
 }
 
@@ -896,7 +896,7 @@ std::string
 cmGeneratorTarget::GetAppBundleDirectory(const std::string& config,
                                          bool contentOnly) const
 {
-  std::string fpath = this->Target->GetFullName(config, false);
+  std::string fpath = this->GetFullName(config, false);
   fpath += ".app/Contents";
   if(!contentOnly)
     fpath += "/MacOS";
@@ -1655,7 +1655,7 @@ std::string cmGeneratorTarget::NormalGetFullPath(const std::string& config,
   // Add the full name of the target.
   if(implib)
     {
-    fpath += this->Target->GetFullName(config, true);
+    fpath += this->GetFullName(config, true);
     }
   else if(realname)
     {
@@ -1663,7 +1663,7 @@ std::string cmGeneratorTarget::NormalGetFullPath(const std::string& config,
     }
   else
     {
-    fpath += this->Target->GetFullName(config, false);
+    fpath += this->GetFullName(config, false);
     }
   return fpath;
 }
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index f0d8c60..d0d6709 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -119,6 +119,11 @@ public:
   std::string GetAppBundleDirectory(const std::string& config,
                                     bool contentOnly) const;
 
+  /** Get the full name of the target according to the settings in its
+      makefile.  */
+  std::string GetFullName(const std::string& config="",
+                          bool implib = false) const;
+
   /** Return the install name directory for the target in the
     * build tree.  For example: "\@rpath/", "\@loader_path/",
     * or "/full/path/to/library".  */
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index d53ecde..7b0e153 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -2742,7 +2742,8 @@ cmGlobalXCodeGenerator::CreateXCodeTarget(cmTarget& cmtarget,
     }
   else
     {
-    fullName = cmtarget.GetFullName(defConfig.c_str());
+    cmGeneratorTarget *gtgt = this->GetGeneratorTarget(&cmtarget);
+    fullName = gtgt->GetFullName(defConfig.c_str());
     }
   fileRef->AddAttribute("path", this->CreateString(fullName.c_str()));
   fileRef->AddAttribute("refType", this->CreateString("0"));
@@ -3688,7 +3689,7 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
             std::string universalFile = universal;
             universalFile += *arch;
             universalFile += "/";
-            universalFile += t->GetFullName(configName);
+            universalFile += gt->GetFullName(configName);
             makefileStream << "\t/bin/rm -f "
                            <<
               this->ConvertToRelativeForMake(universalFile.c_str())
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index 61d7847..94457bb 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -1112,7 +1112,8 @@ void cmLocalVisualStudio6Generator
       // Compute the proper name to use to link this library.
       std::string lib;
       std::string libDebug;
-      cmTarget* tgt = this->GlobalGenerator->FindTarget(j->first.c_str());
+      cmGeneratorTarget* tgt = this->GlobalGenerator->GetGeneratorTarget(
+          this->GlobalGenerator->FindTarget(j->first.c_str()));
       if(tgt)
         {
         lib = cmSystemTools::GetFilenameWithoutExtension
@@ -1328,11 +1329,11 @@ void cmLocalVisualStudio6Generator
      target.GetType() == cmTarget::SHARED_LIBRARY ||
      target.GetType() == cmTarget::MODULE_LIBRARY)
     {
-    outputName = target.GetFullName();
-    outputNameDebug = target.GetFullName("Debug");
-    outputNameRelease = target.GetFullName("Release");
-    outputNameMinSizeRel = target.GetFullName("MinSizeRel");
-    outputNameRelWithDebInfo = target.GetFullName("RelWithDebInfo");
+    outputName = gt->GetFullName();
+    outputNameDebug = gt->GetFullName("Debug");
+    outputNameRelease = gt->GetFullName("Release");
+    outputNameMinSizeRel = gt->GetFullName("MinSizeRel");
+    outputNameRelWithDebInfo = gt->GetFullName("RelWithDebInfo");
     }
   else if(target.GetType() == cmTarget::OBJECT_LIBRARY)
     {
@@ -1429,10 +1430,10 @@ void cmLocalVisualStudio6Generator
     fullPathImpRelease += "/";
     fullPathImpMinSizeRel += "/";
     fullPathImpRelWithDebInfo += "/";
-    fullPathImpDebug += target.GetFullName("Debug", true);
-    fullPathImpRelease += target.GetFullName("Release", true);
-    fullPathImpMinSizeRel += target.GetFullName("MinSizeRel", true);
-    fullPathImpRelWithDebInfo += target.GetFullName("RelWithDebInfo", true);
+    fullPathImpDebug += gt->GetFullName("Debug", true);
+    fullPathImpRelease += gt->GetFullName("Release", true);
+    fullPathImpMinSizeRel += gt->GetFullName("MinSizeRel", true);
+    fullPathImpRelWithDebInfo += gt->GetFullName("RelWithDebInfo", true);
 
     targetImplibFlagDebug = "/implib:";
     targetImplibFlagRelease = "/implib:";
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 724f575..9f26712 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -803,7 +803,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
   if (this->FortranProject)
     {
     // Intel Fortran >= 15.0 uses TargetName property.
-    std::string targetNameFull = target.GetFullName(configName);
+    std::string targetNameFull = gt->GetFullName(configName);
     std::string targetName =
       cmSystemTools::GetFilenameWithoutLastExtension(targetNameFull);
     std::string targetExt =
@@ -1074,6 +1074,9 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
       this->ConvertToOutputFormat(this->ModuleDefinitionFile, SHELL);
     linkOptions.AddFlag("ModuleDefinitionFile", defFile.c_str());
     }
+  cmGeneratorTarget* gt =
+    this->GlobalGenerator->GetGeneratorTarget(&target);
+
   if (target.GetType() == cmTarget::SHARED_LIBRARY &&
       this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS"))
     {
@@ -1104,7 +1107,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
       }
     case cmTarget::STATIC_LIBRARY:
     {
-    std::string targetNameFull = target.GetFullName(configName);
+    std::string targetNameFull = gt->GetFullName(configName);
     std::string libpath = target.GetDirectory(configName);
     libpath += "/";
     libpath += targetNameFull;
@@ -1148,8 +1151,6 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
                            targetNameImport, targetNamePDB, configName);
 
     // Compute the link library and directory information.
-    cmGeneratorTarget* gt =
-      this->GlobalGenerator->GetGeneratorTarget(&target);
     cmComputeLinkInformation* pcli = gt->GetLinkInformation(configName);
     if(!pcli)
       {
@@ -1247,8 +1248,6 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
                               targetNameImport, targetNamePDB, configName);
 
     // Compute the link library and directory information.
-    cmGeneratorTarget* gt =
-      this->GlobalGenerator->GetGeneratorTarget(&target);
     cmComputeLinkInformation* pcli = gt->GetLinkInformation(configName);
     if(!pcli)
       {
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index e8ef770..c484417 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -3587,20 +3587,6 @@ bool cmTarget::IsImportedSharedLibWithoutSOName(
 }
 
 //----------------------------------------------------------------------------
-std::string cmTarget::GetFullName(const std::string& config,
-                                  bool implib) const
-{
-  if(this->IsImported())
-    {
-    return this->GetFullNameImported(config, implib);
-    }
-  else
-    {
-    return this->GetFullNameInternal(config, implib);
-    }
-}
-
-//----------------------------------------------------------------------------
 std::string
 cmTarget::GetFullNameImported(const std::string& config, bool implib) const
 {
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 4b804da..633e0ee 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -368,11 +368,6 @@ public:
   ///! Return the preferred linker language for this target
   std::string GetLinkerLanguage(const std::string& config = "") const;
 
-  /** Get the full name of the target according to the settings in its
-      makefile.  */
-  std::string GetFullName(const std::string& config="",
-                          bool implib = false) const;
-
   /** Whether this library has \@rpath and platform supports it.  */
   bool HasMacOSXRpathInstallNameDir(const std::string& config) const;
 
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 16edf3c..2b33c2c 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1774,7 +1774,7 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions()
       else
         {
         outDir = this->Target->GetDirectory(config->c_str()) + "/";
-        targetNameFull = this->Target->GetFullName(config->c_str());
+        targetNameFull = this->GeneratorTarget->GetFullName(config->c_str());
         }
       this->ConvertToWindowsSlash(intermediateDir);
       this->ConvertToWindowsSlash(outDir);

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list