[Cmake-commits] CMake branch, next, updated. v3.4.0-rc1-244-gec658cb

Stephen Kelly steveire at gmail.com
Thu Oct 8 17:53:23 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  ec658cbeb4356219dfbcf1b34b8488eb2fe187cb (commit)
       via  d5e347476ec94b035a98d0948bc46ffa7f30cc86 (commit)
       via  6def43706f9adb61ed0397e685e2585008d7ba32 (commit)
       via  2d6a2675bdc7c6c4ba12efc75ff23afcf6b5f25d (commit)
       via  d3d8f3d2afdc15fbcf1c8e9f6b794467e08a24fb (commit)
       via  5ebbd4fe9156d58a5863172fe80c7fe80d1b7219 (commit)
       via  06f076e26eeba6fa589285da1fa1b004aca2ac72 (commit)
       via  e4d314808ea90e7bb5facdc40fcbd579e197b41f (commit)
       via  bb03982fc6abea876fbfb6078608e85571c5f8a5 (commit)
       via  ddfc20d3a967f98c47d2bd169b881d0b88f966d7 (commit)
       via  0dbd2ccd93a9f3817ccc9c1bee843915c8cc079c (commit)
       via  e0261a1e20f14cc2ca593bb978479b52954397d8 (commit)
       via  df42dbb3558a6ba604ab584b21dfe7f8722eb025 (commit)
       via  a8429a402da4aeb717f4af234c8d14d1c4e10ed7 (commit)
       via  370bb92c10cd8fec7770267c93515623e4168012 (commit)
       via  27916f2cd10904deda1a44bf221fbdef7ba1af66 (commit)
      from  fe32129dabe409b66d09e03c489d18b7a35b383a (commit)

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

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ec658cbeb4356219dfbcf1b34b8488eb2fe187cb
commit ec658cbeb4356219dfbcf1b34b8488eb2fe187cb
Merge: fe32129 d5e347476
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Oct 8 17:53:21 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Oct 8 17:53:21 2015 -0400

    Merge topic 'use-generator-target' into next
    
    d5e34747 cmGeneratorTarget: Move IsImportedSharedLibWithoutSOName from cmTarget.
    6def4370 cmGeneratorTarget: Move GetOutputTargetType from cmTarget.
    2d6a2675 cmGeneratorTarget: Move HasMacOSXRpathInstallNameDir from cmTarget.
    d3d8f3d2 cmGeneratorTarget: Move HaveInstallTreeRPATH from cmTarget.
    5ebbd4fe cmGeneratorTarget: Move ComputePDBOutputDir from cmTarget.
    06f076e2 cmGeneratorTarget: Move IsNullImpliedByLinkLibraries from cmTarget.
    e4d31480 cmGeneratorTarget: Move output info from cmTarget.
    bb03982f cmGeneratorTarget: Move UsesDefaultOutputDir from cmTarget.
    ddfc20d3 cmGeneratorTarget: Move GetPDBDirectory from cmTarget.
    0dbd2ccd cmGeneratorTarget: Move GetDirectory from cmTarget.
    e0261a1e cmTarget: Make OutputInfo definition public.
    df42dbb3 cmGeneratorTarget: Move link implementation from cmTarget.
    a8429a40 cmTarget: Split storage of link implementation from backtraces.
    370bb92c cmGeneratorTarget: Issue messages through the local generator.
    27916f2c cmLocalGenerator: Add cmake instance accessor.


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d5e347476ec94b035a98d0948bc46ffa7f30cc86
commit d5e347476ec94b035a98d0948bc46ffa7f30cc86
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Aug 5 19:19:50 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 8 23:53:01 2015 +0200

    cmGeneratorTarget: Move IsImportedSharedLibWithoutSOName from cmTarget.

diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index b8e2284..9371546 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -1101,9 +1101,10 @@ void cmComputeLinkInformation::AddTargetItem(std::string const& item,
     this->SharedLibrariesLinked.insert(target);
     }
 
+  cmGeneratorTarget *gtgt = this->GlobalGenerator->GetGeneratorTarget(target);
   // Handle case of an imported shared library with no soname.
   if(this->NoSONameUsesPath &&
-     target->IsImportedSharedLibWithoutSOName(this->Config))
+     gtgt->IsImportedSharedLibWithoutSOName(this->Config))
     {
     this->AddSharedLibNoSOName(item);
     return;
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index a588bb6..c4a083d 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1338,6 +1338,19 @@ bool cmGeneratorTarget::IsChrpathUsed(const std::string& config) const
   return false;
 }
 
+//----------------------------------------------------------------------------
+bool cmGeneratorTarget::IsImportedSharedLibWithoutSOName(
+                                          const std::string& config) const
+{
+  if(this->IsImported() && this->GetType() == cmTarget::SHARED_LIBRARY)
+    {
+    if(cmTarget::ImportInfo const* info = this->Target->GetImportInfo(config))
+      {
+      return info->NoSOName;
+      }
+    }
+  return false;
+}
 
 //----------------------------------------------------------------------------
 bool cmGeneratorTarget::HasMacOSXRpathInstallNameDir(
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 0e41661..49de632 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -415,6 +415,10 @@ public:
   /** Whether this library defaults to \@rpath.  */
   bool MacOSXRpathInstallNameDirDefault() const;
 
+  /** Test for special case of a third-party shared library that has
+      no soname at all.  */
+  bool IsImportedSharedLibWithoutSOName(const std::string& config) const;
+
 private:
   friend class cmTargetTraceDependencies;
   struct SourceEntry { std::vector<cmSourceFile*> Depends; };
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 88bda67..3de7efe 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2178,20 +2178,6 @@ const char* cmTarget::GetPrefixVariableInternal(bool implib) const
 }
 
 //----------------------------------------------------------------------------
-bool cmTarget::IsImportedSharedLibWithoutSOName(
-                                          const std::string& config) const
-{
-  if(this->IsImported() && this->GetType() == cmTarget::SHARED_LIBRARY)
-    {
-    if(cmTarget::ImportInfo const* info = this->GetImportInfo(config))
-      {
-      return info->NoSOName;
-      }
-    }
-  return false;
-}
-
-//----------------------------------------------------------------------------
 std::string
 cmTarget::GetFullNameImported(const std::string& config, bool implib) const
 {
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 6ba9772..16d0121 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -244,10 +244,6 @@ public:
   void
   GetTargetVersion(bool soversion, int& major, int& minor, int& patch) const;
 
-  /** Test for special case of a third-party shared library that has
-      no soname at all.  */
-  bool IsImportedSharedLibWithoutSOName(const std::string& config) const;
-
   /** Does this target have a GNU implib to convert to MS format?  */
   bool HasImplibGNUtoMS() const;
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6def43706f9adb61ed0397e685e2585008d7ba32
commit 6def43706f9adb61ed0397e685e2585008d7ba32
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Aug 5 19:11:48 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 8 23:53:01 2015 +0200

    cmGeneratorTarget: Move GetOutputTargetType from cmTarget.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 841f818..a588bb6 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -340,6 +340,62 @@ const char *cmGeneratorTarget::GetProperty(const std::string& prop) const
 }
 
 //----------------------------------------------------------------------------
+const char* cmGeneratorTarget::GetOutputTargetType(bool implib) const
+{
+  switch(this->GetType())
+    {
+    case cmTarget::SHARED_LIBRARY:
+      if(this->Target->IsDLLPlatform())
+        {
+        if(implib)
+          {
+          // A DLL import library is treated as an archive target.
+          return "ARCHIVE";
+          }
+        else
+          {
+          // A DLL shared library is treated as a runtime target.
+          return "RUNTIME";
+          }
+        }
+      else
+        {
+        // For non-DLL platforms shared libraries are treated as
+        // library targets.
+        return "LIBRARY";
+        }
+    case cmTarget::STATIC_LIBRARY:
+      // Static libraries are always treated as archive targets.
+      return "ARCHIVE";
+    case cmTarget::MODULE_LIBRARY:
+      if(implib)
+        {
+        // Module libraries are always treated as library targets.
+        return "ARCHIVE";
+        }
+      else
+        {
+        // Module import libraries are treated as archive targets.
+        return "LIBRARY";
+        }
+    case cmTarget::EXECUTABLE:
+      if(implib)
+        {
+        // Executable import libraries are treated as archive targets.
+        return "ARCHIVE";
+        }
+      else
+        {
+        // Executables are always treated as runtime targets.
+        return "RUNTIME";
+        }
+    default:
+      break;
+    }
+  return "";
+}
+
+//----------------------------------------------------------------------------
 std::string cmGeneratorTarget::GetOutputName(const std::string& config,
                                              bool implib) const
 {
@@ -355,7 +411,7 @@ std::string cmGeneratorTarget::GetOutputName(const std::string& config,
 
     // Compute output name.
     std::vector<std::string> props;
-    std::string type = this->Target->GetOutputTargetType(implib);
+    std::string type = this->GetOutputTargetType(implib);
     std::string configUpper = cmSystemTools::UpperCase(config);
     if(!type.empty() && !configUpper.empty())
       {
@@ -4661,7 +4717,7 @@ bool cmGeneratorTarget::ComputeOutputDir(const std::string& config,
 
   // Look for a target property defining the target output directory
   // based on the target type.
-  std::string targetTypeName = this->Target->GetOutputTargetType(implib);
+  std::string targetTypeName = this->GetOutputTargetType(implib);
   const char* propertyName = 0;
   std::string propertyNameStr = targetTypeName;
   if(!propertyNameStr.empty())
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index fd4ee56..0e41661 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -439,6 +439,9 @@ private:
   typedef std::map<std::string, LinkClosure> LinkClosureMapType;
   mutable LinkClosureMapType LinkClosureMap;
 
+  // Returns ARCHIVE, LIBRARY, or RUNTIME based on platform and type.
+  const char* GetOutputTargetType(bool implib) const;
+
   struct CompatibleInterfacesBase
   {
     std::set<std::string> PropsBool;
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 0b2d9fc..88bda67 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2272,62 +2272,6 @@ void cmTarget::SetPropertyDefault(const std::string& property,
 }
 
 //----------------------------------------------------------------------------
-const char* cmTarget::GetOutputTargetType(bool implib) const
-{
-  switch(this->GetType())
-    {
-    case cmTarget::SHARED_LIBRARY:
-      if(this->DLLPlatform)
-        {
-        if(implib)
-          {
-          // A DLL import library is treated as an archive target.
-          return "ARCHIVE";
-          }
-        else
-          {
-          // A DLL shared library is treated as a runtime target.
-          return "RUNTIME";
-          }
-        }
-      else
-        {
-        // For non-DLL platforms shared libraries are treated as
-        // library targets.
-        return "LIBRARY";
-        }
-    case cmTarget::STATIC_LIBRARY:
-      // Static libraries are always treated as archive targets.
-      return "ARCHIVE";
-    case cmTarget::MODULE_LIBRARY:
-      if(implib)
-        {
-        // Module libraries are always treated as library targets.
-        return "ARCHIVE";
-        }
-      else
-        {
-        // Module import libraries are treated as archive targets.
-        return "LIBRARY";
-        }
-    case cmTarget::EXECUTABLE:
-      if(implib)
-        {
-        // Executable import libraries are treated as archive targets.
-        return "ARCHIVE";
-        }
-      else
-        {
-        // Executables are always treated as runtime targets.
-        return "RUNTIME";
-        }
-    default:
-      break;
-    }
-  return "";
-}
-
-//----------------------------------------------------------------------------
 std::string cmTarget::GetFrameworkVersion() const
 {
   assert(this->GetType() != INTERFACE_LIBRARY);
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 3cbee76..6ba9772 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -415,9 +415,6 @@ private:
   void SetPropertyDefault(const std::string& property,
                           const char* default_value);
 
-  // Returns ARCHIVE, LIBRARY, or RUNTIME based on platform and type.
-  const char* GetOutputTargetType(bool implib) const;
-
   std::string GetFullNameImported(const std::string& config,
                                   bool implib) const;
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2d6a2675bdc7c6c4ba12efc75ff23afcf6b5f25d
commit 2d6a2675bdc7c6c4ba12efc75ff23afcf6b5f25d
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Aug 5 19:07:03 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 8 23:53:01 2015 +0200

    cmGeneratorTarget: Move HasMacOSXRpathInstallNameDir from cmTarget.

diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index d907dd0..b8e2284 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -1783,12 +1783,13 @@ void
 cmComputeLinkInformation::AddLibraryRuntimeInfo(std::string const& fullPath,
                                                 cmTarget const* target)
 {
+  cmGeneratorTarget *gtgt = this->GlobalGenerator->GetGeneratorTarget(target);
   // Ignore targets on Apple where install_name is not @rpath.
   // The dependenty library can be found with other means such as
   // @loader_path or full paths.
   if(this->Makefile->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME"))
     {
-    if(!target->HasMacOSXRpathInstallNameDir(this->Config))
+    if(!gtgt->HasMacOSXRpathInstallNameDir(this->Config))
       {
       return;
       }
@@ -1810,7 +1811,6 @@ cmComputeLinkInformation::AddLibraryRuntimeInfo(std::string const& fullPath,
 
   // Try to get the soname of the library.  Only files with this name
   // could possibly conflict.
-  cmGeneratorTarget *gtgt = this->GlobalGenerator->GetGeneratorTarget(target);
   std::string soName = gtgt->GetSOName(this->Config);
   const char* soname = soName.empty()? 0 : soName.c_str();
 
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 6ad6c69..841f818 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1284,6 +1284,119 @@ bool cmGeneratorTarget::IsChrpathUsed(const std::string& config) const
 
 
 //----------------------------------------------------------------------------
+bool cmGeneratorTarget::HasMacOSXRpathInstallNameDir(
+    const std::string& config) const
+{
+  bool install_name_is_rpath = false;
+  bool macosx_rpath = false;
+
+  if(!this->IsImported())
+    {
+    if(this->GetType() != cmTarget::SHARED_LIBRARY)
+      {
+      return false;
+      }
+    const char* install_name = this->GetProperty("INSTALL_NAME_DIR");
+    bool use_install_name =
+      this->GetPropertyAsBool("BUILD_WITH_INSTALL_RPATH");
+    if(install_name && use_install_name &&
+       std::string(install_name) == "@rpath")
+      {
+      install_name_is_rpath = true;
+      }
+    else if(install_name && use_install_name)
+      {
+      return false;
+      }
+    if(!install_name_is_rpath)
+      {
+      macosx_rpath = this->MacOSXRpathInstallNameDirDefault();
+      }
+    }
+  else
+    {
+    // Lookup the imported soname.
+    if(cmTarget::ImportInfo const* info = this->Target->GetImportInfo(config))
+      {
+      if(!info->NoSOName && !info->SOName.empty())
+        {
+        if(info->SOName.find("@rpath/") == 0)
+          {
+          install_name_is_rpath = true;
+          }
+        }
+      else
+        {
+        std::string install_name;
+        cmSystemTools::GuessLibraryInstallName(info->Location, install_name);
+        if(install_name.find("@rpath") != std::string::npos)
+          {
+          install_name_is_rpath = true;
+          }
+        }
+      }
+    }
+
+  if(!install_name_is_rpath && !macosx_rpath)
+    {
+    return false;
+    }
+
+  if(!this->Makefile->IsSet("CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG"))
+    {
+    std::ostringstream w;
+    w << "Attempting to use";
+    if(macosx_rpath)
+      {
+      w << " MACOSX_RPATH";
+      }
+    else
+      {
+      w << " @rpath";
+      }
+    w << " without CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG being set.";
+    w << "  This could be because you are using a Mac OS X version";
+    w << " less than 10.5 or because CMake's platform configuration is";
+    w << " corrupt.";
+    cmake* cm = this->Makefile->GetCMakeInstance();
+    cm->IssueMessage(cmake::FATAL_ERROR, w.str(), this->Target->GetBacktrace());
+    }
+
+  return true;
+}
+
+//----------------------------------------------------------------------------
+bool cmGeneratorTarget::MacOSXRpathInstallNameDirDefault() const
+{
+  // we can't do rpaths when unsupported
+  if(!this->Makefile->IsSet("CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG"))
+    {
+    return false;
+    }
+
+  const char* macosx_rpath_str = this->GetProperty("MACOSX_RPATH");
+  if(macosx_rpath_str)
+    {
+    return this->GetPropertyAsBool("MACOSX_RPATH");
+    }
+
+  cmPolicies::PolicyStatus cmp0042 = this->Target->GetPolicyStatusCMP0042();
+
+  if(cmp0042 == cmPolicies::WARN)
+    {
+    this->Makefile->GetGlobalGenerator()->
+      AddCMP0042WarnTarget(this->GetName());
+    }
+
+  if(cmp0042 == cmPolicies::NEW)
+    {
+    return true;
+    }
+
+  return false;
+}
+
+//----------------------------------------------------------------------------
 std::string cmGeneratorTarget::GetSOName(const std::string& config) const
 {
   if(this->Target->IsImported())
@@ -1428,7 +1541,7 @@ cmGeneratorTarget::GetInstallNameDirForBuildTree(
      !this->GetPropertyAsBool("SKIP_BUILD_RPATH"))
     {
     std::string dir;
-    if(this->Target->MacOSXRpathInstallNameDirDefault())
+    if(this->MacOSXRpathInstallNameDirDefault())
       {
       dir = "@rpath";
       }
@@ -1464,7 +1577,7 @@ std::string cmGeneratorTarget::GetInstallNameDirForInstallTree() const
       }
     if(!install_name_dir)
       {
-      if(this->Target->MacOSXRpathInstallNameDirDefault())
+      if(this->MacOSXRpathInstallNameDirDefault())
         {
         dir = "@rpath/";
         }
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index f068cae..fd4ee56 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -409,6 +409,12 @@ public:
 
   bool HaveInstallTreeRPATH() const;
 
+  /** Whether this library has \@rpath and platform supports it.  */
+  bool HasMacOSXRpathInstallNameDir(const std::string& config) const;
+
+  /** Whether this library defaults to \@rpath.  */
+  bool MacOSXRpathInstallNameDirDefault() const;
+
 private:
   friend class cmTargetTraceDependencies;
   struct SourceEntry { std::vector<cmSourceFile*> Depends; };
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index dd1d405..0b2d9fc 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2178,118 +2178,6 @@ const char* cmTarget::GetPrefixVariableInternal(bool implib) const
 }
 
 //----------------------------------------------------------------------------
-bool cmTarget::HasMacOSXRpathInstallNameDir(const std::string& config) const
-{
-  bool install_name_is_rpath = false;
-  bool macosx_rpath = false;
-
-  if(!this->IsImportedTarget)
-    {
-    if(this->GetType() != cmTarget::SHARED_LIBRARY)
-      {
-      return false;
-      }
-    const char* install_name = this->GetProperty("INSTALL_NAME_DIR");
-    bool use_install_name =
-      this->GetPropertyAsBool("BUILD_WITH_INSTALL_RPATH");
-    if(install_name && use_install_name &&
-       std::string(install_name) == "@rpath")
-      {
-      install_name_is_rpath = true;
-      }
-    else if(install_name && use_install_name)
-      {
-      return false;
-      }
-    if(!install_name_is_rpath)
-      {
-      macosx_rpath = this->MacOSXRpathInstallNameDirDefault();
-      }
-    }
-  else
-    {
-    // Lookup the imported soname.
-    if(cmTarget::ImportInfo const* info = this->GetImportInfo(config))
-      {
-      if(!info->NoSOName && !info->SOName.empty())
-        {
-        if(info->SOName.find("@rpath/") == 0)
-          {
-          install_name_is_rpath = true;
-          }
-        }
-      else
-        {
-        std::string install_name;
-        cmSystemTools::GuessLibraryInstallName(info->Location, install_name);
-        if(install_name.find("@rpath") != std::string::npos)
-          {
-          install_name_is_rpath = true;
-          }
-        }
-      }
-    }
-
-  if(!install_name_is_rpath && !macosx_rpath)
-    {
-    return false;
-    }
-
-  if(!this->Makefile->IsSet("CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG"))
-    {
-    std::ostringstream w;
-    w << "Attempting to use";
-    if(macosx_rpath)
-      {
-      w << " MACOSX_RPATH";
-      }
-    else
-      {
-      w << " @rpath";
-      }
-    w << " without CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG being set.";
-    w << "  This could be because you are using a Mac OS X version";
-    w << " less than 10.5 or because CMake's platform configuration is";
-    w << " corrupt.";
-    cmake* cm = this->Makefile->GetCMakeInstance();
-    cm->IssueMessage(cmake::FATAL_ERROR, w.str(), this->GetBacktrace());
-    }
-
-  return true;
-}
-
-//----------------------------------------------------------------------------
-bool cmTarget::MacOSXRpathInstallNameDirDefault() const
-{
-  // we can't do rpaths when unsupported
-  if(!this->Makefile->IsSet("CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG"))
-    {
-    return false;
-    }
-
-  const char* macosx_rpath_str = this->GetProperty("MACOSX_RPATH");
-  if(macosx_rpath_str)
-    {
-    return this->GetPropertyAsBool("MACOSX_RPATH");
-    }
-
-  cmPolicies::PolicyStatus cmp0042 = this->GetPolicyStatusCMP0042();
-
-  if(cmp0042 == cmPolicies::WARN)
-    {
-    this->Makefile->GetGlobalGenerator()->
-      AddCMP0042WarnTarget(this->GetName());
-    }
-
-  if(cmp0042 == cmPolicies::NEW)
-    {
-    return true;
-    }
-
-  return false;
-}
-
-//----------------------------------------------------------------------------
 bool cmTarget::IsImportedSharedLibWithoutSOName(
                                           const std::string& config) const
 {
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 4b369d3..3cbee76 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -244,12 +244,6 @@ public:
   void
   GetTargetVersion(bool soversion, int& major, int& minor, int& patch) const;
 
-  /** Whether this library has \@rpath and platform supports it.  */
-  bool HasMacOSXRpathInstallNameDir(const std::string& config) const;
-
-  /** Whether this library defaults to \@rpath.  */
-  bool MacOSXRpathInstallNameDirDefault() const;
-
   /** Test for special case of a third-party shared library that has
       no soname at all.  */
   bool IsImportedSharedLibWithoutSOName(const std::string& config) const;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d3d8f3d2afdc15fbcf1c8e9f6b794467e08a24fb
commit d3d8f3d2afdc15fbcf1c8e9f6b794467e08a24fb
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Aug 5 19:02:45 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 8 23:53:01 2015 +0200

    cmGeneratorTarget: Move HaveInstallTreeRPATH from cmTarget.

diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index d35b566..d907dd0 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -1920,7 +1920,7 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
     (for_install ||
      this->Target->Target->GetPropertyAsBool("BUILD_WITH_INSTALL_RPATH"));
   bool use_install_rpath =
-    (outputRuntime && this->Target->Target->HaveInstallTreeRPATH() &&
+    (outputRuntime && this->Target->HaveInstallTreeRPATH() &&
      linking_for_install);
   bool use_build_rpath =
     (outputRuntime && this->Target->HaveBuildTreeRPATH(this->Config) &&
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 3a67d2c..6ad6c69 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1212,7 +1212,7 @@ cmGeneratorTarget::NeedRelinkBeforeInstall(const std::string& config) const
   // will likely change between the build tree and install tree and
   // this target must be relinked.
   return this->HaveBuildTreeRPATH(config)
-      || this->Target->HaveInstallTreeRPATH();
+      || this->HaveInstallTreeRPATH();
 }
 
 //----------------------------------------------------------------------------
@@ -4695,6 +4695,14 @@ bool cmGeneratorTarget::ComputePDBOutputDir(const std::string& kind,
 }
 
 //----------------------------------------------------------------------------
+bool cmGeneratorTarget::HaveInstallTreeRPATH() const
+{
+  const char* install_rpath = this->GetProperty("INSTALL_RPATH");
+  return (install_rpath && *install_rpath) &&
+          !this->Makefile->IsOn("CMAKE_SKIP_INSTALL_RPATH");
+}
+
+//----------------------------------------------------------------------------
 void
 cmGeneratorTarget::ComputeLinkInterfaceLibraries(
   const std::string& config,
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 4ca0447..f068cae 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -407,6 +407,8 @@ public:
 
   class TargetPropertyEntry;
 
+  bool HaveInstallTreeRPATH() const;
+
 private:
   friend class cmTargetTraceDependencies;
   struct SourceEntry { std::vector<cmSourceFile*> Depends; };
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 40f93a3..dd1d405 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2384,14 +2384,6 @@ void cmTarget::SetPropertyDefault(const std::string& property,
 }
 
 //----------------------------------------------------------------------------
-bool cmTarget::HaveInstallTreeRPATH() const
-{
-  const char* install_rpath = this->GetProperty("INSTALL_RPATH");
-  return (install_rpath && *install_rpath) &&
-          !this->Makefile->IsOn("CMAKE_SKIP_INSTALL_RPATH");
-}
-
-//----------------------------------------------------------------------------
 const char* cmTarget::GetOutputTargetType(bool implib) const
 {
   switch(this->GetType())
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index d37f934..4b369d3 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -262,8 +262,6 @@ public:
   bool GetImplibGNUtoMS(std::string const& gnuName, std::string& out,
                         const char* newExt = 0) const;
 
-  bool HaveInstallTreeRPATH() const;
-
   // Get the properties
   cmPropertyMap &GetProperties() const { return this->Properties; }
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5ebbd4fe9156d58a5863172fe80c7fe80d1b7219
commit 5ebbd4fe9156d58a5863172fe80c7fe80d1b7219
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Aug 5 19:01:23 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 8 23:53:01 2015 +0200

    cmGeneratorTarget: Move ComputePDBOutputDir from cmTarget.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 3651da6..3a67d2c 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1780,8 +1780,7 @@ cmGeneratorTarget::CompileInfo const* cmGeneratorTarget::GetCompileInfo(
   if(i == this->CompileInfoMap.end())
     {
     CompileInfo info;
-    this->Target
-        ->ComputePDBOutputDir("COMPILE_PDB", config, info.CompilePdbDir);
+    this->ComputePDBOutputDir("COMPILE_PDB", config, info.CompilePdbDir);
     CompileInfoMapType::value_type entry(config_upper, info);
     i = this->CompileInfoMap.insert(entry).first;
     }
@@ -4519,7 +4518,7 @@ cmGeneratorTarget::OutputInfo const* cmGeneratorTarget::GetOutputInfo(
     // Compute output directories.
     this->ComputeOutputDir(config, false, info.OutDir);
     this->ComputeOutputDir(config, true, info.ImpDir);
-    if(!this->Target->ComputePDBOutputDir("PDB", config, info.PdbDir))
+    if(!this->ComputePDBOutputDir("PDB", config, info.PdbDir))
       {
       info.PdbDir = info.OutDir;
       }
@@ -4635,6 +4634,67 @@ bool cmGeneratorTarget::ComputeOutputDir(const std::string& config,
 }
 
 //----------------------------------------------------------------------------
+bool cmGeneratorTarget::ComputePDBOutputDir(const std::string& kind,
+                                   const std::string& config,
+                                   std::string& out) const
+{
+  // Look for a target property defining the target output directory
+  // based on the target type.
+  const char* propertyName = 0;
+  std::string propertyNameStr = kind;
+  if(!propertyNameStr.empty())
+    {
+    propertyNameStr += "_OUTPUT_DIRECTORY";
+    propertyName = propertyNameStr.c_str();
+    }
+  std::string conf = config;
+
+  // Check for a per-configuration output directory target property.
+  std::string configUpper = cmSystemTools::UpperCase(conf);
+  const char* configProp = 0;
+  std::string configPropStr = kind;
+  if(!configPropStr.empty())
+    {
+    configPropStr += "_OUTPUT_DIRECTORY_";
+    configPropStr += configUpper;
+    configProp = configPropStr.c_str();
+    }
+
+  // Select an output directory.
+  if(const char* config_outdir = this->GetProperty(configProp))
+    {
+    // Use the user-specified per-configuration output directory.
+    out = config_outdir;
+
+    // Skip per-configuration subdirectory.
+    conf = "";
+    }
+  else if(const char* outdir = this->GetProperty(propertyName))
+    {
+    // Use the user-specified output directory.
+    out = outdir;
+    }
+  if(out.empty())
+    {
+    return false;
+    }
+
+  // Convert the output path to a full path in case it is
+  // specified as a relative path.  Treat a relative path as
+  // relative to the current output directory for this makefile.
+  out = (cmSystemTools::CollapseFullPath
+         (out, this->Makefile->GetCurrentBinaryDirectory()));
+
+  // The generator may add the configuration's subdirectory.
+  if(!conf.empty())
+    {
+    this->LocalGenerator->GetGlobalGenerator()->
+      AppendDirectoryForConfig("/", conf, "", out);
+    }
+  return true;
+}
+
+//----------------------------------------------------------------------------
 void
 cmGeneratorTarget::ComputeLinkInterfaceLibraries(
   const std::string& config,
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index f0f6d41..4ca0447 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -528,6 +528,9 @@ private:
   mutable bool DebugSourcesDone;
   mutable bool LinkImplementationLanguageIsContextDependent;
 
+  bool ComputePDBOutputDir(const std::string& kind, const std::string& config,
+                           std::string& out) const;
+
 public:
   std::vector<cmTarget const*> const&
     GetLinkImplementationClosure(const std::string& config) const;
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index af7fe2e..40f93a3 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2448,67 +2448,6 @@ const char* cmTarget::GetOutputTargetType(bool implib) const
 }
 
 //----------------------------------------------------------------------------
-bool cmTarget::ComputePDBOutputDir(const std::string& kind,
-                                   const std::string& config,
-                                   std::string& out) const
-{
-  // Look for a target property defining the target output directory
-  // based on the target type.
-  const char* propertyName = 0;
-  std::string propertyNameStr = kind;
-  if(!propertyNameStr.empty())
-    {
-    propertyNameStr += "_OUTPUT_DIRECTORY";
-    propertyName = propertyNameStr.c_str();
-    }
-  std::string conf = config;
-
-  // Check for a per-configuration output directory target property.
-  std::string configUpper = cmSystemTools::UpperCase(conf);
-  const char* configProp = 0;
-  std::string configPropStr = kind;
-  if(!configPropStr.empty())
-    {
-    configPropStr += "_OUTPUT_DIRECTORY_";
-    configPropStr += configUpper;
-    configProp = configPropStr.c_str();
-    }
-
-  // Select an output directory.
-  if(const char* config_outdir = this->GetProperty(configProp))
-    {
-    // Use the user-specified per-configuration output directory.
-    out = config_outdir;
-
-    // Skip per-configuration subdirectory.
-    conf = "";
-    }
-  else if(const char* outdir = this->GetProperty(propertyName))
-    {
-    // Use the user-specified output directory.
-    out = outdir;
-    }
-  if(out.empty())
-    {
-    return false;
-    }
-
-  // Convert the output path to a full path in case it is
-  // specified as a relative path.  Treat a relative path as
-  // relative to the current output directory for this makefile.
-  out = (cmSystemTools::CollapseFullPath
-         (out, this->Makefile->GetCurrentBinaryDirectory()));
-
-  // The generator may add the configuration's subdirectory.
-  if(!conf.empty())
-    {
-    this->Makefile->GetGlobalGenerator()->
-      AppendDirectoryForConfig("/", conf, "", out);
-    }
-  return true;
-}
-
-//----------------------------------------------------------------------------
 std::string cmTarget::GetFrameworkVersion() const
 {
   assert(this->GetType() != INTERFACE_LIBRARY);
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index a3a8063..d37f934 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -467,9 +467,6 @@ private:
   bool LinkLibrariesForVS6Analyzed;
 #endif
 
-  bool ComputePDBOutputDir(const std::string& kind, const std::string& config,
-                           std::string& out) const;
-
   // Cache import information from properties for each configuration.
   struct ImportInfo
   {

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=06f076e26eeba6fa589285da1fa1b004aca2ac72
commit 06f076e26eeba6fa589285da1fa1b004aca2ac72
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Aug 5 18:41:53 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 8 23:53:01 2015 +0200

    cmGeneratorTarget: Move IsNullImpliedByLinkLibraries from cmTarget.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 2f2fb3b..3651da6 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -3928,7 +3928,7 @@ PropertyType checkInterfacePropertyCompatibility(cmGeneratorTarget const* tgt,
                                   .find(p)
                                   != tgt->Target->GetProperties().end();
   const bool impliedByUse =
-          tgt->Target->IsNullImpliedByLinkLibraries(p);
+          tgt->IsNullImpliedByLinkLibraries(p);
   assert((impliedByUse ^ explicitlySet)
       || (!impliedByUse && !explicitlySet));
 
@@ -5046,6 +5046,14 @@ cmGeneratorTarget::GetLinkImplementationLibrariesInternal(
 }
 
 //----------------------------------------------------------------------------
+bool
+cmGeneratorTarget::IsNullImpliedByLinkLibraries(const std::string &p) const
+{
+  return this->LinkImplicitNullProperties.find(p)
+      != this->LinkImplicitNullProperties.end();
+}
+
+//----------------------------------------------------------------------------
 void cmGeneratorTarget::ComputeLinkImplementationLibraries(
   const std::string& config,
   cmOptionalLinkImplementation& impl,
@@ -5130,7 +5138,7 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
       {
       if (!this->GetProperty(*it))
         {
-        this->Target->LinkImplicitNullProperties.insert(*it);
+        this->LinkImplicitNullProperties.insert(*it);
         }
       }
     cge->GetMaxLanguageStandard(this->Target,
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 77d3b99..f0f6d41 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -317,6 +317,8 @@ public:
   typedef std::map<std::string, CompileInfo> CompileInfoMapType;
   mutable CompileInfoMapType CompileInfoMap;
 
+  bool IsNullImpliedByLinkLibraries(const std::string &p) const;
+
   /** Get the name of the compiler pdb file for the target.  */
   std::string GetCompilePDBName(const std::string& config="") const;
 
@@ -486,6 +488,7 @@ private:
   std::vector<TargetPropertyEntry*> CompileFeaturesEntries;
   std::vector<TargetPropertyEntry*> CompileDefinitionsEntries;
   std::vector<TargetPropertyEntry*> SourceEntries;
+  mutable std::set<std::string> LinkImplicitNullProperties;
 
   void ExpandLinkItems(std::string const& prop, std::string const& value,
                        std::string const& config, cmTarget const* headTarget,
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index c20ce83..af7fe2e 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2554,13 +2554,6 @@ const char* cmTarget::GetExportMacro() const
 }
 
 //----------------------------------------------------------------------------
-bool cmTarget::IsNullImpliedByLinkLibraries(const std::string &p) const
-{
-  return this->LinkImplicitNullProperties.find(p)
-      != this->LinkImplicitNullProperties.end();
-}
-
-//----------------------------------------------------------------------------
 void
 cmTarget::GetObjectLibrariesCMP0026(std::vector<cmTarget*>& objlibs) const
 {
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index dda5384..a3a8063 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -326,8 +326,6 @@ public:
 
   void AppendBuildInterfaceIncludes();
 
-  bool IsNullImpliedByLinkLibraries(const std::string &p) const;
-
   std::string GetDebugGeneratorExpressions(const std::string &value,
                                   cmTarget::LinkLibraryType llt) const;
 
@@ -439,7 +437,6 @@ private:
   std::set<std::string> SystemIncludeDirectories;
   std::set<std::string> LinkDirectoriesEmmitted;
   std::set<std::string> Utilities;
-  mutable std::set<std::string> LinkImplicitNullProperties;
   std::map<std::string, cmListFileBacktrace> UtilityBacktraces;
   cmPolicies::PolicyMap PolicyMap;
   std::string Name;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e4d314808ea90e7bb5facdc40fcbd579e197b41f
commit e4d314808ea90e7bb5facdc40fcbd579e197b41f
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Aug 5 18:55:14 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 8 23:53:00 2015 +0200

    cmGeneratorTarget: Move output info from cmTarget.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 9f46909..2f2fb3b 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -4464,8 +4464,7 @@ std::string cmGeneratorTarget::GetDirectory(const std::string& config,
       cmSystemTools::GetFilenamePath(
       this->Target->ImportedGetFullPath(config, implib));
     }
-  else if(cmTarget::OutputInfo const* info =
-      this->Target->GetOutputInfo(config))
+  else if(OutputInfo const* info = this->GetOutputInfo(config))
     {
     // Return the directory in which the target will be built.
     return implib? info->ImpDir : info->OutDir;
@@ -4478,7 +4477,161 @@ bool cmGeneratorTarget::UsesDefaultOutputDir(const std::string& config,
                                     bool implib) const
 {
   std::string dir;
-  return this->Target->ComputeOutputDir(config, implib, dir);
+  return this->ComputeOutputDir(config, implib, dir);
+}
+
+//----------------------------------------------------------------------------
+cmGeneratorTarget::OutputInfo const* cmGeneratorTarget::GetOutputInfo(
+    const std::string& config) const
+{
+  // There is no output information for imported targets.
+  if(this->IsImported())
+    {
+    return 0;
+    }
+
+  // Only libraries and executables have well-defined output files.
+  if(!this->Target->HaveWellDefinedOutputFiles())
+    {
+    std::string msg = "cmGeneratorTarget::GetOutputInfo called for ";
+    msg += this->GetName();
+    msg += " which has type ";
+    msg += cmTarget::GetTargetTypeName(cmTarget::TargetType(this->GetType()));
+    this->LocalGenerator->IssueMessage(cmake::INTERNAL_ERROR, msg);
+    return 0;
+    }
+
+  // Lookup/compute/cache the output information for this configuration.
+  std::string config_upper;
+  if(!config.empty())
+    {
+    config_upper = cmSystemTools::UpperCase(config);
+    }
+  OutputInfoMapType::iterator i =
+    this->OutputInfoMap.find(config_upper);
+  if(i == this->OutputInfoMap.end())
+    {
+    // Add empty info in map to detect potential recursion.
+    OutputInfo info;
+    OutputInfoMapType::value_type entry(config_upper, info);
+    i = this->OutputInfoMap.insert(entry).first;
+
+    // Compute output directories.
+    this->ComputeOutputDir(config, false, info.OutDir);
+    this->ComputeOutputDir(config, true, info.ImpDir);
+    if(!this->Target->ComputePDBOutputDir("PDB", config, info.PdbDir))
+      {
+      info.PdbDir = info.OutDir;
+      }
+
+    // Now update the previously-prepared map entry.
+    i->second = info;
+    }
+  else if(i->second.empty())
+    {
+    // An empty map entry indicates we have been called recursively
+    // from the above block.
+    this->LocalGenerator->GetCMakeInstance()->IssueMessage(
+      cmake::FATAL_ERROR,
+      "Target '" + this->GetName() + "' OUTPUT_DIRECTORY depends on itself.",
+      this->Target->GetBacktrace());
+    return 0;
+    }
+  return &i->second;
+}
+
+//----------------------------------------------------------------------------
+bool cmGeneratorTarget::ComputeOutputDir(const std::string& config,
+                                bool implib, std::string& out) const
+{
+  bool usesDefaultOutputDir = false;
+  std::string conf = config;
+
+  // Look for a target property defining the target output directory
+  // based on the target type.
+  std::string targetTypeName = this->Target->GetOutputTargetType(implib);
+  const char* propertyName = 0;
+  std::string propertyNameStr = targetTypeName;
+  if(!propertyNameStr.empty())
+    {
+    propertyNameStr += "_OUTPUT_DIRECTORY";
+    propertyName = propertyNameStr.c_str();
+    }
+
+  // Check for a per-configuration output directory target property.
+  std::string configUpper = cmSystemTools::UpperCase(conf);
+  const char* configProp = 0;
+  std::string configPropStr = targetTypeName;
+  if(!configPropStr.empty())
+    {
+    configPropStr += "_OUTPUT_DIRECTORY_";
+    configPropStr += configUpper;
+    configProp = configPropStr.c_str();
+    }
+
+  // Select an output directory.
+  if(const char* config_outdir = this->GetProperty(configProp))
+    {
+    // Use the user-specified per-configuration output directory.
+    cmGeneratorExpression ge;
+    cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
+      ge.Parse(config_outdir);
+    out = cge->Evaluate(this->Makefile, config);
+
+    // Skip per-configuration subdirectory.
+    conf = "";
+    }
+  else if(const char* outdir = this->Target->GetProperty(propertyName))
+    {
+    // Use the user-specified output directory.
+    cmGeneratorExpression ge;
+    cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
+      ge.Parse(outdir);
+    out = cge->Evaluate(this->Makefile, config);
+
+    // Skip per-configuration subdirectory if the value contained a
+    // generator expression.
+    if (out != outdir)
+      {
+      conf = "";
+      }
+    }
+  else if(this->GetType() == cmTarget::EXECUTABLE)
+    {
+    // Lookup the output path for executables.
+    out = this->Makefile->GetSafeDefinition("EXECUTABLE_OUTPUT_PATH");
+    }
+  else if(this->GetType() == cmTarget::STATIC_LIBRARY ||
+          this->GetType() == cmTarget::SHARED_LIBRARY ||
+          this->GetType() == cmTarget::MODULE_LIBRARY)
+    {
+    // Lookup the output path for libraries.
+    out = this->Makefile->GetSafeDefinition("LIBRARY_OUTPUT_PATH");
+    }
+  if(out.empty())
+    {
+    // Default to the current output directory.
+    usesDefaultOutputDir = true;
+    out = ".";
+    }
+
+  // Convert the output path to a full path in case it is
+  // specified as a relative path.  Treat a relative path as
+  // relative to the current output directory for this makefile.
+  out = (cmSystemTools::CollapseFullPath
+         (out, this->Makefile->GetCurrentBinaryDirectory()));
+
+  // The generator may add the configuration's subdirectory.
+  if(!conf.empty())
+    {
+    bool iosPlatform = this->Makefile->PlatformIsAppleIos();
+    std::string suffix =
+      usesDefaultOutputDir && iosPlatform ? "${EFFECTIVE_PLATFORM_NAME}" : "";
+    this->LocalGenerator->GetGlobalGenerator()->
+      AppendDirectoryForConfig("/", conf, suffix, out);
+    }
+
+  return usesDefaultOutputDir;
 }
 
 //----------------------------------------------------------------------------
@@ -5008,7 +5161,7 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
 std::string
 cmGeneratorTarget::GetPDBDirectory(const std::string& config) const
 {
-  if(cmTarget::OutputInfo const* info = this->Target->GetOutputInfo(config))
+  if(OutputInfo const* info = this->GetOutputInfo(config))
     {
     // Return the directory in which the target will be built.
     return info->PdbDir;
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index a1ad477..77d3b99 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -289,6 +289,18 @@ public:
       directory.  */
   bool UsesDefaultOutputDir(const std::string& config, bool implib) const;
 
+  // Cache target output paths for each configuration.
+  struct OutputInfo
+  {
+    std::string OutDir;
+    std::string ImpDir;
+    std::string PdbDir;
+    bool empty() const
+      { return OutDir.empty() && ImpDir.empty() && PdbDir.empty(); }
+  };
+
+  OutputInfo const* GetOutputInfo(const std::string& config) const;
+
   /** Get the name of the pdb file for the target.  */
   std::string GetPDBName(const std::string& config="") const;
 
@@ -495,6 +507,12 @@ private:
   cmLinkImplementationLibraries const*
     GetLinkImplementationLibrariesInternal(const std::string& config,
                                            cmTarget const* head) const;
+  bool
+  ComputeOutputDir(const std::string& config,
+                   bool implib, std::string& out) const;
+
+  typedef std::map<std::string, OutputInfo> OutputInfoMapType;
+  mutable OutputInfoMapType OutputInfoMap;
 
   typedef std::pair<std::string, bool> OutputNameKey;
   typedef std::map<OutputNameKey, std::string> OutputNameMapType;
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index bf8b8a9..c20ce83 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -79,9 +79,6 @@ public:
   // The backtrace when the target was created.
   cmListFileBacktrace Backtrace;
 
-  typedef std::map<std::string, cmTarget::OutputInfo> OutputInfoMapType;
-  OutputInfoMapType OutputInfoMap;
-
   typedef std::map<std::string, cmTarget::ImportInfo> ImportInfoMapType;
   ImportInfoMapType ImportInfoMap;
 
@@ -1710,67 +1707,6 @@ bool cmTarget::HaveWellDefinedOutputFiles() const
 }
 
 //----------------------------------------------------------------------------
-cmTarget::OutputInfo const* cmTarget::GetOutputInfo(
-    const std::string& config) const
-{
-  // There is no output information for imported targets.
-  if(this->IsImported())
-    {
-    return 0;
-    }
-
-  // Only libraries and executables have well-defined output files.
-  if(!this->HaveWellDefinedOutputFiles())
-    {
-    std::string msg = "cmTarget::GetOutputInfo 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 output information for this configuration.
-  std::string config_upper;
-  if(!config.empty())
-    {
-    config_upper = cmSystemTools::UpperCase(config);
-    }
-  typedef cmTargetInternals::OutputInfoMapType OutputInfoMapType;
-  OutputInfoMapType::iterator i =
-    this->Internal->OutputInfoMap.find(config_upper);
-  if(i == this->Internal->OutputInfoMap.end())
-    {
-    // Add empty info in map to detect potential recursion.
-    OutputInfo info;
-    OutputInfoMapType::value_type entry(config_upper, info);
-    i = this->Internal->OutputInfoMap.insert(entry).first;
-
-    // Compute output directories.
-    this->ComputeOutputDir(config, false, info.OutDir);
-    this->ComputeOutputDir(config, true, info.ImpDir);
-    if(!this->ComputePDBOutputDir("PDB", config, info.PdbDir))
-      {
-      info.PdbDir = info.OutDir;
-      }
-
-    // Now update the previously-prepared map entry.
-    i->second = info;
-    }
-  else if(i->second.empty())
-    {
-    // An empty map entry indicates we have been called recursively
-    // from the above block.
-    this->Makefile->GetCMakeInstance()->IssueMessage(
-      cmake::FATAL_ERROR,
-      "Target '" + this->GetName() + "' OUTPUT_DIRECTORY depends on itself.",
-      this->GetBacktrace());
-    return 0;
-    }
-  return &i->second;
-}
-
-//----------------------------------------------------------------------------
 const char* cmTarget::ImportedGetLocation(const std::string& config) const
 {
   static std::string location;
@@ -2512,100 +2448,6 @@ const char* cmTarget::GetOutputTargetType(bool implib) const
 }
 
 //----------------------------------------------------------------------------
-bool cmTarget::ComputeOutputDir(const std::string& config,
-                                bool implib, std::string& out) const
-{
-  bool usesDefaultOutputDir = false;
-  std::string conf = config;
-
-  // Look for a target property defining the target output directory
-  // based on the target type.
-  std::string targetTypeName = this->GetOutputTargetType(implib);
-  const char* propertyName = 0;
-  std::string propertyNameStr = targetTypeName;
-  if(!propertyNameStr.empty())
-    {
-    propertyNameStr += "_OUTPUT_DIRECTORY";
-    propertyName = propertyNameStr.c_str();
-    }
-
-  // Check for a per-configuration output directory target property.
-  std::string configUpper = cmSystemTools::UpperCase(conf);
-  const char* configProp = 0;
-  std::string configPropStr = targetTypeName;
-  if(!configPropStr.empty())
-    {
-    configPropStr += "_OUTPUT_DIRECTORY_";
-    configPropStr += configUpper;
-    configProp = configPropStr.c_str();
-    }
-
-  // Select an output directory.
-  if(const char* config_outdir = this->GetProperty(configProp))
-    {
-    // Use the user-specified per-configuration output directory.
-    cmGeneratorExpression ge;
-    cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
-      ge.Parse(config_outdir);
-    out = cge->Evaluate(this->Makefile, config);
-
-    // Skip per-configuration subdirectory.
-    conf = "";
-    }
-  else if(const char* outdir = this->GetProperty(propertyName))
-    {
-    // Use the user-specified output directory.
-    cmGeneratorExpression ge;
-    cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
-      ge.Parse(outdir);
-    out = cge->Evaluate(this->Makefile, config);
-
-    // Skip per-configuration subdirectory if the value contained a
-    // generator expression.
-    if (out != outdir)
-      {
-      conf = "";
-      }
-    }
-  else if(this->GetType() == cmTarget::EXECUTABLE)
-    {
-    // Lookup the output path for executables.
-    out = this->Makefile->GetSafeDefinition("EXECUTABLE_OUTPUT_PATH");
-    }
-  else if(this->GetType() == cmTarget::STATIC_LIBRARY ||
-          this->GetType() == cmTarget::SHARED_LIBRARY ||
-          this->GetType() == cmTarget::MODULE_LIBRARY)
-    {
-    // Lookup the output path for libraries.
-    out = this->Makefile->GetSafeDefinition("LIBRARY_OUTPUT_PATH");
-    }
-  if(out.empty())
-    {
-    // Default to the current output directory.
-    usesDefaultOutputDir = true;
-    out = ".";
-    }
-
-  // Convert the output path to a full path in case it is
-  // specified as a relative path.  Treat a relative path as
-  // relative to the current output directory for this makefile.
-  out = (cmSystemTools::CollapseFullPath
-         (out, this->Makefile->GetCurrentBinaryDirectory()));
-
-  // The generator may add the configuration's subdirectory.
-  if(!conf.empty())
-    {
-    bool iosPlatform = this->Makefile->PlatformIsAppleIos();
-    std::string suffix =
-      usesDefaultOutputDir && iosPlatform ? "${EFFECTIVE_PLATFORM_NAME}" : "";
-    this->Makefile->GetGlobalGenerator()->
-      AppendDirectoryForConfig("/", conf, suffix, out);
-    }
-
-  return usesDefaultOutputDir;
-}
-
-//----------------------------------------------------------------------------
 bool cmTarget::ComputePDBOutputDir(const std::string& kind,
                                    const std::string& config,
                                    std::string& out) const
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 3130660..dda5384 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -470,20 +470,6 @@ private:
   bool LinkLibrariesForVS6Analyzed;
 #endif
 
-  // Cache target output paths for each configuration.
-  struct OutputInfo
-  {
-    std::string OutDir;
-    std::string ImpDir;
-    std::string PdbDir;
-    bool empty() const
-     { return OutDir.empty() && ImpDir.empty() && PdbDir.empty(); }
-  };
-
-  OutputInfo const* GetOutputInfo(const std::string& config) const;
-  bool
-  ComputeOutputDir(const std::string& config,
-                   bool implib, std::string& out) const;
   bool ComputePDBOutputDir(const std::string& kind, const std::string& config,
                            std::string& out) const;
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bb03982fc6abea876fbfb6078608e85571c5f8a5
commit bb03982fc6abea876fbfb6078608e85571c5f8a5
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Aug 5 18:47:35 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 8 23:53:00 2015 +0200

    cmGeneratorTarget: Move UsesDefaultOutputDir from cmTarget.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index a2423cc..9f46909 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -4474,6 +4474,14 @@ std::string cmGeneratorTarget::GetDirectory(const std::string& config,
 }
 
 //----------------------------------------------------------------------------
+bool cmGeneratorTarget::UsesDefaultOutputDir(const std::string& config,
+                                    bool implib) const
+{
+  std::string dir;
+  return this->Target->ComputeOutputDir(config, implib, dir);
+}
+
+//----------------------------------------------------------------------------
 void
 cmGeneratorTarget::ComputeLinkInterfaceLibraries(
   const std::string& config,
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index b39ba9f..a1ad477 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -285,6 +285,10 @@ public:
   std::vector<cmSourceFile*> const*
   GetSourceDepends(cmSourceFile const* sf) const;
 
+  /** Return whether this target uses the default value for its output
+      directory.  */
+  bool UsesDefaultOutputDir(const std::string& config, bool implib) const;
+
   /** Get the name of the pdb file for the target.  */
   std::string GetPDBName(const std::string& config="") const;
 
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 3d52e3a..9f71cc5 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1975,7 +1975,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
     {
     if(this->XcodeVersion >= 21)
       {
-      if(!target.UsesDefaultOutputDir(configName, false))
+      if(!gtgt->UsesDefaultOutputDir(configName, false))
         {
         std::string pncdir = target.GetDirectory(configName);
         buildSettings->AddAttribute("CONFIGURATION_BUILD_DIR",
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 0fc0423..bf8b8a9 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2667,14 +2667,6 @@ bool cmTarget::ComputePDBOutputDir(const std::string& kind,
 }
 
 //----------------------------------------------------------------------------
-bool cmTarget::UsesDefaultOutputDir(const std::string& config,
-                                    bool implib) const
-{
-  std::string dir;
-  return this->ComputeOutputDir(config, implib, dir);
-}
-
-//----------------------------------------------------------------------------
 std::string cmTarget::GetFrameworkVersion() const
 {
   assert(this->GetType() != INTERFACE_LIBRARY);
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 2f9a94b..3130660 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -312,10 +312,6 @@ public:
   /** Get a build-tree directory in which to place target support files.  */
   std::string GetSupportDirectory() const;
 
-  /** Return whether this target uses the default value for its output
-      directory.  */
-  bool UsesDefaultOutputDir(const std::string& config, bool implib) const;
-
   /** @return whether this target have a well defined output file name. */
   bool HaveWellDefinedOutputFiles() const;
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ddfc20d3a967f98c47d2bd169b881d0b88f966d7
commit ddfc20d3a967f98c47d2bd169b881d0b88f966d7
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Aug 5 18:39:17 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 8 23:53:00 2015 +0200

    cmGeneratorTarget: Move GetPDBDirectory from cmTarget.

diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index 961705f..fdacc82 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -1631,7 +1631,7 @@ struct TargetFilesystemArtifactResultCreator<ArtifactPdbTag>
       return std::string();
       }
 
-    std::string result = target->Target->GetPDBDirectory(context->Config);
+    std::string result = target->GetPDBDirectory(context->Config);
     result += "/";
     result += target->GetPDBName(context->Config);
     return result;
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index b8a87a2..a2423cc 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1130,7 +1130,7 @@ cmGeneratorTarget::GetCompilePDBPath(const std::string& config) const
   std::string name = this->GetCompilePDBName(config);
   if(dir.empty() && !name.empty())
     {
-    dir = this->Target->GetPDBDirectory(config);
+    dir = this->GetPDBDirectory(config);
     }
   if(!dir.empty())
     {
@@ -4995,3 +4995,15 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
       }
     }
 }
+
+//----------------------------------------------------------------------------
+std::string
+cmGeneratorTarget::GetPDBDirectory(const std::string& config) const
+{
+  if(cmTarget::OutputInfo const* info = this->Target->GetOutputInfo(config))
+    {
+    // Return the directory in which the target will be built.
+    return info->PdbDir;
+    }
+  return "";
+}
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 43b7922..b39ba9f 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -359,6 +359,12 @@ public:
   /** Return true if builtin chrpath will work for this target */
   bool IsChrpathUsed(const std::string& config) const;
 
+  /** Get the directory in which this targets .pdb files will be placed.
+      If the configuration name is given then the generator will add its
+      subdirectory for that configuration.  Otherwise just the canonical
+      pdb output directory is given.  */
+  std::string GetPDBDirectory(const std::string& config) const;
+
   ///! Return the preferred linker language for this target
   std::string GetLinkerLanguage(const std::string& config = "") const;
 
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index eebee83..f6b907e 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -133,7 +133,8 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
     this->GeneratorTarget->GetCompilePDBDirectory(this->ConfigName);
   cmSystemTools::MakeDirectory(compilePdbOutputPath.c_str());
 
-  std::string pdbOutputPath = this->Target->GetPDBDirectory(this->ConfigName);
+  std::string pdbOutputPath =
+      this->GeneratorTarget->GetPDBDirectory(this->ConfigName);
   cmSystemTools::MakeDirectory(pdbOutputPath.c_str());
   pdbOutputPath += "/";
 
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index d12142a..3b3f63e 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -314,7 +314,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
     this->GeneratorTarget->GetCompilePDBDirectory(this->ConfigName);
   cmSystemTools::MakeDirectory(compilePdbOutputPath.c_str());
 
-  std::string pdbOutputPath = this->Target->GetPDBDirectory(this->ConfigName);
+  std::string pdbOutputPath =
+      this->GeneratorTarget->GetPDBDirectory(this->ConfigName);
   cmSystemTools::MakeDirectory(pdbOutputPath.c_str());
   pdbOutputPath += "/";
 
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index cd499f6..6eafeae 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -546,7 +546,8 @@ cmMakefileTargetGenerator
     {
     targetFullPathReal =
       this->GeneratorTarget->GetFullPath(this->ConfigName, false, true);
-    targetFullPathPDB = this->Target->GetPDBDirectory(this->ConfigName);
+    targetFullPathPDB =
+        this->GeneratorTarget->GetPDBDirectory(this->ConfigName);
     targetFullPathPDB += "/";
     targetFullPathPDB += this->GeneratorTarget->GetPDBName(this->ConfigName);
     }
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 33e08a3..c2daa63 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -289,7 +289,7 @@ bool cmNinjaTargetGenerator::SetMsvcTargetPdbVariable(cmNinjaVars& vars) const
        this->Target->GetType() == cmTarget::SHARED_LIBRARY ||
        this->Target->GetType() == cmTarget::MODULE_LIBRARY)
       {
-      pdbPath = this->Target->GetPDBDirectory(this->GetConfigName());
+      pdbPath = this->GeneratorTarget->GetPDBDirectory(this->GetConfigName());
       pdbPath += "/";
       pdbPath += this->GeneratorTarget->GetPDBName(this->GetConfigName());
       }
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 0f8b3b0..0fc0423 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1771,17 +1771,6 @@ cmTarget::OutputInfo const* cmTarget::GetOutputInfo(
 }
 
 //----------------------------------------------------------------------------
-std::string cmTarget::GetPDBDirectory(const std::string& config) const
-{
-  if(OutputInfo const* info = this->GetOutputInfo(config))
-    {
-    // Return the directory in which the target will be built.
-    return info->PdbDir;
-    }
-  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 507ea7d..2f9a94b 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -231,12 +231,6 @@ public:
       the link dependencies of this target.  */
   std::string CheckCMP0004(std::string const& item) const;
 
-  /** Get the directory in which this targets .pdb files will be placed.
-      If the configuration name is given then the generator will add its
-      subdirectory for that configuration.  Otherwise just the canonical
-      pdb output directory is given.  */
-  std::string GetPDBDirectory(const std::string& config) const;
-
   const char* ImportedGetLocation(const std::string& config) const;
 
   /** Get the target major and minor version numbers interpreted from

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0dbd2ccd93a9f3817ccc9c1bee843915c8cc079c
commit 0dbd2ccd93a9f3817ccc9c1bee843915c8cc079c
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Oct 20 20:31:47 2014 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 8 23:52:57 2015 +0200

    cmGeneratorTarget: Move GetDirectory from cmTarget.

diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index b61e26f..961705f 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -1586,7 +1586,7 @@ struct TargetFilesystemArtifactResultCreator<ArtifactSonameTag>
                     "SHARED libraries.");
       return std::string();
       }
-    std::string result = target->Target->GetDirectory(context->Config);
+    std::string result = target->GetDirectory(context->Config);
     result += "/";
     result += target->GetSOName(context->Config);
     return result;
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 278194e..b8a87a2 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -748,7 +748,7 @@ const char* cmGeneratorTarget::GetLocationForBuild() const
     }
 
   // Now handle the deprecated build-time configuration location.
-  location = this->Target->GetDirectory();
+  location = this->GetDirectory();
   const char* cfgid = this->Makefile->GetDefinition("CMAKE_CFG_INTDIR");
   if(cfgid && strcmp(cfgid, ".") != 0)
     {
@@ -1434,7 +1434,7 @@ cmGeneratorTarget::GetInstallNameDirForBuildTree(
       }
     else
       {
-      dir = this->Target->GetDirectory(config);
+      dir = this->GetDirectory(config);
       }
     dir += "/";
     return dir;
@@ -1735,7 +1735,7 @@ cmGeneratorTarget::GetMacContentDirectory(const std::string& config,
                                           bool implib) const
 {
   // Start with the output directory for the target.
-  std::string fpath = this->Target->GetDirectory(config, implib);
+  std::string fpath = this->GetDirectory(config, implib);
   fpath += "/";
   bool contentOnly = true;
   if(this->Target->IsFrameworkOnApple())
@@ -2860,7 +2860,7 @@ void cmGeneratorTarget::ComputeTargetManifest(
     }
 
   // Get the directory.
-  std::string dir = this->Target->GetDirectory(config, false);
+  std::string dir = this->GetDirectory(config, false);
 
   // Add each name.
   std::string f;
@@ -2894,7 +2894,7 @@ void cmGeneratorTarget::ComputeTargetManifest(
     }
   if(!impName.empty())
     {
-    f = this->Target->GetDirectory(config, true);
+    f = this->GetDirectory(config, true);
     f += "/";
     f += impName;
     gg->AddToManifest(f);
@@ -2919,7 +2919,7 @@ std::string cmGeneratorTarget::NormalGetFullPath(const std::string& config,
                                                  bool implib,
                                                  bool realname) const
 {
-  std::string fpath = this->Target->GetDirectory(config, implib);
+  std::string fpath = this->GetDirectory(config, implib);
   fpath += "/";
   if(this->Target->IsAppBundleOnApple())
     {
@@ -4454,6 +4454,26 @@ cmGeneratorTarget::GetLinkInterfaceLibraries(const std::string& config,
 }
 
 //----------------------------------------------------------------------------
+std::string cmGeneratorTarget::GetDirectory(const std::string& config,
+                                   bool implib) const
+{
+  if (this->Target->IsImported())
+    {
+    // Return the directory from which the target is imported.
+    return
+      cmSystemTools::GetFilenamePath(
+      this->Target->ImportedGetFullPath(config, implib));
+    }
+  else if(cmTarget::OutputInfo const* info =
+      this->Target->GetOutputInfo(config))
+    {
+    // Return the directory in which the target will be built.
+    return implib? info->ImpDir : info->OutDir;
+    }
+  return "";
+}
+
+//----------------------------------------------------------------------------
 void
 cmGeneratorTarget::ComputeLinkInterfaceLibraries(
   const std::string& config,
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index f5805f1..43b7922 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -268,6 +268,13 @@ public:
    */
   void TraceDependencies();
 
+  /** Get the directory in which this target will be built.  If the
+      configuration name is given then the generator will add its
+      subdirectory for that configuration.  Otherwise just the canonical
+      output directory is given.  */
+  std::string GetDirectory(const std::string& config = "",
+                           bool implib = false) 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
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index 30cf175..383ee00 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -83,7 +83,7 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os,
   else
     {
     fromDirConfig =
-        this->Target->Target->GetDirectory(config, this->ImportLibrary);
+        this->Target->GetDirectory(config, this->ImportLibrary);
     fromDirConfig += "/";
     }
   std::string toDir =
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 90f679e..eebee83 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -99,7 +99,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
      this->ConfigName);
 
   // Construct the full path version of the names.
-  std::string outpath = this->Target->GetDirectory(this->ConfigName);
+  std::string outpath = this->GeneratorTarget->GetDirectory(this->ConfigName);
   if(this->Target->IsAppBundleOnApple())
     {
     this->OSXBundleGenerator->CreateAppBundle(targetName, outpath);
@@ -123,7 +123,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
     cmSystemTools::MakeDirectory(outpath.c_str());
     if(!targetNameImport.empty())
       {
-      outpathImp = this->Target->GetDirectory(this->ConfigName, true);
+      outpathImp = this->GeneratorTarget->GetDirectory(this->ConfigName, true);
       cmSystemTools::MakeDirectory(outpathImp.c_str());
       outpathImp += "/";
       }
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index cd387a0..d12142a 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -275,13 +275,13 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
   std::string outpathImp;
   if(this->Target->IsFrameworkOnApple())
     {
-    outpath = this->Target->GetDirectory(this->ConfigName);
+    outpath = this->GeneratorTarget->GetDirectory(this->ConfigName);
     this->OSXBundleGenerator->CreateFramework(targetName, outpath);
     outpath += "/";
     }
   else if(this->Target->IsCFBundleOnApple())
     {
-    outpath = this->Target->GetDirectory(this->ConfigName);
+    outpath = this->GeneratorTarget->GetDirectory(this->ConfigName);
     this->OSXBundleGenerator->CreateCFBundle(targetName, outpath);
     outpath += "/";
     }
@@ -299,12 +299,12 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
     }
   else
     {
-    outpath = this->Target->GetDirectory(this->ConfigName);
+    outpath = this->GeneratorTarget->GetDirectory(this->ConfigName);
     cmSystemTools::MakeDirectory(outpath.c_str());
     outpath += "/";
     if(!targetNameImport.empty())
       {
-      outpathImp = this->Target->GetDirectory(this->ConfigName, true);
+      outpathImp = this->GeneratorTarget->GetDirectory(this->ConfigName, true);
       cmSystemTools::MakeDirectory(outpathImp.c_str());
       outpathImp += "/";
       }
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 24fcaf4..f8743d9 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -59,7 +59,7 @@ cmNinjaNormalTargetGenerator(cmGeneratorTarget* target)
     {
     // on Windows the output dir is already needed at compile time
     // ensure the directory exists (OutDir test)
-    EnsureDirectoryExists(target->Target->GetDirectory(this->GetConfigName()));
+    EnsureDirectoryExists(target->GetDirectory(this->GetConfigName()));
     }
 
   this->OSXBundleGenerator = new cmOSXBundleGenerator(target,
@@ -413,7 +413,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
   if (target.IsAppBundleOnApple())
     {
     // Create the app bundle
-    std::string outpath = target.GetDirectory(cfgName);
+    std::string outpath = gt.GetDirectory(cfgName);
     this->OSXBundleGenerator->CreateAppBundle(this->TargetNameOut, outpath);
 
     // Calculate the output path
@@ -430,13 +430,13 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
     {
     // Create the library framework.
     this->OSXBundleGenerator->CreateFramework(this->TargetNameOut,
-                                              target.GetDirectory(cfgName));
+                                              gt.GetDirectory(cfgName));
     }
   else if(target.IsCFBundleOnApple())
     {
     // Create the core foundation bundle.
     this->OSXBundleGenerator->CreateCFBundle(this->TargetNameOut,
-                                             target.GetDirectory(cfgName));
+                                             gt.GetDirectory(cfgName));
     }
 
   // Write comments.
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 6e6dc60..33e08a3 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -254,7 +254,7 @@ cmNinjaTargetGenerator
 
 std::string cmNinjaTargetGenerator::GetTargetOutputDir() const
 {
-  std::string dir = this->Target->GetDirectory(this->GetConfigName());
+  std::string dir = this->GeneratorTarget->GetDirectory(this->GetConfigName());
   return ConvertToNinjaPath(dir);
 }
 
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 825f3eb..0f8b3b0 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1771,25 +1771,6 @@ cmTarget::OutputInfo const* cmTarget::GetOutputInfo(
 }
 
 //----------------------------------------------------------------------------
-std::string cmTarget::GetDirectory(const std::string& config,
-                                   bool implib) const
-{
-  if (this->IsImported())
-    {
-    // Return the directory from which the target is imported.
-    return
-      cmSystemTools::GetFilenamePath(
-      this->ImportedGetFullPath(config, implib));
-    }
-  else if(OutputInfo const* info = this->GetOutputInfo(config))
-    {
-    // Return the directory in which the target will be built.
-    return implib? info->ImpDir : info->OutDir;
-    }
-  return "";
-}
-
-//----------------------------------------------------------------------------
 std::string cmTarget::GetPDBDirectory(const std::string& config) const
 {
   if(OutputInfo const* info = this->GetOutputInfo(config))
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 96cdb5e..507ea7d 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -231,13 +231,6 @@ public:
       the link dependencies of this target.  */
   std::string CheckCMP0004(std::string const& item) const;
 
-  /** Get the directory in which this target will be built.  If the
-      configuration name is given then the generator will add its
-      subdirectory for that configuration.  Otherwise just the canonical
-      output directory is given.  */
-  std::string GetDirectory(const std::string& config = "",
-                           bool implib = false) const;
-
   /** Get the directory in which this targets .pdb files will be placed.
       If the configuration name is given then the generator will add its
       subdirectory for that configuration.  Otherwise just the canonical

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e0261a1e20f14cc2ca593bb978479b52954397d8
commit e0261a1e20f14cc2ca593bb978479b52954397d8
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Oct 8 23:00:30 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 8 23:41:30 2015 +0200

    cmTarget: Make OutputInfo definition public.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index e1642cc..825f3eb 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -61,16 +61,6 @@ const char* cmTarget::GetTargetTypeName(TargetType targetType)
 }
 
 //----------------------------------------------------------------------------
-struct cmTarget::OutputInfo
-{
-  std::string OutDir;
-  std::string ImpDir;
-  std::string PdbDir;
-  bool empty() const
-    { return OutDir.empty() && ImpDir.empty() && PdbDir.empty(); }
-};
-
-//----------------------------------------------------------------------------
 class cmTargetInternals
 {
 public:
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index aab9582..96cdb5e 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -488,7 +488,15 @@ private:
 #endif
 
   // Cache target output paths for each configuration.
-  struct OutputInfo;
+  struct OutputInfo
+  {
+    std::string OutDir;
+    std::string ImpDir;
+    std::string PdbDir;
+    bool empty() const
+     { return OutDir.empty() && ImpDir.empty() && PdbDir.empty(); }
+  };
+
   OutputInfo const* GetOutputInfo(const std::string& config) const;
   bool
   ComputeOutputDir(const std::string& config,

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=df42dbb3558a6ba604ab584b21dfe7f8722eb025
commit df42dbb3558a6ba604ab584b21dfe7f8722eb025
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Aug 5 18:17:55 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 8 23:41:29 2015 +0200

    cmGeneratorTarget: Move link implementation from cmTarget.

diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index 1c350ab..b61e26f 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -1122,7 +1122,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
     else if(!interfacePropertyName.empty())
       {
       if(cmLinkImplementationLibraries const* impl =
-         target->GetLinkImplementationLibraries(context->Config))
+         gtgt->GetLinkImplementationLibraries(context->Config))
         {
         linkedTargetsContent =
           getLinkedTargetsContent(impl->Libraries, target,
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 1a0bbe8..278194e 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -847,7 +847,7 @@ static void AddInterfaceEntries(
   std::vector<cmGeneratorTarget::TargetPropertyEntry*>& entries)
 {
   if(cmLinkImplementationLibraries const* impl =
-     thisTarget->Target->GetLinkImplementationLibraries(config))
+     thisTarget->GetLinkImplementationLibraries(config))
     {
     for (std::vector<cmLinkImplItem>::const_iterator
            it = impl->Libraries.begin(), end = impl->Libraries.end();
@@ -1901,7 +1901,7 @@ cmGeneratorTarget::GetLinkImplementationClosure(
     std::set<cmTarget const*> emitted;
 
     cmLinkImplementationLibraries const* impl
-      = this->Target->GetLinkImplementationLibraries(config);
+      = this->GetLinkImplementationLibraries(config);
 
     for(std::vector<cmLinkImplItem>::const_iterator
           it = impl->Libraries.begin();
@@ -2501,7 +2501,7 @@ cmGeneratorTarget::GetIncludeDirectories(const std::string& config,
   if(this->Makefile->IsOn("APPLE"))
     {
     cmLinkImplementationLibraries const* impl =
-        this->Target->GetLinkImplementationLibraries(config);
+        this->GetLinkImplementationLibraries(config);
     for(std::vector<cmLinkImplItem>::const_iterator
         it = impl->Libraries.begin();
         it != impl->Libraries.end(); ++it)
@@ -4363,8 +4363,7 @@ void cmGeneratorTarget::ComputeLinkInterface(const std::string& config,
     {
     // The link implementation is the default link interface.
     cmLinkImplementationLibraries const*
-      impl = this->Target->GetLinkImplementationLibrariesInternal(config,
-                                                                headTarget);
+      impl = this->GetLinkImplementationLibrariesInternal(config, headTarget);
     iface.ImplementationIsInterface = true;
     iface.WrongConfigLibraries = impl->WrongConfigLibraries;
     }
@@ -4558,8 +4557,7 @@ cmGeneratorTarget::ComputeLinkInterfaceLibraries(
     {
     // The link implementation is the default link interface.
     cmLinkImplementationLibraries const* impl =
-      this->Target->GetLinkImplementationLibrariesInternal(config,
-                                                           headTarget);
+      this->GetLinkImplementationLibrariesInternal(config, headTarget);
     iface.Libraries.insert(iface.Libraries.end(),
                            impl->Libraries.begin(), impl->Libraries.end());
     if(this->Target->GetPolicyStatusCMP0022() == cmPolicies::WARN &&
@@ -4674,12 +4672,12 @@ cmGeneratorTarget::GetLinkImplementation(const std::string& config) const
     return 0;
     }
 
-  cmOptionalLinkImplementation& impl = this->Target->GetLinkImplMap(config);
+  std::string CONFIG = cmSystemTools::UpperCase(config);
+  cmOptionalLinkImplementation& impl = this->LinkImplMap[CONFIG][this->Target];
   if(!impl.LibrariesDone)
     {
     impl.LibrariesDone = true;
-    this->Target->ComputeLinkImplementationLibraries(config, impl,
-                                                     this->Target);
+    this->ComputeLinkImplementationLibraries(config, impl, this->Target);
     }
   if(!impl.LanguagesDone)
     {
@@ -4819,9 +4817,161 @@ bool cmGeneratorTarget::HaveBuildTreeRPATH(const std::string& config) const
     return false;
     }
   if(cmLinkImplementationLibraries const* impl =
-     this->Target->GetLinkImplementationLibraries(config))
+     this->GetLinkImplementationLibraries(config))
     {
     return !impl->Libraries.empty();
     }
   return false;
 }
+
+//----------------------------------------------------------------------------
+cmLinkImplementationLibraries const*
+cmGeneratorTarget::GetLinkImplementationLibraries(
+    const std::string& config) const
+{
+  return this->GetLinkImplementationLibrariesInternal(config, this->Target);
+}
+
+//----------------------------------------------------------------------------
+cmLinkImplementationLibraries const*
+cmGeneratorTarget::GetLinkImplementationLibrariesInternal(
+    const std::string& config, cmTarget const* head) const
+{
+  // There is no link implementation for imported targets.
+  if(this->IsImported())
+    {
+    return 0;
+    }
+
+  // Populate the link implementation libraries for this configuration.
+  std::string CONFIG = cmSystemTools::UpperCase(config);
+  HeadToLinkImplementationMap& hm =
+    this->LinkImplMap[CONFIG];
+
+  // If the link implementation does not depend on the head target
+  // then return the one we computed first.
+  if(!hm.empty() && !hm.begin()->second.HadHeadSensitiveCondition)
+    {
+    return &hm.begin()->second;
+    }
+
+  cmOptionalLinkImplementation& impl = hm[head];
+  if(!impl.LibrariesDone)
+    {
+    impl.LibrariesDone = true;
+    this->ComputeLinkImplementationLibraries(config, impl, head);
+    }
+  return &impl;
+}
+
+//----------------------------------------------------------------------------
+void cmGeneratorTarget::ComputeLinkImplementationLibraries(
+  const std::string& config,
+  cmOptionalLinkImplementation& impl,
+  cmTarget const* head) const
+{
+  cmStringRange entryRange =
+      this->Target->GetLinkImplementationEntries();
+  cmBacktraceRange btRange =
+      this->Target->GetLinkImplementationBacktraces();
+  cmBacktraceRange::const_iterator btIt = btRange.begin();
+  // Collect libraries directly linked in this configuration.
+  for (cmStringRange::const_iterator le = entryRange.begin(),
+      end = entryRange.end(); le != end; ++le, ++btIt)
+    {
+    std::vector<std::string> llibs;
+    cmGeneratorExpressionDAGChecker dagChecker(
+                                        this->GetName(),
+                                        "LINK_LIBRARIES", 0, 0);
+    cmGeneratorExpression ge(*btIt);
+    cmsys::auto_ptr<cmCompiledGeneratorExpression> const cge =
+      ge.Parse(*le);
+    std::string const evaluated =
+      cge->Evaluate(this->Makefile, config, false, head, &dagChecker);
+    cmSystemTools::ExpandListArgument(evaluated, llibs);
+    if(cge->GetHadHeadSensitiveCondition())
+      {
+      impl.HadHeadSensitiveCondition = true;
+      }
+
+    for(std::vector<std::string>::const_iterator li = llibs.begin();
+        li != llibs.end(); ++li)
+      {
+      // Skip entries that resolve to the target itself or are empty.
+      std::string name = this->Target->CheckCMP0004(*li);
+      if(name == this->GetName() || name.empty())
+        {
+        if(name == this->GetName())
+          {
+          bool noMessage = false;
+          cmake::MessageType messageType = cmake::FATAL_ERROR;
+          std::ostringstream e;
+          switch(this->Target->GetPolicyStatusCMP0038())
+            {
+            case cmPolicies::WARN:
+              {
+              e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0038) << "\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->GetName() << "\" links to itself.";
+            this->LocalGenerator->GetCMakeInstance()->IssueMessage(
+              messageType, e.str(), this->Target->GetBacktrace());
+            if (messageType == cmake::FATAL_ERROR)
+              {
+              return;
+              }
+            }
+          }
+        continue;
+        }
+
+      // The entry is meant for this configuration.
+      impl.Libraries.push_back(
+        cmLinkImplItem(name, this->Target->FindTargetToLink(name),
+                       *btIt, evaluated != *le));
+      }
+
+    std::set<std::string> const& seenProps = cge->GetSeenTargetProperties();
+    for (std::set<std::string>::const_iterator it = seenProps.begin();
+        it != seenProps.end(); ++it)
+      {
+      if (!this->GetProperty(*it))
+        {
+        this->Target->LinkImplicitNullProperties.insert(*it);
+        }
+      }
+    cge->GetMaxLanguageStandard(this->Target,
+                                this->MaxLanguageStandards);
+    }
+
+  cmTarget::LinkLibraryType linkType = this->Target->ComputeLinkType(config);
+  cmTarget::LinkLibraryVectorType const& oldllibs =
+    this->Target->GetOriginalLinkLibraries();
+  for(cmTarget::LinkLibraryVectorType::const_iterator li = oldllibs.begin();
+      li != oldllibs.end(); ++li)
+    {
+    if(li->second != cmTarget::GENERAL && li->second != linkType)
+      {
+      std::string name = this->Target->CheckCMP0004(li->first);
+      if(name == this->GetName() || name.empty())
+        {
+        continue;
+        }
+      // Support OLD behavior for CMP0003.
+      impl.WrongConfigLibraries.push_back(
+        cmLinkItem(name, this->Target->FindTargetToLink(name)));
+      }
+    }
+}
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index e8c5e04..f5805f1 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -207,6 +207,13 @@ public:
                                           cmOptionalLinkImplementation& impl
                                           ) const;
 
+  cmLinkImplementationLibraries const*
+    GetLinkImplementationLibraries(const std::string& config) const;
+
+  void ComputeLinkImplementationLibraries(const std::string& config,
+                                          cmOptionalLinkImplementation& impl,
+                                          cmTarget const* head) const;
+
   // Compute the set of languages compiled by the target.  This is
   // computed every time it is called because the languages can change
   // when source file properties are changed and we do not have enough
@@ -462,6 +469,16 @@ private:
   void GetSourceFiles(std::vector<std::string>& files,
                       const std::string& config) const;
 
+  struct HeadToLinkImplementationMap:
+    public std::map<cmTarget const*, cmOptionalLinkImplementation> {};
+  typedef std::map<std::string,
+                   HeadToLinkImplementationMap> LinkImplMapType;
+  mutable LinkImplMapType LinkImplMap;
+
+  cmLinkImplementationLibraries const*
+    GetLinkImplementationLibrariesInternal(const std::string& config,
+                                           cmTarget const* head) const;
+
   typedef std::pair<std::string, bool> OutputNameKey;
   typedef std::map<OutputNameKey, std::string> OutputNameMapType;
   mutable OutputNameMapType OutputNameMap;
@@ -477,6 +494,12 @@ public:
   std::vector<cmTarget const*> const&
     GetLinkImplementationClosure(const std::string& config) const;
 
+  mutable std::map<std::string, std::string> MaxLanguageStandards;
+  std::map<std::string, std::string> const&
+  GetMaxLanguageStandards() const
+  {
+    return this->MaxLanguageStandards;
+  }
 };
 
 struct cmStrictTargetComparison {
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 6647894..06eb004 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1152,8 +1152,8 @@ void cmLocalGenerator::AddCompileOptions(
     }
 
   for(std::map<std::string, std::string>::const_iterator it
-      = target->GetMaxLanguageStandards().begin();
-      it != target->GetMaxLanguageStandards().end(); ++it)
+      = gtgt->GetMaxLanguageStandards().begin();
+      it != gtgt->GetMaxLanguageStandards().end(); ++it)
     {
     const char* standard = target->GetProperty(it->first + "_STANDARD");
     if(!standard)
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 63c7740..e1642cc 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -95,12 +95,6 @@ public:
   typedef std::map<std::string, cmTarget::ImportInfo> ImportInfoMapType;
   ImportInfoMapType ImportInfoMap;
 
-  struct HeadToLinkImplementationMap:
-    public std::map<cmTarget const*, cmOptionalLinkImplementation> {};
-  typedef std::map<std::string,
-                   HeadToLinkImplementationMap> LinkImplMapType;
-  LinkImplMapType LinkImplMap;
-
   std::set<cmLinkItem> UtilityItems;
   bool UtilityItemsDone;
 
@@ -405,7 +399,6 @@ void cmTarget::FinishConfigure()
   // on-demand during the configuration.  This ensures that build
   // system generation uses up-to-date information even if other cache
   // invalidation code in this source file is buggy.
-  this->ClearLinkMaps();
 
 #if defined(_WIN32) && !defined(__CYGWIN__)
   // Do old-style link dependency analysis only for CM_USE_OLD_VS6.
@@ -417,12 +410,6 @@ void cmTarget::FinishConfigure()
 }
 
 //----------------------------------------------------------------------------
-void cmTarget::ClearLinkMaps()
-{
-  this->Internal->LinkImplMap.clear();
-}
-
-//----------------------------------------------------------------------------
 cmListFileBacktrace const& cmTarget::GetBacktrace() const
 {
   return this->Internal->Backtrace;
@@ -884,7 +871,6 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf,
   this->LinkLibrariesForVS6.push_back( tmp );
 #endif
   this->OriginalLinkLibraries.push_back(tmp);
-  this->ClearLinkMaps();
 
   // Add the explicit dependency information for this target. This is
   // simply a set of libraries separated by ";". There should always
@@ -983,6 +969,16 @@ cmBacktraceRange cmTarget::GetSourceBacktraces() const
   return cmMakeRange(this->Internal->SourceBacktraces);
 }
 
+cmStringRange cmTarget::GetLinkImplementationEntries() const
+{
+  return cmMakeRange(this->Internal->LinkImplementationPropertyEntries);
+}
+
+cmBacktraceRange cmTarget::GetLinkImplementationBacktraces() const
+{
+  return cmMakeRange(this->Internal->LinkImplementationPropertyBacktraces);
+}
+
 #if defined(_WIN32) && !defined(__CYGWIN__)
 //----------------------------------------------------------------------------
 void
@@ -1611,10 +1607,6 @@ void cmTarget::MaybeInvalidatePropertyCache(const std::string& prop)
     {
     this->Internal->ImportInfoMap.clear();
     }
-  if(!this->IsImported() && cmHasLiteralPrefix(prop, "LINK_INTERFACE_"))
-    {
-    this->ClearLinkMaps();
-    }
 }
 
 //----------------------------------------------------------------------------
@@ -3162,163 +3154,6 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config,
     }
 }
 
-cmOptionalLinkImplementation&
-cmTarget::GetLinkImplMap(std::string const& config) const
-{
-  // Populate the link implementation for this configuration.
-  std::string CONFIG = cmSystemTools::UpperCase(config);
-  return Internal->LinkImplMap[CONFIG][this];
-}
-
-//----------------------------------------------------------------------------
-cmLinkImplementationLibraries const*
-cmTarget::GetLinkImplementationLibraries(const std::string& config) const
-{
-  return this->GetLinkImplementationLibrariesInternal(config, this);
-}
-
-//----------------------------------------------------------------------------
-cmLinkImplementationLibraries const*
-cmTarget::GetLinkImplementationLibrariesInternal(const std::string& config,
-                                                 cmTarget const* head) const
-{
-  // There is no link implementation for imported targets.
-  if(this->IsImported())
-    {
-    return 0;
-    }
-
-  // Populate the link implementation libraries for this configuration.
-  std::string CONFIG = cmSystemTools::UpperCase(config);
-  cmTargetInternals::HeadToLinkImplementationMap& hm =
-    this->Internal->LinkImplMap[CONFIG];
-
-  // If the link implementation does not depend on the head target
-  // then return the one we computed first.
-  if(!hm.empty() && !hm.begin()->second.HadHeadSensitiveCondition)
-    {
-    return &hm.begin()->second;
-    }
-
-  cmOptionalLinkImplementation& impl = hm[head];
-  if(!impl.LibrariesDone)
-    {
-    impl.LibrariesDone = true;
-    this->ComputeLinkImplementationLibraries(config, impl, head);
-    }
-  return &impl;
-}
-
-//----------------------------------------------------------------------------
-void cmTarget::ComputeLinkImplementationLibraries(
-  const std::string& config,
-  cmOptionalLinkImplementation& impl,
-  cmTarget const* head) const
-{
-  std::vector<cmListFileBacktrace>::const_iterator btIt =
-      this->Internal->LinkImplementationPropertyBacktraces.begin();
-  // Collect libraries directly linked in this configuration.
-  for (std::vector<std::string>::const_iterator
-      le = this->Internal->LinkImplementationPropertyEntries.begin(),
-      end = this->Internal->LinkImplementationPropertyEntries.end();
-      le != end; ++le, ++btIt)
-    {
-    std::vector<std::string> llibs;
-    cmGeneratorExpressionDAGChecker dagChecker(
-                                        this->GetName(),
-                                        "LINK_LIBRARIES", 0, 0);
-    cmGeneratorExpression ge(*btIt);
-    cmsys::auto_ptr<cmCompiledGeneratorExpression> const cge =
-      ge.Parse(*le);
-    std::string const evaluated =
-      cge->Evaluate(this->Makefile, config, false, head, &dagChecker);
-    cmSystemTools::ExpandListArgument(evaluated, llibs);
-    if(cge->GetHadHeadSensitiveCondition())
-      {
-      impl.HadHeadSensitiveCondition = true;
-      }
-
-    for(std::vector<std::string>::const_iterator li = llibs.begin();
-        li != llibs.end(); ++li)
-      {
-      // Skip entries that resolve to the target itself or are empty.
-      std::string name = this->CheckCMP0004(*li);
-      if(name == this->GetName() || name.empty())
-        {
-        if(name == this->GetName())
-          {
-          bool noMessage = false;
-          cmake::MessageType messageType = cmake::FATAL_ERROR;
-          std::ostringstream e;
-          switch(this->GetPolicyStatusCMP0038())
-            {
-            case cmPolicies::WARN:
-              {
-              e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0038) << "\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->GetName() << "\" links to itself.";
-            this->Makefile->GetCMakeInstance()->IssueMessage(
-              messageType, e.str(), this->GetBacktrace());
-            if (messageType == cmake::FATAL_ERROR)
-              {
-              return;
-              }
-            }
-          }
-        continue;
-        }
-
-      // The entry is meant for this configuration.
-      impl.Libraries.push_back(
-        cmLinkImplItem(name, this->FindTargetToLink(name),
-                       *btIt, evaluated != *le));
-      }
-
-    std::set<std::string> const& seenProps = cge->GetSeenTargetProperties();
-    for (std::set<std::string>::const_iterator it = seenProps.begin();
-        it != seenProps.end(); ++it)
-      {
-      if (!this->GetProperty(*it))
-        {
-        this->LinkImplicitNullProperties.insert(*it);
-        }
-      }
-    cge->GetMaxLanguageStandard(this, this->MaxLanguageStandards);
-    }
-
-  cmTarget::LinkLibraryType linkType = this->ComputeLinkType(config);
-  cmTarget::LinkLibraryVectorType const& oldllibs =
-    this->GetOriginalLinkLibraries();
-  for(cmTarget::LinkLibraryVectorType::const_iterator li = oldllibs.begin();
-      li != oldllibs.end(); ++li)
-    {
-    if(li->second != cmTarget::GENERAL && li->second != linkType)
-      {
-      std::string name = this->CheckCMP0004(li->first);
-      if(name == this->GetName() || name.empty())
-        {
-        continue;
-        }
-      // Support OLD behavior for CMP0003.
-      impl.WrongConfigLibraries.push_back(
-        cmLinkItem(name, this->FindTargetToLink(name)));
-      }
-    }
-}
-
 //----------------------------------------------------------------------------
 cmTarget const* cmTarget::FindTargetToLink(std::string const& name) const
 {
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 354eda2..aab9582 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -225,16 +225,6 @@ public:
 
   void GetObjectLibrariesCMP0026(std::vector<cmTarget*>& objlibs) const;
 
-  cmLinkImplementationLibraries const*
-    GetLinkImplementationLibraries(const std::string& config) const;
-
-  void ComputeLinkImplementationLibraries(const std::string& config,
-                                          cmOptionalLinkImplementation& impl,
-                                          cmTarget const* head) const;
-
-  cmOptionalLinkImplementation&
-  GetLinkImplMap(std::string const& config) const;
-
   cmTarget const* FindTargetToLink(std::string const& name) const;
 
   /** Strip off leading and trailing whitespace from an item named in
@@ -365,12 +355,6 @@ public:
   bool LinkLanguagePropagatesToDependents() const
   { return this->TargetTypeValue == STATIC_LIBRARY; }
 
-  std::map<std::string, std::string> const&
-  GetMaxLanguageStandards() const
-  {
-    return this->MaxLanguageStandards;
-  }
-
   cmStringRange GetIncludeDirectoriesEntries() const;
   cmBacktraceRange GetIncludeDirectoriesBacktraces() const;
 
@@ -385,6 +369,9 @@ public:
 
   cmStringRange GetSourceEntries() const;
   cmBacktraceRange GetSourceBacktraces() const;
+  cmStringRange GetLinkImplementationEntries() const;
+  cmBacktraceRange GetLinkImplementationBacktraces() const;
+
 
 #if defined(_WIN32) && !defined(__CYGWIN__)
   const LinkLibraryVectorType &GetLinkLibrariesForVS6() const {
@@ -471,7 +458,6 @@ private:
   std::set<std::string> Utilities;
   mutable std::set<std::string> LinkImplicitNullProperties;
   std::map<std::string, cmListFileBacktrace> UtilityBacktraces;
-  mutable std::map<std::string, std::string> MaxLanguageStandards;
   cmPolicies::PolicyMap PolicyMap;
   std::string Name;
   std::string InstallPath;
@@ -529,14 +515,8 @@ private:
   void ComputeImportInfo(std::string const& desired_config,
                          ImportInfo& info) const;
 
-  cmLinkImplementationLibraries const*
-    GetLinkImplementationLibrariesInternal(const std::string& config,
-                                           cmTarget const* head) const;
-
   std::string ProcessSourceItemCMP0049(const std::string& s);
 
-  void ClearLinkMaps();
-
   void MaybeInvalidatePropertyCache(const std::string& prop);
 
   // Internal representation details.

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a8429a402da4aeb717f4af234c8d14d1c4e10ed7
commit a8429a402da4aeb717f4af234c8d14d1c4e10ed7
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Aug 5 17:37:51 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 8 23:41:29 2015 +0200

    cmTarget: Split storage of link implementation from backtraces.

diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h
index 0afd7f5..5f1a310 100644
--- a/Source/cmListFileCache.h
+++ b/Source/cmListFileCache.h
@@ -111,13 +111,4 @@ struct cmListFile
   std::vector<cmListFileFunction> Functions;
 };
 
-struct cmValueWithOrigin {
-  cmValueWithOrigin(const std::string &value,
-                          const cmListFileBacktrace &bt)
-    : Value(value), Backtrace(bt)
-  {}
-  std::string Value;
-  cmListFileBacktrace Backtrace;
-};
-
 #endif
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index abfc40b..63c7740 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -114,7 +114,8 @@ public:
   std::vector<cmListFileBacktrace> CompileDefinitionsBacktraces;
   std::vector<std::string> SourceEntries;
   std::vector<cmListFileBacktrace> SourceBacktraces;
-  std::vector<cmValueWithOrigin> LinkImplementationPropertyEntries;
+  std::vector<std::string> LinkImplementationPropertyEntries;
+  std::vector<cmListFileBacktrace> LinkImplementationPropertyBacktraces;
 };
 
 //----------------------------------------------------------------------------
@@ -1380,11 +1381,12 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
   else if (prop == "LINK_LIBRARIES")
     {
     this->Internal->LinkImplementationPropertyEntries.clear();
+    this->Internal->LinkImplementationPropertyBacktraces.clear();
     if (value)
       {
       cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
-      cmValueWithOrigin entry(value, lfbt);
-      this->Internal->LinkImplementationPropertyEntries.push_back(entry);
+      this->Internal->LinkImplementationPropertyEntries.push_back(value);
+      this->Internal->LinkImplementationPropertyBacktraces.push_back(lfbt);
       }
     }
   else if (prop == "SOURCES")
@@ -1482,8 +1484,8 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
     if (value && *value)
       {
       cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
-      cmValueWithOrigin entry(value, lfbt);
-      this->Internal->LinkImplementationPropertyEntries.push_back(entry);
+      this->Internal->LinkImplementationPropertyEntries.push_back(value);
+      this->Internal->LinkImplementationPropertyBacktraces.push_back(lfbt);
       }
     }
   else if (prop == "SOURCES")
@@ -2048,17 +2050,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
         }
 
       static std::string output;
-      output = "";
-      std::string sep;
-      for (std::vector<cmValueWithOrigin>::const_iterator
-          it = this->Internal->LinkImplementationPropertyEntries.begin(),
-          end = this->Internal->LinkImplementationPropertyEntries.end();
-          it != end; ++it)
-        {
-        output += sep;
-        output += it->Value;
-        sep = ";";
-        }
+      output = cmJoin(this->Internal->LinkImplementationPropertyEntries, ";");
       return output.c_str();
       }
     // the type property returns what type the target is
@@ -3223,19 +3215,21 @@ void cmTarget::ComputeLinkImplementationLibraries(
   cmOptionalLinkImplementation& impl,
   cmTarget const* head) const
 {
+  std::vector<cmListFileBacktrace>::const_iterator btIt =
+      this->Internal->LinkImplementationPropertyBacktraces.begin();
   // Collect libraries directly linked in this configuration.
-  for (std::vector<cmValueWithOrigin>::const_iterator
+  for (std::vector<std::string>::const_iterator
       le = this->Internal->LinkImplementationPropertyEntries.begin(),
       end = this->Internal->LinkImplementationPropertyEntries.end();
-      le != end; ++le)
+      le != end; ++le, ++btIt)
     {
     std::vector<std::string> llibs;
     cmGeneratorExpressionDAGChecker dagChecker(
                                         this->GetName(),
                                         "LINK_LIBRARIES", 0, 0);
-    cmGeneratorExpression ge(le->Backtrace);
+    cmGeneratorExpression ge(*btIt);
     cmsys::auto_ptr<cmCompiledGeneratorExpression> const cge =
-      ge.Parse(le->Value);
+      ge.Parse(*le);
     std::string const evaluated =
       cge->Evaluate(this->Makefile, config, false, head, &dagChecker);
     cmSystemTools::ExpandListArgument(evaluated, llibs);
@@ -3290,7 +3284,7 @@ void cmTarget::ComputeLinkImplementationLibraries(
       // The entry is meant for this configuration.
       impl.Libraries.push_back(
         cmLinkImplItem(name, this->FindTargetToLink(name),
-                       le->Backtrace, evaluated != le->Value));
+                       *btIt, evaluated != *le));
       }
 
     std::set<std::string> const& seenProps = cge->GetSeenTargetProperties();

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=370bb92c10cd8fec7770267c93515623e4168012
commit 370bb92c10cd8fec7770267c93515623e4168012
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Oct 8 23:28:46 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 8 23:41:27 2015 +0200

    cmGeneratorTarget: Issue messages through the local generator.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 3fb0dc7..1a0bbe8 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -402,7 +402,8 @@ std::string cmGeneratorTarget::GetOutputName(const std::string& config,
     {
     // An empty map entry indicates we have been called recursively
     // from the above block.
-    this->Makefile->GetCMakeInstance()->IssueMessage(
+    this->LocalGenerator->GetCMakeInstance()
+          ->IssueMessage(
       cmake::FATAL_ERROR,
       "Target '" + this->GetName() + "' OUTPUT_NAME depends on itself.",
       this->Target->GetBacktrace());
@@ -951,7 +952,7 @@ static bool processSources(cmGeneratorTarget const* tgt,
       }
     if (!usedSources.empty())
       {
-      mf->GetCMakeInstance()->IssueMessage(cmake::LOG,
+      tgt->GetLocalGenerator()->GetCMakeInstance()->IssueMessage(cmake::LOG,
                             std::string("Used sources for target ")
                             + tgt->GetName() + ":\n"
                             + usedSources, (*it)->ge->GetBacktrace());
@@ -1521,7 +1522,7 @@ public:
             << "\" 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(
+          this->Target->GetLocalGenerator()->GetCMakeInstance()->IssueMessage(
             messageType, e.str(), this->Target->Target->GetBacktrace());
           }
         }
@@ -2444,7 +2445,7 @@ static void processIncludeDirectories(cmGeneratorTarget const* tgt,
       }
     if (!usedIncludes.empty())
       {
-      mf->GetCMakeInstance()->IssueMessage(cmake::LOG,
+      tgt->GetLocalGenerator()->GetCMakeInstance()->IssueMessage(cmake::LOG,
                             std::string("Used includes for target ")
                             + tgt->GetName() + ":\n"
                             + usedIncludes, (*it)->ge->GetBacktrace());
@@ -2577,7 +2578,7 @@ static void processCompileOptionsInternal(cmGeneratorTarget const* tgt,
       }
     if (!usedOptions.empty())
       {
-      mf->GetCMakeInstance()->IssueMessage(cmake::LOG,
+      tgt->GetLocalGenerator()->GetCMakeInstance()->IssueMessage(cmake::LOG,
                             std::string("Used compile ") + logName
                             + std::string(" for target ")
                             + tgt->GetName() + ":\n"
@@ -4212,7 +4213,7 @@ cmGeneratorTarget::ReportPropertyOrigin(const std::string &p,
   areport += result;
   areport += "\"):\n" + report;
 
-  this->Makefile->GetCMakeInstance()->IssueMessage(cmake::LOG, areport);
+  this->LocalGenerator->GetCMakeInstance()->IssueMessage(cmake::LOG, areport);
 }
 
 //----------------------------------------------------------------------------

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=27916f2cd10904deda1a44bf221fbdef7ba1af66
commit 27916f2cd10904deda1a44bf221fbdef7ba1af66
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 7 00:37:31 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 8 23:25:11 2015 +0200

    cmLocalGenerator: Add cmake instance accessor.

diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index b26151c..6647894 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2858,6 +2858,11 @@ cmLocalGenerator
   return source.GetLanguage();
 }
 
+cmake* cmLocalGenerator::GetCMakeInstance() const
+{
+  return this->GlobalGenerator->GetCMakeInstance();
+}
+
 //----------------------------------------------------------------------------
 std::string
 cmLocalGenerator::GetTargetDirectory(cmTarget const&) const
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 33fede1..d9623cb 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -251,6 +251,8 @@ public:
    */
   bool NeedBackwardsCompatibility_2_4();
 
+  cmake* GetCMakeInstance() const;
+
   /**
    * Generate a Mac OS X application bundle Info.plist file.
    */

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

Summary of changes:
 Source/cmComputeLinkInformation.cxx            |    9 +-
 Source/cmGeneratorExpressionNode.cxx           |    6 +-
 Source/cmGeneratorTarget.cxx                   |  664 +++++++++++++++++++++--
 Source/cmGeneratorTarget.h                     |   79 +++
 Source/cmGlobalXCodeGenerator.cxx              |    2 +-
 Source/cmInstallTargetGenerator.cxx            |    2 +-
 Source/cmListFileCache.h                       |    9 -
 Source/cmLocalGenerator.cxx                    |    9 +-
 Source/cmLocalGenerator.h                      |    2 +
 Source/cmMakefileExecutableTargetGenerator.cxx |    7 +-
 Source/cmMakefileLibraryTargetGenerator.cxx    |   11 +-
 Source/cmMakefileTargetGenerator.cxx           |    3 +-
 Source/cmNinjaNormalTargetGenerator.cxx        |    8 +-
 Source/cmNinjaTargetGenerator.cxx              |    4 +-
 Source/cmTarget.cxx                            |  671 +-----------------------
 Source/cmTarget.h                              |   70 +--
 16 files changed, 770 insertions(+), 786 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list