[Cmake-commits] CMake branch, next, updated. v2.8.12.1-6984-gdadfba9

Stephen Kelly steveire at gmail.com
Fri Jan 10 16:23:13 EST 2014


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  dadfba9818808c980e345b8ea37d790eb361df0e (commit)
       via  b784762852cf7af338155f6e180cb67d5df13805 (commit)
      from  42c5eab065485759ce5726f1ccd611d3245ef083 (commit)

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

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dadfba9818808c980e345b8ea37d790eb361df0e
commit dadfba9818808c980e345b8ea37d790eb361df0e
Merge: 42c5eab b784762
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Jan 10 16:23:11 2014 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Jan 10 16:23:11 2014 -0500

    Merge topic 'use-generator-target' into next
    
    b784762 Revert topic


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b784762852cf7af338155f6e180cb67d5df13805
commit b784762852cf7af338155f6e180cb67d5df13805
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Jan 10 22:21:54 2014 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Jan 10 22:22:41 2014 +0100

    Revert topic

diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx
index 7aeed5d..1e2a85c 100644
--- a/Source/cmCommands.cxx
+++ b/Source/cmCommands.cxx
@@ -17,6 +17,7 @@
 #include "cmCMakeHostSystemInformationCommand.cxx"
 #include "cmElseIfCommand.cxx"
 #include "cmExportCommand.cxx"
+#include "cmExportLibraryDependencies.cxx"
 #include "cmFLTKWrapUICommand.cxx"
 #include "cmIncludeExternalMSProjectCommand.cxx"
 #include "cmInstallProgramsCommand.cxx"
@@ -59,6 +60,7 @@ void GetPredefinedCommands(std::list<cmCommand*>&
   commands.push_back(new cmCMakeHostSystemInformationCommand);
   commands.push_back(new cmElseIfCommand);
   commands.push_back(new cmExportCommand);
+  commands.push_back(new cmExportLibraryDependenciesCommand);
   commands.push_back(new cmFLTKWrapUICommand);
   commands.push_back(new cmIncludeExternalMSProjectCommand);
   commands.push_back(new cmInstallProgramsCommand);
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index ddd7bc7..1be5980 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -190,6 +190,9 @@ cmComputeLinkDepends
   // Enable debug mode if requested.
   this->DebugMode = this->Makefile->IsOn("CMAKE_LINK_DEPENDS_DEBUG_MODE");
 
+  // Assume no compatibility until set.
+  this->OldLinkDirMode = false;
+
   // No computation has been done.
   this->CCG = 0;
 }
@@ -207,6 +210,12 @@ cmComputeLinkDepends::~cmComputeLinkDepends()
 }
 
 //----------------------------------------------------------------------------
+void cmComputeLinkDepends::SetOldLinkDirMode(bool b)
+{
+  this->OldLinkDirMode = b;
+}
+
+//----------------------------------------------------------------------------
 std::vector<cmComputeLinkDepends::LinkEntry> const&
 cmComputeLinkDepends::Compute()
 {
@@ -217,7 +226,7 @@ cmComputeLinkDepends::Compute()
   while(!this->BFSQueue.empty())
     {
     // Get the next entry.
-    int qe = this->BFSQueue.front();
+    BFSEntry qe = this->BFSQueue.front();
     this->BFSQueue.pop();
 
     // Follow the entry's dependencies.
@@ -309,32 +318,43 @@ int cmComputeLinkDepends::AddLinkEntry(int depender_index,
   if(entry.Target)
     {
     // Target dependencies are always known.  Follow them.
-    this->BFSQueue.push(index);
+    BFSEntry qe = {index, 0};
+    this->BFSQueue.push(qe);
     }
-  else if(!entry.IsFlag)
+  else
     {
-    // The item dependencies are not known.  We need to infer them.
-    this->InferredDependSets[index] = new DependSetList;
+    // Look for an old-style <item>_LIB_DEPENDS variable.
+    std::string var = entry.Item;
+    var += "_LIB_DEPENDS";
+    if(const char* val = this->Makefile->GetDefinition(var.c_str()))
+      {
+      // The item dependencies are known.  Follow them.
+      BFSEntry qe = {index, val};
+      this->BFSQueue.push(qe);
+      }
+    else if(!entry.IsFlag)
+      {
+      // The item dependencies are not known.  We need to infer them.
+      this->InferredDependSets[index] = new DependSetList;
+      }
     }
 
   return index;
 }
 
 //----------------------------------------------------------------------------
-void cmComputeLinkDepends::FollowLinkEntry(int depender_index)
+void cmComputeLinkDepends::FollowLinkEntry(BFSEntry const& qe)
 {
   // Get this entry representation.
+  int depender_index = qe.Index;
   LinkEntry const& entry = this->EntryList[depender_index];
 
   // Follow the item's dependencies.
   if(entry.Target)
     {
     // Follow the target dependencies.
-    cmGeneratorTarget *gtgt = entry.Target->GetMakefile()->GetLocalGenerator()
-                                          ->GetGlobalGenerator()
-                                          ->GetGeneratorTarget(entry.Target);
-    if(cmGeneratorTarget::LinkInterface const* iface =
-       gtgt->GetLinkInterface(this->Config, this->HeadTarget))
+    if(cmTarget::LinkInterface const* iface =
+       entry.Target->GetLinkInterface(this->Config, this->HeadTarget))
       {
       const bool isIface =
                       entry.Target->GetType() == cmTarget::INTERFACE_LIBRARY;
@@ -348,15 +368,27 @@ void cmComputeLinkDepends::FollowLinkEntry(int depender_index)
 
       // Handle dependent shared libraries.
       this->FollowSharedDeps(depender_index, iface);
+
+      // Support for CMP0003.
+      for(std::vector<std::string>::const_iterator
+            oi = iface->WrongConfigLibraries.begin();
+          oi != iface->WrongConfigLibraries.end(); ++oi)
+        {
+        this->CheckWrongConfigItem(depender_index, *oi);
+        }
       }
     }
+  else
+    {
+    // Follow the old-style dependency list.
+    this->AddVarLinkEntries(depender_index, qe.LibDepends);
+    }
 }
 
 //----------------------------------------------------------------------------
 void
 cmComputeLinkDepends
-::FollowSharedDeps(int depender_index,
-                   cmGeneratorTarget::LinkInterface const* iface,
+::FollowSharedDeps(int depender_index, cmTarget::LinkInterface const* iface,
                    bool follow_interface)
 {
   // Follow dependencies if we have not followed them already.
@@ -420,11 +452,8 @@ void cmComputeLinkDepends::HandleSharedDependency(SharedDepEntry const& dep)
   // Target items may have their own dependencies.
   if(entry.Target)
     {
-    cmGeneratorTarget *gtgt = entry.Target->GetMakefile()->GetLocalGenerator()
-                                          ->GetGlobalGenerator()
-                                          ->GetGeneratorTarget(entry.Target);
-    if(cmGeneratorTarget::LinkInterface const* iface =
-       gtgt->GetLinkInterface(this->Config, this->HeadTarget))
+    if(cmTarget::LinkInterface const* iface =
+       entry.Target->GetLinkInterface(this->Config, this->HeadTarget))
       {
       // Follow public and private dependencies transitively.
       this->FollowSharedDeps(index, iface, true);
@@ -433,15 +462,94 @@ void cmComputeLinkDepends::HandleSharedDependency(SharedDepEntry const& dep)
 }
 
 //----------------------------------------------------------------------------
+void cmComputeLinkDepends::AddVarLinkEntries(int depender_index,
+                                             const char* value)
+{
+  // This is called to add the dependencies named by
+  // <item>_LIB_DEPENDS.  The variable contains a semicolon-separated
+  // list.  The list contains link-type;item pairs and just items.
+  std::vector<std::string> deplist;
+  cmSystemTools::ExpandListArgument(value, deplist);
+
+  // Look for entries meant for this configuration.
+  std::vector<std::string> actual_libs;
+  cmTarget::LinkLibraryType llt = cmTarget::GENERAL;
+  bool haveLLT = false;
+  for(std::vector<std::string>::const_iterator di = deplist.begin();
+      di != deplist.end(); ++di)
+    {
+    if(*di == "debug")
+      {
+      llt = cmTarget::DEBUG;
+      haveLLT = true;
+      }
+    else if(*di == "optimized")
+      {
+      llt = cmTarget::OPTIMIZED;
+      haveLLT = true;
+      }
+    else if(*di == "general")
+      {
+      llt = cmTarget::GENERAL;
+      haveLLT = true;
+      }
+    else if(!di->empty())
+      {
+      // If no explicit link type was given prior to this entry then
+      // check if the entry has its own link type variable.  This is
+      // needed for compatibility with dependency files generated by
+      // the export_library_dependencies command from CMake 2.4 and
+      // lower.
+      if(!haveLLT)
+        {
+        std::string var = *di;
+        var += "_LINK_TYPE";
+        if(const char* val = this->Makefile->GetDefinition(var.c_str()))
+          {
+          if(strcmp(val, "debug") == 0)
+            {
+            llt = cmTarget::DEBUG;
+            }
+          else if(strcmp(val, "optimized") == 0)
+            {
+            llt = cmTarget::OPTIMIZED;
+            }
+          }
+        }
+
+      // If the library is meant for this link type then use it.
+      if(llt == cmTarget::GENERAL || llt == this->LinkType)
+        {
+        actual_libs.push_back(*di);
+        }
+      else if(this->OldLinkDirMode)
+        {
+        this->CheckWrongConfigItem(depender_index, *di);
+        }
+
+      // Reset the link type until another explicit type is given.
+      llt = cmTarget::GENERAL;
+      haveLLT = false;
+      }
+    }
+
+  // Add the entries from this list.
+  this->AddLinkEntries(depender_index, actual_libs);
+}
+
+//----------------------------------------------------------------------------
 void cmComputeLinkDepends::AddDirectLinkEntries()
 {
-  cmGeneratorTarget *gtgt = this->Target->GetMakefile()->GetLocalGenerator()
-                                ->GetGlobalGenerator()
-                                ->GetGeneratorTarget(this->Target);
   // Add direct link dependencies in this configuration.
-  cmGeneratorTarget::LinkImplementation const* impl =
-    gtgt->GetLinkImplementation(this->Config, this->HeadTarget);
+  cmTarget::LinkImplementation const* impl =
+    this->Target->GetLinkImplementation(this->Config, this->HeadTarget);
   this->AddLinkEntries(-1, impl->Libraries);
+  for(std::vector<std::string>::const_iterator
+        wi = impl->WrongConfigLibraries.begin();
+      wi != impl->WrongConfigLibraries.end(); ++wi)
+    {
+    this->CheckWrongConfigItem(-1, *wi);
+    }
 }
 
 //----------------------------------------------------------------------------
@@ -458,7 +566,7 @@ cmComputeLinkDepends::AddLinkEntries(int depender_index,
     {
     // Skip entries that will resolve to the target getting linked or
     // are empty.
-    std::string item = *li;
+    std::string item = this->Target->CheckCMP0004(*li);
     if(item == this->Target->GetName() || item.empty())
       {
       continue;
@@ -844,11 +952,8 @@ int cmComputeLinkDepends::ComputeComponentCount(NodeList const& nl)
     {
     if(cmTarget const* target = this->EntryList[*ni].Target)
       {
-      cmGeneratorTarget *gtgt = target->GetMakefile()->GetLocalGenerator()
-                                      ->GetGlobalGenerator()
-                                      ->GetGeneratorTarget(target);
-      if(cmGeneratorTarget::LinkInterface const* iface =
-         gtgt->GetLinkInterface(this->Config, this->HeadTarget))
+      if(cmTarget::LinkInterface const* iface =
+         target->GetLinkInterface(this->Config, this->HeadTarget))
         {
         if(iface->Multiplicity > count)
           {
@@ -879,3 +984,25 @@ void cmComputeLinkDepends::DisplayFinalEntries()
     }
   fprintf(stderr, "\n");
 }
+
+//----------------------------------------------------------------------------
+void cmComputeLinkDepends::CheckWrongConfigItem(int depender_index,
+                                                std::string const& item)
+{
+  if(!this->OldLinkDirMode)
+    {
+    return;
+    }
+
+  // For CMake 2.4 bug-compatibility we need to consider the output
+  // directories of targets linked in another configuration as link
+  // directories.
+  if(cmTarget const* tgt
+                      = this->FindTargetToLink(depender_index, item.c_str()))
+    {
+    if(!tgt->IsImported())
+      {
+      this->OldWrongConfigItems.insert(tgt);
+      }
+    }
+}
diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h
index ffa9c00..cf227fb 100644
--- a/Source/cmComputeLinkDepends.h
+++ b/Source/cmComputeLinkDepends.h
@@ -52,6 +52,10 @@ public:
   typedef std::vector<LinkEntry> EntryVector;
   EntryVector const& Compute();
 
+  void SetOldLinkDirMode(bool b);
+  std::set<cmTarget const*> const& GetOldWrongConfigItems() const
+    { return this->OldWrongConfigItems; }
+
 private:
 
   // Context information.
@@ -75,6 +79,7 @@ private:
   std::map<cmStdString, int>::iterator
   AllocateLinkEntry(std::string const& item);
   int AddLinkEntry(int depender_index, std::string const& item);
+  void AddVarLinkEntries(int depender_index, const char* value);
   void AddDirectLinkEntries();
   void AddLinkEntries(int depender_index,
                       std::vector<std::string> const& libs);
@@ -84,8 +89,14 @@ private:
   std::vector<LinkEntry> EntryList;
   std::map<cmStdString, int> LinkEntryIndex;
 
-  std::queue<int> BFSQueue;
-  void FollowLinkEntry(int);
+  // BFS of initial dependencies.
+  struct BFSEntry
+  {
+    int Index;
+    const char* LibDepends;
+  };
+  std::queue<BFSEntry> BFSQueue;
+  void FollowLinkEntry(BFSEntry const&);
 
   // Shared libraries that are included only because they are
   // dependencies of other shared libraries, not because they are part
@@ -98,7 +109,7 @@ private:
   std::queue<SharedDepEntry> SharedDepQueue;
   std::set<int> SharedDepFollowed;
   void FollowSharedDeps(int depender_index,
-                        cmGeneratorTarget::LinkInterface const* iface,
+                        cmTarget::LinkInterface const* iface,
                         bool follow_interface = false);
   void QueueSharedDependencies(int depender_index,
                                std::vector<std::string> const& deps);
@@ -149,6 +160,11 @@ private:
 
   // Record of the original link line.
   std::vector<int> OriginalEntries;
+
+  // Compatibility help.
+  bool OldLinkDirMode;
+  void CheckWrongConfigItem(int depender_index, std::string const& item);
+  std::set<cmTarget const*> OldWrongConfigItems;
 };
 
 #endif
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index a873f46..6986965 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -18,7 +18,6 @@
 #include "cmLocalGenerator.h"
 #include "cmMakefile.h"
 #include "cmTarget.h"
-#include "cmGeneratorTarget.h"
 #include "cmake.h"
 
 #include <ctype.h>
@@ -240,15 +239,13 @@ because this need be done only for shared libraries without soname-s.
 
 //----------------------------------------------------------------------------
 cmComputeLinkInformation
-::cmComputeLinkInformation(cmGeneratorTarget const* target, const char* config,
+::cmComputeLinkInformation(cmTarget const* target, const char* config,
                            cmTarget const* headTarget)
 {
   // Store context information.
   this->Target = target;
-  this->Makefile = this->Target->Target->GetMakefile();
-  this->HeadTarget = this->Makefile->GetLocalGenerator()
-                                   ->GetGlobalGenerator()
-                                   ->GetGeneratorTarget(headTarget);
+  this->HeadTarget = headTarget;
+  this->Makefile = this->Target->GetMakefile();
   this->LocalGenerator = this->Makefile->GetLocalGenerator();
   this->GlobalGenerator = this->LocalGenerator->GetGlobalGenerator();
   this->CMakeInstance = this->GlobalGenerator->GetCMakeInstance();
@@ -262,10 +259,10 @@ cmComputeLinkInformation
 
   // Allocate internals.
   this->OrderLinkerSearchPath =
-    new cmOrderDirectories(this->GlobalGenerator, target->Target,
+    new cmOrderDirectories(this->GlobalGenerator, target,
                            "linker search path");
   this->OrderRuntimeSearchPath =
-    new cmOrderDirectories(this->GlobalGenerator, target->Target,
+    new cmOrderDirectories(this->GlobalGenerator, target,
                            "runtime search path");
   this->OrderDependentRPath = 0;
 
@@ -325,7 +322,6 @@ cmComputeLinkInformation
     this->RuntimeAlways =
       (this->Makefile->
        GetSafeDefinition("CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH"));
-
     this->RuntimeUseChrpath = this->Target->IsChrpathUsed(config);
 
     // Get options needed to help find dependent libraries.
@@ -372,15 +368,15 @@ cmComputeLinkInformation
     {
     this->SharedDependencyMode = SharedDepModeDir;
     this->OrderDependentRPath =
-      new cmOrderDirectories(this->GlobalGenerator, target->Target,
+      new cmOrderDirectories(this->GlobalGenerator, target,
                              "dependent library path");
     }
 
   // Add the search path entries requested by the user to path ordering.
   this->OrderLinkerSearchPath
-    ->AddUserDirectories(this->Target->Target->GetLinkDirectories());
+    ->AddUserDirectories(this->Target->GetLinkDirectories());
   this->OrderRuntimeSearchPath
-    ->AddUserDirectories(this->Target->Target->GetLinkDirectories());
+    ->AddUserDirectories(this->Target->GetLinkDirectories());
 
   // Set up the implicit link directories.
   this->LoadImplicitLinkInfo();
@@ -395,6 +391,31 @@ cmComputeLinkInformation
     this->OrderDependentRPath
       ->AddLanguageDirectories(this->RuntimeLinkDirs);
     }
+
+  // Decide whether to enable compatible library search path mode.
+  // There exists code that effectively does
+  //
+  //    /path/to/libA.so -lB
+  //
+  // where -lB is meant to link to /path/to/libB.so.  This is broken
+  // because it specified -lB without specifying a link directory (-L)
+  // in which to search for B.  This worked in CMake 2.4 and below
+  // because -L/path/to would be added by the -L/-l split for A.  In
+  // order to support such projects we need to add the directories
+  // containing libraries linked with a full path to the -L path.
+  this->OldLinkDirMode =
+    this->Target->GetPolicyStatusCMP0003() != cmPolicies::NEW;
+  if(this->OldLinkDirMode)
+    {
+    // Construct a mask to not bother with this behavior for link
+    // directories already specified by the user.
+    std::vector<std::string> const& dirs = this->Target->GetLinkDirectories();
+    for(std::vector<std::string>::const_iterator di = dirs.begin();
+        di != dirs.end(); ++di)
+      {
+      this->OldLinkDirMask.insert(*di);
+      }
+    }
 }
 
 //----------------------------------------------------------------------------
@@ -484,8 +505,8 @@ bool cmComputeLinkInformation::Compute()
     }
 
   // Compute the ordered link line items.
-  cmComputeLinkDepends cld(this->Target->Target, this->Config,
-                           this->HeadTarget->Target);
+  cmComputeLinkDepends cld(this->Target, this->Config, this->HeadTarget);
+  cld.SetOldLinkDirMode(this->OldLinkDirMode);
   cmComputeLinkDepends::EntryVector const& linkEntries = cld.Compute();
 
   // Add the link line items.
@@ -515,6 +536,31 @@ bool cmComputeLinkInformation::Compute()
     this->SetCurrentLinkType(this->StartLinkType);
     }
 
+  // Finish listing compatibility paths.
+  if(this->OldLinkDirMode)
+    {
+    // For CMake 2.4 bug-compatibility we need to consider the output
+    // directories of targets linked in another configuration as link
+    // directories.
+    std::set<cmTarget const*> const& wrongItems = cld.GetOldWrongConfigItems();
+    for(std::set<cmTarget const*>::const_iterator i = wrongItems.begin();
+        i != wrongItems.end(); ++i)
+      {
+      cmTarget const* tgt = *i;
+      bool implib =
+        (this->UseImportLibrary &&
+         (tgt->GetType() == cmTarget::SHARED_LIBRARY));
+      std::string lib = tgt->GetFullPath(this->Config , implib, true);
+      this->OldLinkDirItems.push_back(lib);
+      }
+    }
+
+  // Finish setting up linker search directories.
+  if(!this->FinishLinkerSearchDirectories())
+    {
+    return false;
+    }
+
   // Add implicit language runtime libraries and directories.
   this->AddImplicitLinkInfo();
 
@@ -525,10 +571,8 @@ bool cmComputeLinkInformation::Compute()
 void cmComputeLinkInformation::AddImplicitLinkInfo()
 {
   // The link closure lists all languages whose implicit info is needed.
-
-  cmGeneratorTarget::LinkClosure const* lc =
-                                    this->Target->GetLinkClosure(this->Config,
-                                                    this->HeadTarget->Target);
+  cmTarget::LinkClosure const* lc=this->Target->GetLinkClosure(this->Config,
+                                                          this->HeadTarget);
   for(std::vector<std::string>::const_iterator li = lc->Languages.begin();
       li != lc->Languages.end(); ++li)
     {
@@ -591,9 +635,6 @@ void cmComputeLinkInformation::AddItem(std::string const& item,
 
   if(tgt && tgt->IsLinkable())
     {
-    cmGeneratorTarget *gtgt = tgt->GetMakefile()->GetLocalGenerator()
-                                 ->GetGlobalGenerator()
-                                 ->GetGeneratorTarget(tgt);
     // This is a CMake target.  Ask the target for its real name.
     if(impexe && this->LoaderFlag)
       {
@@ -602,8 +643,7 @@ void cmComputeLinkInformation::AddItem(std::string const& item,
       // platform.  Add it now.
       std::string linkItem;
       linkItem = this->LoaderFlag;
-
-      std::string exe = gtgt->GetFullPath(config, this->UseImportLibrary,
+      std::string exe = tgt->GetFullPath(config, this->UseImportLibrary,
                                          true);
       linkItem += exe;
       this->Items.push_back(Item(linkItem, true, tgt));
@@ -622,7 +662,7 @@ void cmComputeLinkInformation::AddItem(std::string const& item,
         return;
         }
       // Pass the full path to the target file.
-      std::string lib = gtgt->GetFullPath(config, implib, true);
+      std::string lib = tgt->GetFullPath(config, implib, true);
       if(!this->LinkDependsNoShared ||
          tgt->GetType() != cmTarget::SHARED_LIBRARY)
         {
@@ -654,7 +694,7 @@ void cmComputeLinkInformation::AddItem(std::string const& item,
     else
       {
       // This is a library or option specified by the user.
-      this->AddUserItem(item);
+      this->AddUserItem(item, true);
       }
     }
 }
@@ -711,10 +751,7 @@ void cmComputeLinkInformation::AddSharedDepItem(std::string const& item,
   std::string lib;
   if(tgt)
     {
-    cmGeneratorTarget *gtgt = tgt->GetMakefile()->GetLocalGenerator()
-                                 ->GetGlobalGenerator()
-                                 ->GetGeneratorTarget(tgt);
-    lib = gtgt->GetFullPath(this->Config, this->UseImportLibrary);
+    lib = tgt->GetFullPath(this->Config, this->UseImportLibrary);
     this->AddLibraryRuntimeInfo(lib, tgt);
     }
   else
@@ -741,10 +778,7 @@ void cmComputeLinkInformation::AddSharedDepItem(std::string const& item,
     {
     if(tgt)
       {
-      cmGeneratorTarget *gtgt = tgt->GetMakefile()->GetLocalGenerator()
-                                   ->GetGlobalGenerator()
-                                   ->GetGeneratorTarget(tgt);
-      std::string soName = gtgt->GetSOName(this->Config);
+      std::string soName = tgt->GetSOName(this->Config);
       const char* soname = soName.empty()? 0 : soName.c_str();
       order->AddRuntimeLibrary(lib, soname);
       }
@@ -1062,6 +1096,15 @@ void cmComputeLinkInformation::AddTargetItem(std::string const& item,
     this->Items.push_back(Item(this->LibLinkFileFlag, false));
     }
 
+  // For compatibility with CMake 2.4 include the item's directory in
+  // the linker search path.
+  if(this->OldLinkDirMode && !target->IsFrameworkOnApple() &&
+     this->OldLinkDirMask.find(cmSystemTools::GetFilenamePath(item)) ==
+     this->OldLinkDirMask.end())
+    {
+    this->OldLinkDirItems.push_back(item);
+    }
+
   // Now add the full path to the library.
   this->Items.push_back(Item(item, true, target));
 }
@@ -1083,7 +1126,7 @@ void cmComputeLinkInformation::AddFullItem(std::string const& item)
 
   // Full path libraries should specify a valid library file name.
   // See documentation of CMP0008.
-  if(this->Target->Target->GetPolicyStatusCMP0008() != cmPolicies::NEW &&
+  if(this->Target->GetPolicyStatusCMP0008() != cmPolicies::NEW &&
      (strstr(this->GlobalGenerator->GetName(), "Visual Studio") ||
       strstr(this->GlobalGenerator->GetName(), "Xcode")))
     {
@@ -1116,6 +1159,15 @@ void cmComputeLinkInformation::AddFullItem(std::string const& item)
       }
     }
 
+  // For compatibility with CMake 2.4 include the item's directory in
+  // the linker search path.
+  if(this->OldLinkDirMode &&
+     this->OldLinkDirMask.find(cmSystemTools::GetFilenamePath(item)) ==
+     this->OldLinkDirMask.end())
+    {
+    this->OldLinkDirItems.push_back(item);
+    }
+
   // If this platform wants a flag before the full path, add it.
   if(!this->LibLinkFileFlag.empty())
     {
@@ -1160,7 +1212,7 @@ bool cmComputeLinkInformation::CheckImplicitDirItem(std::string const& item)
   // directory then just report the file name without the directory
   // portion.  This will allow the system linker to locate the proper
   // library for the architecture at link time.
-  this->AddUserItem(file);
+  this->AddUserItem(file, false);
 
   // Make sure the link directory ordering will find the library.
   this->OrderLinkerSearchPath->AddLinkLibrary(item);
@@ -1169,7 +1221,8 @@ bool cmComputeLinkInformation::CheckImplicitDirItem(std::string const& item)
 }
 
 //----------------------------------------------------------------------------
-void cmComputeLinkInformation::AddUserItem(std::string const& item)
+void cmComputeLinkInformation::AddUserItem(std::string const& item,
+                                           bool pathNotKnown)
 {
   // This is called to handle a link item that does not match a CMake
   // target and is not a full path.  We check here if it looks like a
@@ -1182,6 +1235,16 @@ void cmComputeLinkInformation::AddUserItem(std::string const& item)
   // Pass flags through untouched.
   if(item[0] == '-' || item[0] == '$' || item[0] == '`')
     {
+    // if this is a -l option then we might need to warn about
+    // CMP0003 so put it in OldUserFlagItems, if it is not a -l
+    // or -Wl,-l (-framework -pthread), then allow it without a
+    // CMP0003 as -L will not affect those other linker flags
+    if(item.find("-l") == 0 ||  item.find("-Wl,-l") == 0)
+      {
+      // This is a linker option provided by the user.
+      this->OldUserFlagItems.push_back(item);
+      }
+
     // Restore the target link type since this item does not specify
     // one.
     this->SetCurrentLinkType(this->StartLinkType);
@@ -1250,6 +1313,12 @@ void cmComputeLinkInformation::AddUserItem(std::string const& item)
     }
   else
     {
+    // This is a name specified by the user.
+    if(pathNotKnown)
+      {
+      this->OldUserFlagItems.push_back(item);
+      }
+
     // We must ask the linker to search for a library with this name.
     // Restore the target link type since this item does not specify
     // one.
@@ -1403,7 +1472,7 @@ void cmComputeLinkInformation::AddSharedLibNoSOName(std::string const& item)
   // runtime the dynamic linker will search for the library using the
   // path instead of just the name.
   std::string file = cmSystemTools::GetFilenameName(item);
-  this->AddUserItem(file);
+  this->AddUserItem(file, false);
 
   // Make sure the link directory ordering will find the library.
   this->OrderLinkerSearchPath->AddLinkLibrary(item);
@@ -1422,12 +1491,13 @@ void cmComputeLinkInformation::HandleBadFullItem(std::string const& item,
     }
 
   // Tell the linker to search for the item and provide the proper
-  // path for it.
-  this->AddUserItem(file);
+  // path for it.  Do not contribute to any CMP0003 warning (do not
+  // put in OldLinkDirItems or OldUserFlagItems).
+  this->AddUserItem(file, false);
   this->OrderLinkerSearchPath->AddLinkLibrary(item);
 
   // Produce any needed message.
-  switch(this->Target->Target->GetPolicyStatusCMP0008())
+  switch(this->Target->GetPolicyStatusCMP0008())
     {
     case cmPolicies::WARN:
       {
@@ -1444,7 +1514,7 @@ void cmComputeLinkInformation::HandleBadFullItem(std::string const& item,
           << "  " << item << "\n"
           << "which is a full-path but not a valid library file name.";
         this->CMakeInstance->IssueMessage(cmake::AUTHOR_WARNING, w.str(),
-                                        this->Target->Target->GetBacktrace());
+                                          this->Target->GetBacktrace());
         }
       }
     case cmPolicies::OLD:
@@ -1463,13 +1533,134 @@ void cmComputeLinkInformation::HandleBadFullItem(std::string const& item,
           << "  " << item << "\n"
           << "which is a full-path but not a valid library file name.";
       this->CMakeInstance->IssueMessage(cmake::FATAL_ERROR, e.str(),
-                                        this->Target->Target->GetBacktrace());
+                                        this->Target->GetBacktrace());
       }
       break;
     }
 }
 
 //----------------------------------------------------------------------------
+bool cmComputeLinkInformation::FinishLinkerSearchDirectories()
+{
+  // Support broken projects if necessary.
+  if(this->OldLinkDirItems.empty() || this->OldUserFlagItems.empty() ||
+     !this->OldLinkDirMode)
+    {
+    return true;
+    }
+
+  // Enforce policy constraints.
+  switch(this->Target->GetPolicyStatusCMP0003())
+    {
+    case cmPolicies::WARN:
+      if(!this->CMakeInstance->GetPropertyAsBool("CMP0003-WARNING-GIVEN"))
+        {
+        this->CMakeInstance->SetProperty("CMP0003-WARNING-GIVEN", "1");
+        cmOStringStream w;
+        this->PrintLinkPolicyDiagnosis(w);
+        this->CMakeInstance->IssueMessage(cmake::AUTHOR_WARNING, w.str(),
+                                          this->Target->GetBacktrace());
+        }
+    case cmPolicies::OLD:
+      // OLD behavior is to add the paths containing libraries with
+      // known full paths as link directories.
+      break;
+    case cmPolicies::NEW:
+      // Should never happen due to assignment of OldLinkDirMode
+      return true;
+    case cmPolicies::REQUIRED_IF_USED:
+    case cmPolicies::REQUIRED_ALWAYS:
+      {
+      cmOStringStream e;
+      e << (this->Makefile->GetPolicies()->
+            GetRequiredPolicyError(cmPolicies::CMP0003)) << "\n";
+      this->PrintLinkPolicyDiagnosis(e);
+      this->CMakeInstance->IssueMessage(cmake::FATAL_ERROR, e.str(),
+                                        this->Target->GetBacktrace());
+      return false;
+      }
+    }
+
+  // Add the link directories for full path items.
+  for(std::vector<std::string>::const_iterator
+        i = this->OldLinkDirItems.begin();
+      i != this->OldLinkDirItems.end(); ++i)
+    {
+    this->OrderLinkerSearchPath->AddLinkLibrary(*i);
+    }
+  return true;
+}
+
+//----------------------------------------------------------------------------
+void cmComputeLinkInformation::PrintLinkPolicyDiagnosis(std::ostream& os)
+{
+  // Tell the user what to do.
+  os << "Policy CMP0003 should be set before this line.  "
+     << "Add code such as\n"
+     << "  if(COMMAND cmake_policy)\n"
+     << "    cmake_policy(SET CMP0003 NEW)\n"
+     << "  endif(COMMAND cmake_policy)\n"
+     << "as early as possible but after the most recent call to "
+     << "cmake_minimum_required or cmake_policy(VERSION).  ";
+
+  // List the items that might need the old-style paths.
+  os << "This warning appears because target \""
+     << this->Target->GetName() << "\" "
+     << "links to some libraries for which the linker must search:\n";
+  {
+  // Format the list of unknown items to be as short as possible while
+  // still fitting in the allowed width (a true solution would be the
+  // bin packing problem if we were allowed to change the order).
+  std::string::size_type max_size = 76;
+  std::string line;
+  const char* sep = "  ";
+  for(std::vector<std::string>::const_iterator
+        i = this->OldUserFlagItems.begin();
+      i != this->OldUserFlagItems.end(); ++i)
+    {
+    // If the addition of another item will exceed the limit then
+    // output the current line and reset it.  Note that the separator
+    // is either " " or ", " which is always 2 characters.
+    if(!line.empty() && (line.size() + i->size() + 2) > max_size)
+      {
+      os << line << "\n";
+      sep = "  ";
+      line = "";
+      }
+    line += sep;
+    line += *i;
+    // Convert to the other separator.
+    sep = ", ";
+    }
+  if(!line.empty())
+    {
+    os << line << "\n";
+    }
+  }
+
+  // List the paths old behavior is adding.
+  os << "and other libraries with known full path:\n";
+  std::set<cmStdString> emitted;
+  for(std::vector<std::string>::const_iterator
+        i = this->OldLinkDirItems.begin();
+      i != this->OldLinkDirItems.end(); ++i)
+    {
+    if(emitted.insert(cmSystemTools::GetFilenamePath(*i)).second)
+      {
+      os << "  " << *i << "\n";
+      }
+    }
+
+  // Explain.
+  os << "CMake is adding directories in the second list to the linker "
+     << "search path in case they are needed to find libraries from the "
+     << "first list (for backwards compatibility with CMake 2.4).  "
+     << "Set policy CMP0003 to OLD or NEW to enable or disable this "
+     << "behavior explicitly.  "
+     << "Run \"cmake --help-policy CMP0003\" for more information.";
+}
+
+//----------------------------------------------------------------------------
 void cmComputeLinkInformation::LoadImplicitLinkInfo()
 {
   std::vector<std::string> implicitDirVec;
@@ -1561,10 +1752,7 @@ cmComputeLinkInformation::AddLibraryRuntimeInfo(std::string const& fullPath,
   // @loader_path or full paths.
   if(this->Makefile->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME"))
     {
-    cmGeneratorTarget *gtgt = target->GetMakefile()->GetLocalGenerator()
-                                ->GetGlobalGenerator()
-                                ->GetGeneratorTarget(target);
-    if(!gtgt->HasMacOSXRpathInstallNameDir(this->Config))
+    if(!target->HasMacOSXRpathInstallNameDir(this->Config))
       {
       return;
       }
@@ -1586,10 +1774,7 @@ cmComputeLinkInformation::AddLibraryRuntimeInfo(std::string const& fullPath,
 
   // Try to get the soname of the library.  Only files with this name
   // could possibly conflict.
-  cmGeneratorTarget *gtgt = target->GetMakefile()->GetLocalGenerator()
-                                  ->GetGlobalGenerator()
-                                  ->GetGeneratorTarget(target);
-  std::string soName = gtgt->GetSOName(this->Config);
+  std::string soName = target->GetSOName(this->Config);
   const char* soname = soName.empty()? 0 : soName.c_str();
 
   // Include this library in the runtime path ordering.
@@ -1701,8 +1886,8 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
     (outputRuntime && this->Target->HaveInstallTreeRPATH() &&
      linking_for_install);
   bool use_build_rpath =
-    (outputRuntime && this->Target->HaveBuildTreeRPATH(this->Config)
-      && !linking_for_install);
+    (outputRuntime && this->Target->HaveBuildTreeRPATH(this->Config) &&
+     !linking_for_install);
   bool use_link_rpath =
     outputRuntime && linking_for_install &&
     !this->Makefile->IsOn("CMAKE_SKIP_INSTALL_RPATH") &&
@@ -1784,8 +1969,8 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
   // Add runtime paths required by the languages to always be
   // present.  This is done even when skipping rpath support.
   {
-  cmGeneratorTarget::LinkClosure const* lc =
-    this->Target->GetLinkClosure(this->Config, this->HeadTarget->Target);
+  cmTarget::LinkClosure const* lc =
+    this->Target->GetLinkClosure(this->Config, this->HeadTarget);
   for(std::vector<std::string>::const_iterator li = lc->Languages.begin();
       li != lc->Languages.end(); ++li)
     {
diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h
index c26e39e..356e6ed 100644
--- a/Source/cmComputeLinkInformation.h
+++ b/Source/cmComputeLinkInformation.h
@@ -21,7 +21,6 @@ class cmGlobalGenerator;
 class cmLocalGenerator;
 class cmMakefile;
 class cmTarget;
-class cmGeneratorTarget;
 class cmOrderDirectories;
 
 /** \class cmComputeLinkInformation
@@ -30,7 +29,7 @@ class cmOrderDirectories;
 class cmComputeLinkInformation
 {
 public:
-  cmComputeLinkInformation(cmGeneratorTarget const* target, const char* config,
+  cmComputeLinkInformation(cmTarget const* target, const char* config,
                            cmTarget const* headTarget);
   ~cmComputeLinkInformation();
   bool Compute();
@@ -75,8 +74,8 @@ private:
   std::set<cmTarget const*> SharedLibrariesLinked;
 
   // Context information.
-  cmGeneratorTarget const* Target;
-  cmGeneratorTarget const* HeadTarget;
+  cmTarget const* Target;
+  cmTarget const* HeadTarget;
   cmMakefile* Makefile;
   cmLocalGenerator* LocalGenerator;
   cmGlobalGenerator* GlobalGenerator;
@@ -143,7 +142,7 @@ private:
   void AddTargetItem(std::string const& item, cmTarget const* target);
   void AddFullItem(std::string const& item);
   bool CheckImplicitDirItem(std::string const& item);
-  void AddUserItem(std::string const& item);
+  void AddUserItem(std::string const& item, bool pathNotKnown);
   void AddDirectoryItem(std::string const& item);
   void AddFrameworkItem(std::string const& item);
   void DropDirectoryItem(std::string const& item);
@@ -159,6 +158,8 @@ private:
 
   // Linker search path computation.
   cmOrderDirectories* OrderLinkerSearchPath;
+  bool FinishLinkerSearchDirectories();
+  void PrintLinkPolicyDiagnosis(std::ostream&);
 
   // Implicit link libraries and directories for linker language.
   void LoadImplicitLinkInfo();
@@ -170,6 +171,12 @@ private:
   // Additional paths configured by the runtime linker
   std::vector<std::string> RuntimeLinkDirs;
 
+  // Linker search path compatibility mode.
+  std::set<cmStdString> OldLinkDirMask;
+  std::vector<std::string> OldLinkDirItems;
+  std::vector<std::string> OldUserFlagItems;
+  bool OldLinkDirMode;
+
   // Runtime path computation.
   cmOrderDirectories* OrderRuntimeSearchPath;
   void AddLibraryRuntimeInfo(std::string const& fullPath,
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index 53f098c..73a8e27 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -16,7 +16,7 @@
 #include "cmLocalGenerator.h"
 #include "cmMakefile.h"
 #include "cmSystemTools.h"
-#include "cmGeneratorTarget.h"
+#include "cmTarget.h"
 #include "cmake.h"
 
 #include <algorithm>
@@ -143,12 +143,12 @@ bool cmComputeTargetDepends::Compute()
 
 //----------------------------------------------------------------------------
 void
-cmComputeTargetDepends::GetTargetDirectDepends(cmGeneratorTarget const* t,
+cmComputeTargetDepends::GetTargetDirectDepends(cmTarget const* t,
                                                cmTargetDependSet& deps)
 {
   // Lookup the index for this target.  All targets should be known by
   // this point.
-  std::map<cmGeneratorTarget const*, int>::const_iterator tii
+  std::map<cmTarget const*, int>::const_iterator tii
                                                   = this->TargetIndex.find(t);
   assert(tii != this->TargetIndex.end());
   int i = tii->second;
@@ -157,7 +157,7 @@ cmComputeTargetDepends::GetTargetDirectDepends(cmGeneratorTarget const* t,
   EdgeList const& nl = this->FinalGraph[i];
   for(EdgeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni)
     {
-    cmGeneratorTarget const* dep = this->Targets[*ni];
+    cmTarget const* dep = this->Targets[*ni];
     cmTargetDependSet::iterator di = deps.insert(dep).first;
     di->SetType(ni->IsStrong());
     }
@@ -171,12 +171,11 @@ void cmComputeTargetDepends::CollectTargets()
     this->GlobalGenerator->GetLocalGenerators();
   for(unsigned int i = 0; i < lgens.size(); ++i)
     {
-    const cmGeneratorTargetsType& targets = lgens[i]->GetMakefile()
-                                                    ->GetGeneratorTargets();
-    for(cmGeneratorTargetsType::const_iterator ti = targets.begin();
+    const cmTargets& targets = lgens[i]->GetMakefile()->GetTargets();
+    for(cmTargets::const_iterator ti = targets.begin();
         ti != targets.end(); ++ti)
       {
-      cmGeneratorTarget const* target = ti->second;
+      cmTarget const* target = &ti->second;
       int index = static_cast<int>(this->Targets.size());
       this->TargetIndex[target] = index;
       this->Targets.push_back(target);
@@ -201,7 +200,7 @@ void cmComputeTargetDepends::CollectDepends()
 void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
 {
   // Get the depender.
-  cmGeneratorTarget const* depender = this->Targets[depender_index];
+  cmTarget const* depender = this->Targets[depender_index];
   if (depender->GetType() == cmTarget::INTERFACE_LIBRARY)
     {
     return;
@@ -215,7 +214,7 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
   std::set<cmStdString> emitted;
   {
   std::vector<std::string> tlibs;
-  depender->GetDirectLinkLibraries(0, tlibs, depender->Target);
+  depender->GetDirectLinkLibraries(0, tlibs, depender);
   // A target should not depend on itself.
   emitted.insert(depender->GetName());
   for(std::vector<std::string>::const_iterator lib = tlibs.begin();
@@ -236,7 +235,7 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
     it != configs.end(); ++it)
     {
     std::vector<std::string> tlibs;
-    depender->GetDirectLinkLibraries(it->c_str(), tlibs, depender->Target);
+    depender->GetDirectLinkLibraries(it->c_str(), tlibs, depender);
 
     // A target should not depend on itself.
     emitted.insert(depender->GetName());
@@ -256,7 +255,7 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
 
   // Loop over all utility dependencies.
   {
-  std::set<cmStdString> const& tutils = depender->Target->GetUtilities();
+  std::set<cmStdString> const& tutils = depender->GetUtilities();
   std::set<cmStdString> emitted;
   // A target should not depend on itself.
   emitted.insert(depender->GetName());
@@ -274,15 +273,13 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
 
 //----------------------------------------------------------------------------
 void cmComputeTargetDepends::AddInterfaceDepends(int depender_index,
-                                            cmGeneratorTarget const* dependee,
-                                            const char *config,
-                                            std::set<cmStdString> &emitted)
+                                                 cmTarget const* dependee,
+                                                 const char *config,
+                                               std::set<cmStdString> &emitted)
 {
-  cmGeneratorTarget const* depender = this->Targets[depender_index];
-
-  if(cmGeneratorTarget::LinkInterface const* iface =
-                                dependee->GetLinkInterface(config,
-                                                           depender->Target))
+  cmTarget const* depender = this->Targets[depender_index];
+  if(cmTarget::LinkInterface const* iface =
+                                dependee->GetLinkInterface(config, depender))
     {
     for(std::vector<std::string>::const_iterator
         lib = iface->Libraries.begin();
@@ -305,15 +302,15 @@ void cmComputeTargetDepends::AddInterfaceDepends(int depender_index,
                                              bool linking,
                                              std::set<cmStdString> &emitted)
 {
-  cmGeneratorTarget const* depender = this->Targets[depender_index];
-  cmGeneratorTarget const* dependee =
-    depender->GetMakefile()->FindGeneratorTargetToUse(dependee_name);
+  cmTarget const* depender = this->Targets[depender_index];
+  cmTarget const* dependee =
+    depender->GetMakefile()->FindTargetToUse(dependee_name);
   // Skip targets that will not really be linked.  This is probably a
   // name conflict between an external library and an executable
   // within the project.
   if(linking && dependee &&
      dependee->GetType() == cmTarget::EXECUTABLE &&
-     !dependee->Target->IsExecutableWithExports())
+     !dependee->IsExecutableWithExports())
     {
     dependee = 0;
     }
@@ -322,7 +319,7 @@ void cmComputeTargetDepends::AddInterfaceDepends(int depender_index,
     {
     this->AddInterfaceDepends(depender_index, dependee, 0, emitted);
     std::vector<std::string> configs;
-    depender->Target->GetMakefile()->GetConfigurations(configs);
+    depender->GetMakefile()->GetConfigurations(configs);
     for (std::vector<std::string>::const_iterator it = configs.begin();
       it != configs.end(); ++it)
       {
@@ -340,18 +337,18 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index,
                                              bool linking)
 {
   // Get the depender.
-  cmGeneratorTarget const* depender = this->Targets[depender_index];
+  cmTarget const* depender = this->Targets[depender_index];
 
   // Check the target's makefile first.
-  cmGeneratorTarget const* dependee =
-    depender->GetMakefile()->FindGeneratorTargetToUse(dependee_name);
+  cmTarget const* dependee =
+    depender->GetMakefile()->FindTargetToUse(dependee_name);
 
   // Skip targets that will not really be linked.  This is probably a
   // name conflict between an external library and an executable
   // within the project.
   if(linking && dependee &&
      dependee->GetType() == cmTarget::EXECUTABLE &&
-     !dependee->Target->IsExecutableWithExports())
+     !dependee->IsExecutableWithExports())
     {
     dependee = 0;
     }
@@ -364,18 +361,18 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index,
 
 //----------------------------------------------------------------------------
 void cmComputeTargetDepends::AddTargetDepend(int depender_index,
-                                             cmGeneratorTarget const* dependee,
+                                             cmTarget const* dependee,
                                              bool linking)
 {
-  if(dependee->Target->IsImported())
+  if(dependee->IsImported())
     {
     // Skip imported targets but follow their utility dependencies.
-    std::set<cmStdString> const& utils = dependee->Target->GetUtilities();
+    std::set<cmStdString> const& utils = dependee->GetUtilities();
     for(std::set<cmStdString>::const_iterator i = utils.begin();
         i != utils.end(); ++i)
       {
-      if(cmGeneratorTarget const* transitive_dependee =
-         dependee->GetMakefile()->FindGeneratorTargetToUse(i->c_str()))
+      if(cmTarget const* transitive_dependee =
+         dependee->GetMakefile()->FindTargetToUse(i->c_str()))
         {
         this->AddTargetDepend(depender_index, transitive_dependee, false);
         }
@@ -385,7 +382,7 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index,
     {
     // Lookup the index for this target.  All targets should be known by
     // this point.
-    std::map<cmGeneratorTarget const*, int>::const_iterator tii =
+    std::map<cmTarget const*, int>::const_iterator tii =
       this->TargetIndex.find(dependee);
     assert(tii != this->TargetIndex.end());
     int dependee_index = tii->second;
@@ -405,13 +402,13 @@ cmComputeTargetDepends::DisplayGraph(Graph const& graph, const char* name)
   for(int depender_index = 0; depender_index < n; ++depender_index)
     {
     EdgeList const& nl = graph[depender_index];
-    cmGeneratorTarget const* depender = this->Targets[depender_index];
+    cmTarget const* depender = this->Targets[depender_index];
     fprintf(stderr, "target %d is [%s]\n",
             depender_index, depender->GetName());
     for(EdgeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni)
       {
       int dependee_index = *ni;
-      cmGeneratorTarget const* dependee = this->Targets[dependee_index];
+      cmTarget const* dependee = this->Targets[dependee_index];
       fprintf(stderr, "  depends on target %d [%s] (%s)\n", dependee_index,
               dependee->GetName(), ni->IsStrong()? "strong" : "weak");
       }
@@ -498,12 +495,11 @@ cmComputeTargetDepends
     {
     // Get the depender.
     int i = *ci;
-    cmGeneratorTarget const* depender = this->Targets[i];
+    cmTarget const* depender = this->Targets[i];
 
     // Describe the depender.
     e << "  \"" << depender->GetName() << "\" of type "
-      << cmTarget::GetTargetTypeName(cmTarget::TargetType(depender->GetType()))
-      << "\n";
+      << cmTarget::GetTargetTypeName(depender->GetType()) << "\n";
 
     // List its dependencies that are inside the component.
     EdgeList const& nl = this->InitialGraph[i];
@@ -512,7 +508,7 @@ cmComputeTargetDepends
       int j = *ni;
       if(cmap[j] == c)
         {
-        cmGeneratorTarget const* dependee = this->Targets[j];
+        cmTarget const* dependee = this->Targets[j];
         e << "    depends on \"" << dependee->GetName() << "\""
           << " (" << (ni->IsStrong()? "strong" : "weak") << ")\n";
         }
diff --git a/Source/cmComputeTargetDepends.h b/Source/cmComputeTargetDepends.h
index 54d237a..6cd6da0 100644
--- a/Source/cmComputeTargetDepends.h
+++ b/Source/cmComputeTargetDepends.h
@@ -20,7 +20,7 @@
 
 class cmComputeComponentGraph;
 class cmGlobalGenerator;
-class cmGeneratorTarget;
+class cmTarget;
 class cmTargetDependSet;
 
 /** \class cmComputeTargetDepends
@@ -38,23 +38,21 @@ public:
 
   bool Compute();
 
-  std::vector<cmGeneratorTarget const*> const&
+  std::vector<cmTarget const*> const&
   GetTargets() const { return this->Targets; }
-  void GetTargetDirectDepends(cmGeneratorTarget const* t,
-                              cmTargetDependSet& deps);
+  void GetTargetDirectDepends(cmTarget const* t, cmTargetDependSet& deps);
 private:
   void CollectTargets();
   void CollectDepends();
   void CollectTargetDepends(int depender_index);
   void AddTargetDepend(int depender_index, const char* dependee_name,
                        bool linking);
-  void AddTargetDepend(int depender_index, cmGeneratorTarget const* dependee,
+  void AddTargetDepend(int depender_index, cmTarget const* dependee,
                        bool linking);
   bool ComputeFinalDepends(cmComputeComponentGraph const& ccg);
   void AddInterfaceDepends(int depender_index, const char* dependee_name,
                            bool linking, std::set<cmStdString> &emitted);
-  void AddInterfaceDepends(int depender_index,
-                           cmGeneratorTarget const* dependee,
+  void AddInterfaceDepends(int depender_index, cmTarget const* dependee,
                            const char *config,
                            std::set<cmStdString> &emitted);
   cmGlobalGenerator* GlobalGenerator;
@@ -62,8 +60,8 @@ private:
   bool NoCycles;
 
   // Collect all targets.
-  std::vector<cmGeneratorTarget const*> Targets;
-  std::map<cmGeneratorTarget const*, int> TargetIndex;
+  std::vector<cmTarget const*> Targets;
+  std::map<cmTarget const*, int> TargetIndex;
 
   // Represent the target dependency graph.  The entry at each
   // top-level index corresponds to a depender whose dependencies are
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index cc449ce..f2f77ee 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -41,8 +41,7 @@ unsigned int cmCustomCommandGenerator::GetNumberOfCommands() const
 std::string cmCustomCommandGenerator::GetCommand(unsigned int c) const
 {
   std::string const& argv0 = this->CC.GetCommandLines()[c][0];
-  cmGeneratorTarget* target
-                    = this->Makefile->FindGeneratorTargetToUse(argv0.c_str());
+  cmTarget* target = this->Makefile->FindTargetToUse(argv0.c_str());
   if(target && target->GetType() == cmTarget::EXECUTABLE &&
      (target->IsImported() || !this->Makefile->IsOn("CMAKE_CROSSCOMPILING")))
     {
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index 9788e46..b669cd1 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -26,7 +26,6 @@ cmExportBuildFileGenerator::cmExportBuildFileGenerator()
 //----------------------------------------------------------------------------
 bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
 {
-  std::vector<cmGeneratorTarget*> allTargets;
   {
   std::string expectedTargets;
   std::string sep;
@@ -36,11 +35,10 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
         tei = targets.begin();
       tei != targets.end(); ++tei)
     {
-    cmGeneratorTarget *te = this->Makefile
-                                ->FindGeneratorTargetToUse(tei->c_str());
-    expectedTargets += sep + this->Namespace + te->Target->GetExportName();
+    cmTarget *te = this->Makefile->FindTargetToUse(tei->c_str());
+    expectedTargets += sep + this->Namespace + te->GetExportName();
     sep = " ";
-    if(this->ExportedTargets.insert(te->Target).second)
+    if(this->ExportedTargets.insert(te).second)
       {
       this->Exports.push_back(te);
       }
@@ -64,12 +62,11 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
   std::vector<std::string> missingTargets;
 
   // Create all the imported targets.
-  for(std::vector<cmGeneratorTarget*>::const_iterator
+  for(std::vector<cmTarget*>::const_iterator
         tei = this->Exports.begin();
       tei != this->Exports.end(); ++tei)
     {
-    cmGeneratorTarget* gte = *tei;
-    cmTarget* te = gte->Target;
+    cmTarget* te = *tei;
     this->GenerateImportTargetCode(os, te);
 
     te->AppendBuildInterfaceIncludes();
@@ -99,7 +96,7 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
                                     cmGeneratorExpression::BuildInterface,
                                     properties, missingTargets);
       }
-    this->PopulateCompatibleInterfaceProperties(gte, properties);
+    this->PopulateCompatibleInterfaceProperties(te, properties);
 
     this->GenerateInterfaceProperties(te, os, properties);
     }
@@ -124,12 +121,12 @@ cmExportBuildFileGenerator
                               const char* config, std::string const& suffix,
                             std::vector<std::string> &missingTargets)
 {
-  for(std::vector<cmGeneratorTarget*>::const_iterator
+  for(std::vector<cmTarget*>::const_iterator
         tei = this->Exports.begin();
       tei != this->Exports.end(); ++tei)
     {
     // Collect import properties for this target.
-    cmGeneratorTarget* target = *tei;
+    cmTarget* target = *tei;
     ImportPropertyMap properties;
 
     if (target->GetType() != cmTarget::INTERFACE_LIBRARY)
@@ -142,12 +139,10 @@ cmExportBuildFileGenerator
       if (target->GetType() != cmTarget::INTERFACE_LIBRARY)
         {
         this->SetImportDetailProperties(config, suffix,
-                                        target,
-                                        properties, missingTargets);
+                                        target, properties, missingTargets);
         this->SetImportLinkInterface(config, suffix,
                                     cmGeneratorExpression::BuildInterface,
-                                    target,
-                                    properties, missingTargets);
+                                    target, properties, missingTargets);
         }
 
       // TOOD: PUBLIC_HEADER_LOCATION
@@ -157,8 +152,7 @@ cmExportBuildFileGenerator
       //                              properties);
 
       // Generate code in the export file.
-      this->GenerateImportPropertyCode(os, config, target->Target,
-                                       properties);
+      this->GenerateImportPropertyCode(os, config, target, properties);
       }
     }
 }
@@ -173,18 +167,17 @@ void cmExportBuildFileGenerator::SetExportSet(cmExportSet *exportSet)
 void
 cmExportBuildFileGenerator
 ::SetImportLocationProperty(const char* config, std::string const& suffix,
-                            cmGeneratorTarget* target,
-                            ImportPropertyMap& properties)
+                            cmTarget* target, ImportPropertyMap& properties)
 {
   // Get the makefile in which to lookup target information.
-  cmMakefile* mf = target->Makefile;
+  cmMakefile* mf = target->GetMakefile();
 
   // Add the main target file.
   {
   std::string prop = "IMPORTED_LOCATION";
   prop += suffix;
   std::string value;
-  if(target->Target->IsAppBundleOnApple())
+  if(target->IsAppBundleOnApple())
     {
     value = target->GetFullPath(config, false);
     }
@@ -202,13 +195,13 @@ cmExportBuildFileGenerator
   // Add the import library for windows DLLs.
   if(dll_platform &&
      (target->GetType() == cmTarget::SHARED_LIBRARY ||
-      target->Target->IsExecutableWithExports()) &&
+      target->IsExecutableWithExports()) &&
      mf->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX"))
     {
     std::string prop = "IMPORTED_IMPLIB";
     prop += suffix;
     std::string value = target->GetFullPath(config, true);
-    target->Target->GetImplibGNUtoMS(value, value,
+    target->GetImplibGNUtoMS(value, value,
                              "${CMAKE_IMPORT_LIBRARY_SUFFIX}");
     properties[prop] = value;
     }
@@ -324,7 +317,7 @@ cmExportBuildFileGenerator
 }
 
 std::string
-cmExportBuildFileGenerator::InstallNameDir(cmGeneratorTarget* target,
+cmExportBuildFileGenerator::InstallNameDir(cmTarget* target,
                                            const std::string& config)
 {
   std::string install_name_dir;
diff --git a/Source/cmExportBuildFileGenerator.h b/Source/cmExportBuildFileGenerator.h
index 325d702..cea2099 100644
--- a/Source/cmExportBuildFileGenerator.h
+++ b/Source/cmExportBuildFileGenerator.h
@@ -68,18 +68,17 @@ protected:
   /** Fill in properties indicating built file locations.  */
   void SetImportLocationProperty(const char* config,
                                  std::string const& suffix,
-                                 cmGeneratorTarget* target,
+                                 cmTarget* target,
                                  ImportPropertyMap& properties);
 
-  std::string InstallNameDir(cmGeneratorTarget* target,
-                             const std::string& config);
+  std::string InstallNameDir(cmTarget* target, const std::string& config);
 
   std::vector<std::string>
   FindNamespaces(cmMakefile* mf, const std::string& name);
 
   std::vector<std::string> Targets;
   cmExportSet *ExportSet;
-  std::vector<cmGeneratorTarget*> Exports;
+  std::vector<cmTarget*> Exports;
   cmMakefile* Makefile;
   cmListFileBacktrace Backtrace;
 };
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 3cc56d7..13bff19 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -421,7 +421,7 @@ void getPropertyContents(cmTarget const* tgt, const char *prop,
 }
 
 //----------------------------------------------------------------------------
-void getCompatibleInterfaceProperties(cmGeneratorTarget *target,
+void getCompatibleInterfaceProperties(cmTarget *target,
                                       std::set<std::string> &ifaceProperties,
                                       const char *config)
 {
@@ -429,14 +429,11 @@ void getCompatibleInterfaceProperties(cmGeneratorTarget *target,
 
   if (!info)
     {
-    if (target->GetType() != cmTarget::INTERFACE_LIBRARY)
-      {
-      cmMakefile* mf = target->Target->GetMakefile();
-      cmOStringStream e;
-      e << "Exporting the target \"" << target->GetName() << "\" is not "
-          "allowed since its linker language cannot be determined";
-      mf->IssueMessage(cmake::FATAL_ERROR, e.str());
-      }
+    cmMakefile* mf = target->GetMakefile();
+    cmOStringStream e;
+    e << "Exporting the target \"" << target->GetName() << "\" is not "
+        "allowed since its linker language cannot be determined";
+    mf->IssueMessage(cmake::FATAL_ERROR, e.str());
     return;
     }
 
@@ -467,10 +464,9 @@ void getCompatibleInterfaceProperties(cmGeneratorTarget *target,
 
 //----------------------------------------------------------------------------
 void cmExportFileGenerator::PopulateCompatibleInterfaceProperties(
-                                cmGeneratorTarget *gtarget,
+                                cmTarget *target,
                                 ImportPropertyMap &properties)
 {
-  cmTarget *target = gtarget->Target;
   this->PopulateInterfaceProperty("COMPATIBLE_INTERFACE_BOOL",
                                 target, properties);
   this->PopulateInterfaceProperty("COMPATIBLE_INTERFACE_STRING",
@@ -491,7 +487,7 @@ void cmExportFileGenerator::PopulateCompatibleInterfaceProperties(
 
   if (target->GetType() != cmTarget::INTERFACE_LIBRARY)
     {
-    getCompatibleInterfaceProperties(gtarget, ifaceProperties, 0);
+    getCompatibleInterfaceProperties(target, ifaceProperties, 0);
 
     std::vector<std::string> configNames;
     target->GetMakefile()->GetConfigurations(configNames);
@@ -499,7 +495,7 @@ void cmExportFileGenerator::PopulateCompatibleInterfaceProperties(
     for (std::vector<std::string>::const_iterator ci = configNames.begin();
       ci != configNames.end(); ++ci)
       {
-      getCompatibleInterfaceProperties(gtarget, ifaceProperties, ci->c_str());
+      getCompatibleInterfaceProperties(target, ifaceProperties, ci->c_str());
       }
     }
 
@@ -690,13 +686,12 @@ void
 cmExportFileGenerator
 ::SetImportLinkInterface(const char* config, std::string const& suffix,
                     cmGeneratorExpression::PreprocessContext preprocessRule,
-                    cmGeneratorTarget* target, ImportPropertyMap& properties,
+                    cmTarget* target, ImportPropertyMap& properties,
                     std::vector<std::string>& missingTargets)
 {
   // Add the transitive link dependencies for this configuration.
-  cmGeneratorTarget::LinkInterface const* iface = target->GetLinkInterface(
-                                                              config,
-                                                              target->Target);
+  cmTarget::LinkInterface const* iface = target->GetLinkInterface(config,
+                                                                  target);
   if (!iface)
     {
     return;
@@ -729,14 +724,12 @@ cmExportFileGenerator
     }
 
   const bool newCMP0022Behavior =
-                        target->Target
-                              ->GetPolicyStatusCMP0022() != cmPolicies::WARN
-                     && target->Target
-                              ->GetPolicyStatusCMP0022() != cmPolicies::OLD;
+                        target->GetPolicyStatusCMP0022() != cmPolicies::WARN
+                     && target->GetPolicyStatusCMP0022() != cmPolicies::OLD;
 
   if(newCMP0022Behavior && !this->ExportOld)
     {
-    cmMakefile *mf = target->Target->GetMakefile();
+    cmMakefile *mf = target->GetMakefile();
     cmOStringStream e;
     e << "Target \"" << target->GetName() << "\" has policy CMP0022 enabled, "
          "but also has old-style LINK_INTERFACE_LIBRARIES properties "
@@ -756,7 +749,7 @@ cmExportFileGenerator
                                                          preprocessRule);
   if (!prepro.empty())
     {
-    this->ResolveTargetsInGeneratorExpressions(prepro, target->Target,
+    this->ResolveTargetsInGeneratorExpressions(prepro, target,
                                                missingTargets,
                                                ReplaceFreeTargets);
     properties["IMPORTED_LINK_INTERFACE_LIBRARIES" + suffix] = prepro;
@@ -767,13 +760,12 @@ cmExportFileGenerator
 void
 cmExportFileGenerator
 ::SetImportDetailProperties(const char* config, std::string const& suffix,
-                            cmGeneratorTarget* target,
-                            ImportPropertyMap& properties,
+                            cmTarget* target, ImportPropertyMap& properties,
                             std::vector<std::string>& missingTargets
                            )
 {
   // Get the makefile in which to lookup target information.
-  cmMakefile* mf = target->Makefile;
+  cmMakefile* mf = target->GetMakefile();
 
   // Add the soname for unix shared libraries.
   if(target->GetType() == cmTarget::SHARED_LIBRARY ||
@@ -806,8 +798,8 @@ cmExportFileGenerator
     }
 
   // Add the transitive link dependencies for this configuration.
-  if(cmGeneratorTarget::LinkInterface const* iface =
-                            target->GetLinkInterface(config, target->Target))
+  if(cmTarget::LinkInterface const* iface = target->GetLinkInterface(config,
+                                                                     target))
     {
     this->SetImportLinkProperty(suffix, target,
                                 "IMPORTED_LINK_INTERFACE_LANGUAGES",
@@ -832,7 +824,7 @@ cmExportFileGenerator
 void
 cmExportFileGenerator
 ::SetImportLinkProperty(std::string const& suffix,
-                        cmGeneratorTarget* target,
+                        cmTarget* target,
                         const char* propName,
                         std::vector<std::string> const& entries,
                         ImportPropertyMap& properties,
@@ -856,7 +848,7 @@ cmExportFileGenerator
     sep = ";";
 
     std::string temp = *li;
-    this->AddTargetNamespace(temp, target->Target, missingTargets);
+    this->AddTargetNamespace(temp, target, missingTargets);
     link_entries += temp;
     }
 
diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h
index 966f6d3..1438f4d 100644
--- a/Source/cmExportFileGenerator.h
+++ b/Source/cmExportFileGenerator.h
@@ -77,12 +77,11 @@ protected:
   // Collect properties with detailed information about targets beyond
   // their location on disk.
   void SetImportDetailProperties(const char* config,
-                                 std::string const& suffix,
-                                 cmGeneratorTarget* target,
+                                 std::string const& suffix, cmTarget* target,
                                  ImportPropertyMap& properties,
                                  std::vector<std::string>& missingTargets);
   void SetImportLinkProperty(std::string const& suffix,
-                             cmGeneratorTarget* target, const char* propName,
+                             cmTarget* target, const char* propName,
                              std::vector<std::string> const& entries,
                              ImportPropertyMap& properties,
                              std::vector<std::string>& missingTargets);
@@ -114,7 +113,7 @@ protected:
                                  std::vector<std::string> &missingTargets);
   void PopulateInterfaceProperty(const char *propName, cmTarget *target,
                                  ImportPropertyMap &properties);
-  void PopulateCompatibleInterfaceProperties(cmGeneratorTarget *target,
+  void PopulateCompatibleInterfaceProperties(cmTarget *target,
                                  ImportPropertyMap &properties);
   void GenerateInterfaceProperties(cmTarget const* target, std::ostream& os,
                                    const ImportPropertyMap &properties);
@@ -126,7 +125,7 @@ protected:
 
   void SetImportLinkInterface(const char* config, std::string const& suffix,
                     cmGeneratorExpression::PreprocessContext preprocessRule,
-                    cmGeneratorTarget* target, ImportPropertyMap& properties,
+                    cmTarget* target, ImportPropertyMap& properties,
                     std::vector<std::string>& missingTargets);
 
   enum FreeTargetsReplace {
@@ -176,7 +175,7 @@ private:
 
   virtual void ReplaceInstallPrefix(std::string &input);
 
-  virtual std::string InstallNameDir(cmGeneratorTarget* target,
+  virtual std::string InstallNameDir(cmTarget* target,
                                      const std::string& config) = 0;
 };
 
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index 674d034..73e9b31 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -169,11 +169,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
       }
     this->PopulateInterfaceProperty("INTERFACE_POSITION_INDEPENDENT_CODE",
                                   te, properties);
-    cmGeneratorTarget *gtgt = te->GetMakefile()->GetLocalGenerator()
-                                ->GetGlobalGenerator()
-                                ->GetGeneratorTarget(te);
-
-    this->PopulateCompatibleInterfaceProperties(gtgt, properties);
+    this->PopulateCompatibleInterfaceProperties(te, properties);
 
     this->GenerateInterfaceProperties(te, os, properties);
     }
@@ -335,14 +331,12 @@ cmExportInstallFileGenerator
     if(!properties.empty())
       {
       // Get the rest of the target details.
-      cmGeneratorTarget *gtgt = te->Target->GetMakefile()->GetLocalGenerator()
-                    ->GetGlobalGenerator()->GetGeneratorTarget(te->Target);
       this->SetImportDetailProperties(config, suffix,
-                                      gtgt, properties, missingTargets);
+                                      te->Target, properties, missingTargets);
 
       this->SetImportLinkInterface(config, suffix,
                                    cmGeneratorExpression::InstallInterface,
-                                   gtgt, properties, missingTargets);
+                                   te->Target, properties, missingTargets);
 
       // TOOD: PUBLIC_HEADER_LOCATION
       // This should wait until the build feature propagation stuff
@@ -540,7 +534,7 @@ cmExportInstallFileGenerator
 }
 
 std::string
-cmExportInstallFileGenerator::InstallNameDir(cmGeneratorTarget* target,
+cmExportInstallFileGenerator::InstallNameDir(cmTarget* target,
                                              const std::string&)
 {
   std::string install_name_dir;
diff --git a/Source/cmExportInstallFileGenerator.h b/Source/cmExportInstallFileGenerator.h
index a67c726..7c634a4 100644
--- a/Source/cmExportInstallFileGenerator.h
+++ b/Source/cmExportInstallFileGenerator.h
@@ -85,8 +85,7 @@ protected:
 
   void ComplainAboutImportPrefix(cmInstallTargetGenerator* itgen);
 
-  std::string InstallNameDir(cmGeneratorTarget* target,
-                             const std::string& config);
+  std::string InstallNameDir(cmTarget* target, const std::string& config);
 
   cmInstallExportGenerator* IEGen;
 
diff --git a/Source/cmExportLibraryDependencies.cxx b/Source/cmExportLibraryDependencies.cxx
new file mode 100644
index 0000000..4624e92
--- /dev/null
+++ b/Source/cmExportLibraryDependencies.cxx
@@ -0,0 +1,208 @@
+/*============================================================================
+  CMake - Cross Platform Makefile Generator
+  Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
+
+  Distributed under the OSI-approved BSD License (the "License");
+  see accompanying file Copyright.txt for details.
+
+  This software is distributed WITHOUT ANY WARRANTY; without even the
+  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+  See the License for more information.
+============================================================================*/
+#include "cmExportLibraryDependencies.h"
+#include "cmGlobalGenerator.h"
+#include "cmLocalGenerator.h"
+#include "cmGeneratedFileStream.h"
+#include "cmake.h"
+#include "cmVersion.h"
+
+#include <cmsys/auto_ptr.hxx>
+
+bool cmExportLibraryDependenciesCommand
+::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &)
+{
+  if(this->Disallowed(cmPolicies::CMP0033,
+      "The export_library_dependencies command should not be called; "
+      "see CMP0033."))
+    { return true; }
+  if(args.size() < 1 )
+    {
+    this->SetError("called with incorrect number of arguments");
+    return false;
+    }
+
+  // store the arguments for the final pass
+  this->Filename = args[0];
+  this->Append = false;
+  if(args.size() > 1)
+    {
+    if(args[1] == "APPEND")
+      {
+      this->Append = true;
+      }
+    }
+  return true;
+}
+
+
+void cmExportLibraryDependenciesCommand::FinalPass()
+{
+  // export_library_dependencies() shouldn't modify anything
+  // ensure this by calling a const method
+  this->ConstFinalPass();
+}
+
+void cmExportLibraryDependenciesCommand::ConstFinalPass() const
+{
+  // Use copy-if-different if not appending.
+  cmsys::auto_ptr<cmsys::ofstream> foutPtr;
+  if(this->Append)
+    {
+    cmsys::auto_ptr<cmsys::ofstream> ap(
+      new cmsys::ofstream(this->Filename.c_str(), std::ios::app));
+    foutPtr = ap;
+    }
+  else
+    {
+    cmsys::auto_ptr<cmGeneratedFileStream> ap(
+      new cmGeneratedFileStream(this->Filename.c_str(), true));
+    ap->SetCopyIfDifferent(true);
+    foutPtr = ap;
+    }
+  std::ostream& fout = *foutPtr.get();
+
+  if (!fout)
+    {
+    cmSystemTools::Error("Error Writing ", this->Filename.c_str());
+    cmSystemTools::ReportLastSystemError("");
+    return;
+    }
+
+  // Collect dependency information about all library targets built in
+  // the project.
+  cmake* cm = this->Makefile->GetCMakeInstance();
+  cmGlobalGenerator* global = cm->GetGlobalGenerator();
+  const std::vector<cmLocalGenerator *>& locals = global->GetLocalGenerators();
+  std::map<cmStdString, cmStdString> libDepsOld;
+  std::map<cmStdString, cmStdString> libDepsNew;
+  std::map<cmStdString, cmStdString> libTypes;
+  for(std::vector<cmLocalGenerator *>::const_iterator i = locals.begin();
+      i != locals.end(); ++i)
+    {
+    const cmLocalGenerator* gen = *i;
+    const cmTargets &tgts = gen->GetMakefile()->GetTargets();
+    for(cmTargets::const_iterator l = tgts.begin();
+        l != tgts.end(); ++l)
+      {
+      // Get the current target.
+      cmTarget const& target = l->second;
+
+      // Skip non-library targets.
+      if(target.GetType() < cmTarget::STATIC_LIBRARY
+         || target.GetType() > cmTarget::MODULE_LIBRARY)
+        {
+        continue;
+        }
+
+      // Construct the dependency variable name.
+      std::string targetEntry = target.GetName();
+      targetEntry += "_LIB_DEPENDS";
+
+      // Construct the dependency variable value.  It is safe to use
+      // the target GetLinkLibraries method here because this code is
+      // called at the end of configure but before generate so library
+      // dependencies have yet to be analyzed.  Therefore the value
+      // will be the direct link dependencies.
+      std::string valueOld;
+      std::string valueNew;
+      cmTarget::LinkLibraryVectorType const& libs = target.GetLinkLibraries();
+      for(cmTarget::LinkLibraryVectorType::const_iterator li = libs.begin();
+          li != libs.end(); ++li)
+        {
+        std::string ltVar = li->first;
+        ltVar += "_LINK_TYPE";
+        std::string ltValue;
+        switch(li->second)
+          {
+          case cmTarget::GENERAL:
+            valueNew += "general;";
+            ltValue = "general";
+            break;
+          case cmTarget::DEBUG:
+            valueNew += "debug;";
+            ltValue = "debug";
+            break;
+          case cmTarget::OPTIMIZED:
+            valueNew += "optimized;";
+            ltValue = "optimized";
+            break;
+          }
+        std::string lib = li->first;
+        if(cmTarget* libtgt = global->FindTarget(0, lib.c_str()))
+          {
+          // Handle simple output name changes.  This command is
+          // deprecated so we do not support full target name
+          // translation (which requires per-configuration info).
+          if(const char* outname = libtgt->GetProperty("OUTPUT_NAME"))
+            {
+            lib = outname;
+            }
+          }
+        valueOld += lib;
+        valueOld += ";";
+        valueNew += lib;
+        valueNew += ";";
+
+        std::string& ltEntry = libTypes[ltVar];
+        if(ltEntry.empty())
+          {
+          ltEntry = ltValue;
+          }
+        else if(ltEntry != ltValue)
+          {
+          ltEntry = "general";
+          }
+        }
+      libDepsNew[targetEntry] = valueNew;
+      libDepsOld[targetEntry] = valueOld;
+      }
+    }
+
+  // Generate dependency information for both old and new style CMake
+  // versions.
+  const char* vertest =
+    "\"${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}\" GREATER 2.4";
+  fout << "# Generated by CMake " <<  cmVersion::GetCMakeVersion() << "\n\n";
+  fout << "if(" << vertest << ")\n";
+  fout << "  # Information for CMake 2.6 and above.\n";
+  for(std::map<cmStdString, cmStdString>::const_iterator
+        i = libDepsNew.begin();
+      i != libDepsNew.end(); ++i)
+    {
+    if(!i->second.empty())
+      {
+      fout << "  set(\"" << i->first << "\" \"" << i->second << "\")\n";
+      }
+    }
+  fout << "else()\n";
+  fout << "  # Information for CMake 2.4 and lower.\n";
+  for(std::map<cmStdString, cmStdString>::const_iterator
+        i = libDepsOld.begin();
+      i != libDepsOld.end(); ++i)
+    {
+    if(!i->second.empty())
+      {
+      fout << "  set(\"" << i->first << "\" \"" << i->second << "\")\n";
+      }
+    }
+  for(std::map<cmStdString, cmStdString>::const_iterator i = libTypes.begin();
+      i != libTypes.end(); ++i)
+    {
+    if(i->second != "general")
+      {
+      fout << "  set(\"" << i->first << "\" \"" << i->second << "\")\n";
+      }
+    }
+  fout << "endif()\n";
+  return;
+}
diff --git a/Source/cmExportLibraryDependencies.h b/Source/cmExportLibraryDependencies.h
new file mode 100644
index 0000000..29b568f
--- /dev/null
+++ b/Source/cmExportLibraryDependencies.h
@@ -0,0 +1,37 @@
+/*============================================================================
+  CMake - Cross Platform Makefile Generator
+  Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
+
+  Distributed under the OSI-approved BSD License (the "License");
+  see accompanying file Copyright.txt for details.
+
+  This software is distributed WITHOUT ANY WARRANTY; without even the
+  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+  See the License for more information.
+============================================================================*/
+#ifndef cmExportLibraryDependenciesCommand_h
+#define cmExportLibraryDependenciesCommand_h
+
+#include "cmCommand.h"
+
+class cmExportLibraryDependenciesCommand : public cmCommand
+{
+public:
+  cmTypeMacro(cmExportLibraryDependenciesCommand, cmCommand);
+  virtual cmCommand* Clone() { return new cmExportLibraryDependenciesCommand; }
+  virtual bool InitialPass(std::vector<std::string> const& args,
+                           cmExecutionStatus &status);
+  virtual const char* GetName() const { return "export_library_dependencies";}
+  virtual bool IsDiscouraged() const { return true; }
+
+  virtual void FinalPass();
+  virtual bool HasFinalPass() const { return true; }
+
+private:
+  std::string Filename;
+  bool Append;
+  void ConstFinalPass() const;
+};
+
+
+#endif
diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx
index a748e44..8d37b62 100644
--- a/Source/cmExportTryCompileFileGenerator.cxx
+++ b/Source/cmExportTryCompileFileGenerator.cxx
@@ -119,7 +119,7 @@ cmExportTryCompileFileGenerator::PopulateProperties(cmTarget const* target,
     }
 }
 std::string
-cmExportTryCompileFileGenerator::InstallNameDir(cmGeneratorTarget* target,
+cmExportTryCompileFileGenerator::InstallNameDir(cmTarget* target,
                                                 const std::string& config)
 {
   std::string install_name_dir;
diff --git a/Source/cmExportTryCompileFileGenerator.h b/Source/cmExportTryCompileFileGenerator.h
index 41e8d83..71ac0dd 100644
--- a/Source/cmExportTryCompileFileGenerator.h
+++ b/Source/cmExportTryCompileFileGenerator.h
@@ -43,7 +43,7 @@ protected:
                           ImportPropertyMap& properties,
                           std::set<cmTarget const*> &emitted);
 
-  std::string InstallNameDir(cmGeneratorTarget* target,
+  std::string InstallNameDir(cmTarget* target,
                              const std::string& config);
 private:
   std::string FindTargets(const char *prop, cmTarget const* tgt,
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index 37883bb..a066153 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -580,9 +580,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
       }
     else
       {
-      cmGeneratorTarget *gtgt
-        = target->GetMakefile()->FindGeneratorTargetToUse(target->GetName());
-      location = gtgt->GetLocation(buildType);
+      location = target->GetLocation(buildType);
       }
 
     fout<<"         <Option output=\"" << location
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 5654b41..1feb03a 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -16,9 +16,6 @@
 #include "cmGeneratorExpressionDAGChecker.h"
 #include "cmGeneratorExpression.h"
 
-#include "cmLocalGenerator.h"
-#include "cmGlobalGenerator.h"
-
 #include <cmsys/String.h>
 
 #include <assert.h>
@@ -976,11 +973,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
             "link libraries for a static library");
         return std::string();
         }
-
-      cmGeneratorTarget *gtgt = target->GetMakefile()->GetLocalGenerator()
-                                      ->GetGlobalGenerator()
-                                      ->GetGeneratorTarget(target);
-      const char *lang = gtgt->GetLinkerLanguage(context->Config);
+      const char *lang = target->GetLinkerLanguage(context->Config);
       return lang ? lang : "";
       }
 
@@ -1065,10 +1058,6 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
     cmTarget const* headTarget = context->HeadTarget
                                ? context->HeadTarget : target;
 
-    cmGeneratorTarget *gtgt = target->GetMakefile()->GetLocalGenerator()
-                                    ->GetGlobalGenerator()
-                                    ->GetGeneratorTarget(target);
-
     const char * const *transBegin =
                         cmArrayBegin(targetPropertyTransitiveWhitelist) + 1;
     const char * const *transEnd =
@@ -1079,7 +1068,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
       {
 
       std::vector<std::string> libs;
-      gtgt->GetTransitivePropertyLinkLibraries(context->Config,
+      target->GetTransitivePropertyLinkLibraries(context->Config,
                                                  headTarget, libs);
       if (!libs.empty())
         {
@@ -1093,8 +1082,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
     else if (std::find_if(transBegin, transEnd,
                           cmStrCmp(interfacePropertyName)) != transEnd)
       {
-      const cmGeneratorTarget::LinkImplementation *impl =
-                                                  gtgt->GetLinkImplementation(
+      const cmTarget::LinkImplementation *impl = target->GetLinkImplementation(
                                                     context->Config,
                                                     headTarget);
       if(impl)
@@ -1117,40 +1105,40 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
         {
         return linkedTargetsContent;
         }
-      if (gtgt->IsLinkInterfaceDependentBoolProperty(propertyName,
+      if (target->IsLinkInterfaceDependentBoolProperty(propertyName,
                                                        context->Config))
         {
         context->HadContextSensitiveCondition = true;
-        return gtgt->GetLinkInterfaceDependentBoolProperty(
+        return target->GetLinkInterfaceDependentBoolProperty(
                                                 propertyName,
                                                 context->Config) ? "1" : "0";
         }
-      if (gtgt->IsLinkInterfaceDependentStringProperty(propertyName,
+      if (target->IsLinkInterfaceDependentStringProperty(propertyName,
                                                          context->Config))
         {
         context->HadContextSensitiveCondition = true;
         const char *propContent =
-                              gtgt->GetLinkInterfaceDependentStringProperty(
+                              target->GetLinkInterfaceDependentStringProperty(
                                                 propertyName,
                                                 context->Config);
         return propContent ? propContent : "";
         }
-      if (gtgt->IsLinkInterfaceDependentNumberMinProperty(propertyName,
+      if (target->IsLinkInterfaceDependentNumberMinProperty(propertyName,
                                                          context->Config))
         {
         context->HadContextSensitiveCondition = true;
         const char *propContent =
-                          gtgt->GetLinkInterfaceDependentNumberMinProperty(
+                          target->GetLinkInterfaceDependentNumberMinProperty(
                                                 propertyName,
                                                 context->Config);
         return propContent ? propContent : "";
         }
-      if (gtgt->IsLinkInterfaceDependentNumberMaxProperty(propertyName,
+      if (target->IsLinkInterfaceDependentNumberMaxProperty(propertyName,
                                                          context->Config))
         {
         context->HadContextSensitiveCondition = true;
         const char *propContent =
-                          gtgt->GetLinkInterfaceDependentNumberMaxProperty(
+                          target->GetLinkInterfaceDependentNumberMaxProperty(
                                                 propertyName,
                                                 context->Config);
         return propContent ? propContent : "";
@@ -1159,25 +1147,25 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
       return linkedTargetsContent;
       }
 
-    if (!gtgt->IsImported()
+    if (!target->IsImported()
         && dagCheckerParent && !dagCheckerParent->EvaluatingLinkLibraries())
       {
-      if (gtgt->IsLinkInterfaceDependentNumberMinProperty(propertyName,
+      if (target->IsLinkInterfaceDependentNumberMinProperty(propertyName,
                                                         context->Config))
         {
         context->HadContextSensitiveCondition = true;
         const char *propContent =
-                            gtgt->GetLinkInterfaceDependentNumberMinProperty(
+                            target->GetLinkInterfaceDependentNumberMinProperty(
                                                 propertyName,
                                                 context->Config);
         return propContent ? propContent : "";
         }
-      if (gtgt->IsLinkInterfaceDependentNumberMaxProperty(propertyName,
+      if (target->IsLinkInterfaceDependentNumberMaxProperty(propertyName,
                                                         context->Config))
         {
         context->HadContextSensitiveCondition = true;
         const char *propContent =
-                            gtgt->GetLinkInterfaceDependentNumberMaxProperty(
+                            target->GetLinkInterfaceDependentNumberMaxProperty(
                                                 propertyName,
                                                 context->Config);
         return propContent ? propContent : "";
@@ -1366,7 +1354,7 @@ static const struct InstallPrefixNode : public cmGeneratorExpressionNode
 template<bool linker, bool soname>
 struct TargetFilesystemArtifactResultCreator
 {
-  static std::string Create(cmGeneratorTarget* target,
+  static std::string Create(cmTarget* target,
                             cmGeneratorExpressionContext *context,
                             const GeneratorExpressionContent *content);
 };
@@ -1375,12 +1363,12 @@ struct TargetFilesystemArtifactResultCreator
 template<>
 struct TargetFilesystemArtifactResultCreator<false, true>
 {
-  static std::string Create(cmGeneratorTarget* target,
+  static std::string Create(cmTarget* target,
                             cmGeneratorExpressionContext *context,
                             const GeneratorExpressionContent *content)
   {
     // The target soname file (.so.1).
-    if(target->Target->IsDLLPlatform())
+    if(target->IsDLLPlatform())
       {
       ::reportError(context, content->GetOriginalExpression(),
                     "TARGET_SONAME_FILE is not allowed "
@@ -1394,7 +1382,7 @@ struct TargetFilesystemArtifactResultCreator<false, true>
                     "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;
@@ -1405,12 +1393,12 @@ struct TargetFilesystemArtifactResultCreator<false, true>
 template<>
 struct TargetFilesystemArtifactResultCreator<true, false>
 {
-  static std::string Create(cmGeneratorTarget* target,
+  static std::string Create(cmTarget* target,
                             cmGeneratorExpressionContext *context,
                             const GeneratorExpressionContent *content)
   {
     // The file used to link to the target (.so, .lib, .a).
-    if(!target->Target->IsLinkable())
+    if(!target->IsLinkable())
       {
       ::reportError(context, content->GetOriginalExpression(),
                     "TARGET_LINKER_FILE is allowed only for libraries and "
@@ -1418,7 +1406,7 @@ struct TargetFilesystemArtifactResultCreator<true, false>
       return std::string();
       }
     return target->GetFullPath(context->Config,
-                               target->Target->HasImportLibrary());
+                               target->HasImportLibrary());
   }
 };
 
@@ -1426,7 +1414,7 @@ struct TargetFilesystemArtifactResultCreator<true, false>
 template<>
 struct TargetFilesystemArtifactResultCreator<false, false>
 {
-  static std::string Create(cmGeneratorTarget* target,
+  static std::string Create(cmTarget* target,
                             cmGeneratorExpressionContext *context,
                             const GeneratorExpressionContent *)
   {
@@ -1488,8 +1476,7 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode
                     "Expression syntax not recognized.");
       return std::string();
       }
-    cmGeneratorTarget* target
-                  = context->Makefile->FindGeneratorTargetToUse(name.c_str());
+    cmTarget* target = context->Makefile->FindTargetToUse(name.c_str());
     if(!target)
       {
       ::reportError(context, content->GetOriginalExpression(),
@@ -1510,8 +1497,8 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode
                     "be used while evaluating link libraries");
       return std::string();
       }
-    context->DependTargets.insert(target->Target);
-    context->AllTargets.insert(target->Target);
+    context->DependTargets.insert(target);
+    context->AllTargets.insert(target);
 
     std::string result =
                 TargetFilesystemArtifactResultCreator<linker, soname>::Create(
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index d0d97dc..5cd1f42 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -14,7 +14,6 @@
 #include "cmTarget.h"
 #include "cmMakefile.h"
 #include "cmLocalGenerator.h"
-#include "cmComputeLinkInformation.h"
 #include "cmGlobalGenerator.h"
 #include "cmSourceFile.h"
 #include "cmGeneratorExpression.h"
@@ -22,31 +21,6 @@
 #include "cmComputeLinkInformation.h"
 
 #include <queue>
-#include <assert.h>
-#include <errno.h>
-
-//----------------------------------------------------------------------------
-cmTargetLinkInformationMap
-::cmTargetLinkInformationMap(cmTargetLinkInformationMap const& r): derived()
-{
-  // Ideally cmTarget instances should never be copied.  However until
-  // we can make a sweep to remove that, this copy constructor avoids
-  // allowing the resources (LinkInformation) from getting copied.  In
-  // the worst case this will lead to extra cmComputeLinkInformation
-  // instances.  We also enforce in debug mode that the map be emptied
-  // when copied.
-  static_cast<void>(r);
-  assert(r.empty());
-}
-
-//----------------------------------------------------------------------------
-cmTargetLinkInformationMap::~cmTargetLinkInformationMap()
-{
-  for(derived::iterator i = this->begin(); i != this->end(); ++i)
-    {
-    delete i->second;
-    }
-}
 
 #include "assert.h"
 
@@ -56,49 +30,6 @@ cmGeneratorTarget::cmGeneratorTarget(cmTarget* t): Target(t)
   this->Makefile = this->Target->GetMakefile();
   this->LocalGenerator = this->Makefile->GetLocalGenerator();
   this->GlobalGenerator = this->LocalGenerator->GetGlobalGenerator();
-
-  this->DebugIncludesDone = false;
-  this->PolicyWarnedCMP0022 = false;
-}
-
-//----------------------------------------------------------------------------
-void deleteAndClear2(
-      std::vector<cmGeneratorTarget::TargetPropertyEntry*> &entries)
-{
-  for (std::vector<cmGeneratorTarget::TargetPropertyEntry*>::const_iterator
-      it = entries.begin(),
-      end = entries.end();
-      it != end; ++it)
-    {
-      delete *it;
-    }
-  entries.clear();
-}
-
-//----------------------------------------------------------------------------
-void deleteAndClear2(
-  std::map<std::string,
-          std::vector<cmGeneratorTarget::TargetPropertyEntry*> > &entries)
-{
-  for (std::map<std::string,
-          std::vector<cmGeneratorTarget::TargetPropertyEntry*> >::iterator
-        it = entries.begin(), end = entries.end(); it != end; ++it)
-    {
-    deleteAndClear2(it->second);
-    }
-}
-
-cmGeneratorTarget::~cmGeneratorTarget()
-{
-  deleteAndClear2(this->CachedLinkInterfaceIncludeDirectoriesEntries);
-
-  for (cmTargetLinkInformationMap::const_iterator it
-      = this->LinkInformation.begin();
-      it != this->LinkInformation.end(); ++it)
-    {
-    delete it->second;
-    }
-  this->LinkInformation.clear();
 }
 
 //----------------------------------------------------------------------------
@@ -250,60 +181,6 @@ cmGeneratorTarget::GetExternalObjects(std::vector<cmSourceFile*>& srcs) const
 }
 
 //----------------------------------------------------------------------------
-const char* cmGeneratorTarget::GetLocation(const char* config) const
-{
-  if (this->Target->IsImported())
-    {
-    return this->Target->ImportedGetLocation(config);
-    }
-  else
-    {
-    return this->NormalGetLocation(config);
-    }
-}
-
-bool cmGeneratorTarget::IsImported() const
-{
-  return this->Target->IsImported();
-}
-
-//----------------------------------------------------------------------------
-const char* cmGeneratorTarget::NormalGetLocation(const char* config) const
-{
-  // Handle the configuration-specific case first.
-  static std::string location;
-  if(config)
-    {
-    location = this->GetFullPath(config, false);
-    return location.c_str();
-    }
-
-  // Now handle the deprecated build-time configuration location.
-  location = this->Target->GetDirectory();
-  const char* cfgid = this->Makefile->GetDefinition("CMAKE_CFG_INTDIR");
-  if(cfgid && strcmp(cfgid, ".") != 0)
-    {
-    location += "/";
-    location += cfgid;
-    }
-
-  if(this->Target->IsAppBundleOnApple())
-    {
-    std::string macdir = this->BuildMacContentDirectory("",
-                                                        config,
-                                                        false);
-    if(!macdir.empty())
-      {
-      location += "/";
-      location += macdir;
-      }
-    }
-  location += "/";
-  location += this->GetFullName(config, false);
-  return location.c_str();
-}
-
-//----------------------------------------------------------------------------
 bool cmGeneratorTarget::IsSystemIncludeDirectory(const char *dir,
                                                  const char *config) const
 {
@@ -320,8 +197,8 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(const char *dir,
 
   if (iter == this->SystemIncludesCache.end())
     {
-    LinkImplementation const* impl
-                          = this->GetLinkImplementation(config, this->Target);
+    cmTarget::LinkImplementation const* impl
+                  = this->Target->GetLinkImplementation(config, this->Target);
     if(!impl)
       {
       return false;
@@ -353,10 +230,9 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(const char *dir,
       {
       if (uniqueDeps.insert(*li).second)
         {
-        cmGeneratorTarget* gtgt
-                      = this->Makefile->FindGeneratorTargetToUse(li->c_str());
+        cmTarget* tgt = this->Makefile->FindTargetToUse(li->c_str());
 
-        if (!gtgt)
+        if (!tgt)
           {
           continue;
           }
@@ -365,7 +241,7 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(const char *dir,
                                 &dagChecker, result, excludeImported);
 
         std::vector<std::string> deps;
-        gtgt->GetTransitivePropertyLinkLibraries(config, this->Target, deps);
+        tgt->GetTransitivePropertyLinkLibraries(config, this->Target, deps);
 
         for(std::vector<std::string>::const_iterator di = deps.begin();
             di != deps.end(); ++di)
@@ -414,695 +290,6 @@ void cmGeneratorTarget::GetSourceFiles(std::vector<cmSourceFile*> &files) const
 }
 
 //----------------------------------------------------------------------------
-bool cmGeneratorTarget::HasSOName(const char* config) const
-{
-  // soname is supported only for shared libraries and modules,
-  // and then only when the platform supports an soname flag.
-  return ((this->GetType() == cmTarget::SHARED_LIBRARY ||
-           this->GetType() == cmTarget::MODULE_LIBRARY) &&
-          !this->GetPropertyAsBool("NO_SONAME") &&
-          this->Makefile->GetSONameFlag(this->GetLinkerLanguage(config,
-                                                              this->Target)));
-}
-
-//----------------------------------------------------------------------------
-bool cmGeneratorTarget::NeedRelinkBeforeInstall(const char* config) const
-{
-  // Only executables and shared libraries can have an rpath and may
-  // need relinking.
-  if(this->GetType() != cmTarget::EXECUTABLE &&
-     this->GetType() != cmTarget::SHARED_LIBRARY &&
-     this->GetType() != cmTarget::MODULE_LIBRARY)
-    {
-    return false;
-    }
-
-  // If there is no install location this target will not be installed
-  // and therefore does not need relinking.
-  if(!this->Target->GetHaveInstallRule())
-    {
-    return false;
-    }
-
-  // If skipping all rpaths completely then no relinking is needed.
-  if(this->Makefile->IsOn("CMAKE_SKIP_RPATH"))
-    {
-    return false;
-    }
-
-  // If building with the install-tree rpath no relinking is needed.
-  if(this->GetPropertyAsBool("BUILD_WITH_INSTALL_RPATH"))
-    {
-    return false;
-    }
-
-  // If chrpath is going to be used no relinking is needed.
-  if(this->IsChrpathUsed(config))
-    {
-    return false;
-    }
-
-  // Check for rpath support on this platform.
-  if(const char* ll = this->GetLinkerLanguage(config, this->Target))
-    {
-    std::string flagVar = "CMAKE_SHARED_LIBRARY_RUNTIME_";
-    flagVar += ll;
-    flagVar += "_FLAG";
-    if(!this->Makefile->IsSet(flagVar.c_str()))
-      {
-      // There is no rpath support on this platform so nothing needs
-      // relinking.
-      return false;
-      }
-    }
-  else
-    {
-    // No linker language is known.  This error will be reported by
-    // other code.
-    return false;
-    }
-
-  // If either a build or install tree rpath is set then the rpath
-  // will likely change between the build tree and install tree and
-  // this target must be relinked.
-  return this->HaveBuildTreeRPATH(config)
-      || this->HaveInstallTreeRPATH();
-}
-
-//----------------------------------------------------------------------------
-bool cmGeneratorTarget::IsChrpathUsed(const char* config) const
-{
-  // Only certain target types have an rpath.
-  if(!(this->GetType() == cmTarget::SHARED_LIBRARY ||
-       this->GetType() == cmTarget::MODULE_LIBRARY ||
-       this->GetType() == cmTarget::EXECUTABLE))
-    {
-    return false;
-    }
-
-  // If the target will not be installed we do not need to change its
-  // rpath.
-  if(!this->Target->GetHaveInstallRule())
-    {
-    return false;
-    }
-
-  // Skip chrpath if skipping rpath altogether.
-  if(this->Makefile->IsOn("CMAKE_SKIP_RPATH"))
-    {
-    return false;
-    }
-
-  // Skip chrpath if it does not need to be changed at install time.
-  if(this->GetPropertyAsBool("BUILD_WITH_INSTALL_RPATH"))
-    {
-    return false;
-    }
-
-  // Allow the user to disable builtin chrpath explicitly.
-  if(this->Makefile->IsOn("CMAKE_NO_BUILTIN_CHRPATH"))
-    {
-    return false;
-    }
-
-  if(this->Makefile->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME"))
-    {
-    return true;
-    }
-
-#if defined(CMAKE_USE_ELF_PARSER)
-  // Enable if the rpath flag uses a separator and the target uses ELF
-  // binaries.
-  if(const char* ll = this->GetLinkerLanguage(config, this->Target))
-    {
-    std::string sepVar = "CMAKE_SHARED_LIBRARY_RUNTIME_";
-    sepVar += ll;
-    sepVar += "_FLAG_SEP";
-    const char* sep = this->Makefile->GetDefinition(sepVar.c_str());
-    if(sep && *sep)
-      {
-      // TODO: Add ELF check to ABI detection and get rid of
-      // CMAKE_EXECUTABLE_FORMAT.
-      if(const char* fmt =
-         this->Makefile->GetDefinition("CMAKE_EXECUTABLE_FORMAT"))
-        {
-        return strcmp(fmt, "ELF") == 0;
-        }
-      }
-    }
-#endif
-  static_cast<void>(config);
-  return false;
-}
-
-
-//----------------------------------------------------------------------------
-std::string cmGeneratorTarget::GetSOName(const char* config) const
-{
-  if(this->Target->IsImported())
-    {
-    // Lookup the imported soname.
-    if(cmTarget::ImportInfo const* info =
-                            this->Target->GetImportInfo(config, this->Target))
-      {
-      if(info->NoSOName)
-        {
-        // The imported library has no builtin soname so the name
-        // searched at runtime will be just the filename.
-        return cmSystemTools::GetFilenameName(info->Location);
-        }
-      else
-        {
-        // Use the soname given if any.
-        if(info->SOName.find("@rpath/") == 0)
-          {
-          return info->SOName.substr(6);
-          }
-        return info->SOName;
-        }
-      }
-    else
-      {
-      return "";
-      }
-    }
-  else
-    {
-    // Compute the soname that will be built.
-    std::string name;
-    std::string soName;
-    std::string realName;
-    std::string impName;
-    std::string pdbName;
-    this->GetLibraryNames(name, soName, realName,
-                          impName, pdbName, config);
-    return soName;
-    }
-}
-
-//----------------------------------------------------------------------------
-std::string cmGeneratorTarget::GetCFBundleDirectory(const char* config,
-                                           bool contentOnly) const
-{
-  std::string fpath;
-  fpath += this->GetOutputName(config, false);
-  fpath += ".";
-  const char *ext = this->GetProperty("BUNDLE_EXTENSION");
-  if (!ext)
-    {
-    ext = "bundle";
-    }
-  fpath += ext;
-  fpath += "/Contents";
-  if(!contentOnly)
-    fpath += "/MacOS";
-  return fpath;
-}
-
-//----------------------------------------------------------------------------
-std::string cmGeneratorTarget::GetAppBundleDirectory(const char* config,
-                                            bool contentOnly) const
-{
-  std::string fpath = this->GetFullName(config, false);
-  fpath += ".app/Contents";
-  if(!contentOnly)
-    fpath += "/MacOS";
-  return fpath;
-}
-
-//----------------------------------------------------------------------------
-std::string
-cmGeneratorTarget::GetFullName(const char* config, bool implib) const
-{
-  if(this->Target->IsImported())
-    {
-    return this->Target->GetFullNameImported(config, implib);
-    }
-  else
-    {
-    return this->GetFullNameInternal(config, implib);
-    }
-}
-
-//----------------------------------------------------------------------------
-std::string cmGeneratorTarget::GetFrameworkDirectory(const char* config,
-                                                     bool rootDir) const
-{
-  std::string fpath;
-  fpath += this->GetOutputName(config, false);
-  fpath += ".framework";
-  if(!rootDir)
-    {
-    fpath += "/Versions/";
-    fpath += this->Target->GetFrameworkVersion();
-    }
-  return fpath;
-}
-
-//----------------------------------------------------------------------------
-std::string
-cmGeneratorTarget::GetInstallNameDirForBuildTree(const char* config) const
-{
-  // If building directly for installation then the build tree install_name
-  // is the same as the install tree.
-  if(this->GetPropertyAsBool("BUILD_WITH_INSTALL_RPATH"))
-    {
-    return this->GetInstallNameDirForInstallTree();
-    }
-
-  // Use the build tree directory for the target.
-  if(this->Makefile->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME") &&
-     !this->Makefile->IsOn("CMAKE_SKIP_RPATH") &&
-     !this->GetPropertyAsBool("SKIP_BUILD_RPATH"))
-    {
-    std::string dir;
-    if(this->MacOSXRpathInstallNameDirDefault())
-      {
-      dir = "@rpath";
-      }
-    else
-      {
-      dir = this->Target->GetDirectory(config);
-      }
-    dir += "/";
-    return dir;
-    }
-  else
-    {
-    return "";
-    }
-}
-
-//----------------------------------------------------------------------------
-std::string cmGeneratorTarget::GetInstallNameDirForInstallTree() const
-{
-  if(this->Makefile->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME"))
-    {
-    std::string dir;
-    const char* install_name_dir = this->GetProperty("INSTALL_NAME_DIR");
-
-    if(!this->Makefile->IsOn("CMAKE_SKIP_RPATH") &&
-       !this->Makefile->IsOn("CMAKE_SKIP_INSTALL_RPATH"))
-      {
-      if(install_name_dir && *install_name_dir)
-        {
-        dir = install_name_dir;
-        dir += "/";
-        }
-      }
-    if(!install_name_dir)
-      {
-      if(this->MacOSXRpathInstallNameDirDefault())
-        {
-        dir = "@rpath/";
-        }
-      }
-    return dir;
-    }
-  else
-    {
-    return "";
-    }
-}
-
-//----------------------------------------------------------------------------
-class cmTargetCollectLinkLanguages
-{
-public:
-  cmTargetCollectLinkLanguages(cmGeneratorTarget const* target,
-                               const char* config,
-                               std::set<cmStdString>& languages,
-                               cmTarget const* head):
-    Config(config), Languages(languages), HeadTarget(head)
-  { this->Visited.insert(target); }
-
-  void Visit(cmGeneratorTarget const* target)
-    {
-    if(!target || !this->Visited.insert(target).second)
-      {
-      return;
-      }
-
-    cmGeneratorTarget::LinkInterface const* iface =
-      target->GetLinkInterface(this->Config, this->HeadTarget);
-    if(!iface) { return; }
-
-    for(std::vector<std::string>::const_iterator
-          li = iface->Languages.begin(); li != iface->Languages.end(); ++li)
-      {
-      this->Languages.insert(*li);
-      }
-
-    cmMakefile* mf = target->GetMakefile();
-    for(std::vector<std::string>::const_iterator
-          li = iface->Libraries.begin(); li != iface->Libraries.end(); ++li)
-      {
-      this->Visit(mf->FindGeneratorTargetToUse(li->c_str()));
-      }
-    }
-private:
-  const char* Config;
-  std::set<cmStdString>& Languages;
-  cmTarget const* HeadTarget;
-  std::set<cmGeneratorTarget const*> Visited;
-};
-
-//----------------------------------------------------------------------------
-cmGeneratorTarget::LinkClosure const*
-cmGeneratorTarget::GetLinkClosure(const char* config,
-                                                  cmTarget const* head) const
-{
-  TargetConfigPair key(head, cmSystemTools::UpperCase(config ? config : ""));
-  LinkClosureMapType::iterator
-    i = this->LinkClosureMap.find(key);
-  if(i == this->LinkClosureMap.end())
-    {
-    LinkClosure lc;
-    this->ComputeLinkClosure(config, lc, head);
-    LinkClosureMapType::value_type entry(key, lc);
-    i = this->LinkClosureMap.insert(entry).first;
-    }
-  return &i->second;
-}
-
-//----------------------------------------------------------------------------
-class cmTargetSelectLinker
-{
-  int Preference;
-  cmGeneratorTarget const* Target;
-  cmMakefile* Makefile;
-  cmGlobalGenerator* GG;
-  std::set<cmStdString> Preferred;
-public:
-  cmTargetSelectLinker(cmGeneratorTarget const* target)
-      : Preference(0), Target(target)
-    {
-    this->Makefile = this->Target->Makefile;
-    this->GG = this->Makefile->GetLocalGenerator()->GetGlobalGenerator();
-    }
-  void Consider(const char* lang)
-    {
-    int preference = this->GG->GetLinkerPreference(lang);
-    if(preference > this->Preference)
-      {
-      this->Preference = preference;
-      this->Preferred.clear();
-      }
-    if(preference == this->Preference)
-      {
-      this->Preferred.insert(lang);
-      }
-    }
-  std::string Choose()
-    {
-    if(this->Preferred.empty())
-      {
-      return "";
-      }
-    else if(this->Preferred.size() > 1)
-      {
-      cmOStringStream e;
-      e << "Target " << this->Target->GetName()
-        << " contains multiple languages with the highest linker preference"
-        << " (" << this->Preference << "):\n";
-      for(std::set<cmStdString>::const_iterator
-            li = this->Preferred.begin(); li != this->Preferred.end(); ++li)
-        {
-        e << "  " << *li << "\n";
-        }
-      e << "Set the LINKER_LANGUAGE property for this target.";
-      cmake* cm = this->Makefile->GetCMakeInstance();
-      cm->IssueMessage(cmake::FATAL_ERROR, e.str(),
-                       this->Target->Target->GetBacktrace());
-      }
-    return *this->Preferred.begin();
-    }
-};
-
-//----------------------------------------------------------------------------
-cmGeneratorTarget::LinkImplementation const*
-cmGeneratorTarget::GetLinkImplementation(const char* config,
-                                         cmTarget const* head) const
-{
-  // There is no link implementation for imported targets.
-  if(this->Target->IsImported())
-    {
-    return 0;
-    }
-
-  // Lookup any existing link implementation for this configuration.
-  std::string key = cmSystemTools::UpperCase(config? config : "");
-
-  LinkImplMapType::iterator i = this->LinkImplMap.find(key);
-  if(i == this->LinkImplMap.end())
-    {
-    // Compute the link implementation for this configuration.
-    LinkImplementation impl;
-    this->ComputeLinkImplementation(config, impl, head);
-
-    // Store the information for this configuration.
-    LinkImplMapType::value_type entry(key, impl);
-    i = this->LinkImplMap.insert(entry).first;
-    }
-
-  return &i->second;
-}
-
-//----------------------------------------------------------------------------
-void cmGeneratorTarget::ComputeLinkImplementation(const char* config,
-                                         LinkImplementation& impl,
-                                         cmTarget const* head) const
-{
-  // Collect libraries directly linked in this configuration.
-  std::vector<std::string> llibs;
-  this->GetDirectLinkLibraries(config, llibs, head);
-  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 item = this->Target->CheckCMP0004(*li);
-    if(item == this->GetName() || item.empty())
-      {
-      if(item == this->GetName())
-        {
-        bool noMessage = false;
-        cmake::MessageType messageType = cmake::FATAL_ERROR;
-        cmOStringStream e;
-        switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0038))
-          {
-          case cmPolicies::WARN:
-            {
-            e << (this->Makefile->GetPolicies()
-                  ->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->Target->GetBacktrace());
-          if (messageType == cmake::FATAL_ERROR)
-            {
-            return;
-            }
-          }
-        }
-      continue;
-      }
-    cmTarget *tgt = this->Makefile->FindTargetToUse(li->c_str());
-
-    if(!tgt && std::string(item).find("::") != std::string::npos)
-      {
-      bool noMessage = false;
-      cmake::MessageType messageType = cmake::FATAL_ERROR;
-      cmOStringStream e;
-      switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0028))
-        {
-        case cmPolicies::WARN:
-          {
-          e << (this->Makefile->GetPolicies()
-                ->GetPolicyWarning(cmPolicies::CMP0028)) << "\n";
-          messageType = cmake::AUTHOR_WARNING;
-          }
-          break;
-        case cmPolicies::OLD:
-          noMessage = true;
-        case cmPolicies::REQUIRED_IF_USED:
-        case cmPolicies::REQUIRED_ALWAYS:
-        case cmPolicies::NEW:
-          // Issue the fatal message.
-          break;
-        }
-
-      if(!noMessage)
-        {
-        e << "Target \"" << this->GetName() << "\" links to target \"" << item
-          << "\" but the target was not found.  Perhaps a find_package() "
-          "call is missing for an IMPORTED target, or an ALIAS target is "
-          "missing?";
-        this->Makefile->GetCMakeInstance()->IssueMessage(messageType,
-                                                e.str(),
-                                                this->Target->GetBacktrace());
-        if (messageType == cmake::FATAL_ERROR)
-          {
-          return;
-          }
-        }
-      }
-    // The entry is meant for this configuration.
-    impl.Libraries.push_back(item);
-    }
-
-  // This target needs runtime libraries for its source languages.
-  std::set<cmStdString> languages;
-  // Get languages used in our source files.
-  this->Target->GetLanguages(languages);
-  // Get languages used in object library sources.
-  for(std::vector<std::string>::const_iterator
-      i = this->Target->GetObjectLibraries().begin();
-      i != this->Target->GetObjectLibraries().end(); ++i)
-    {
-    if(cmTarget* objLib = this->Makefile->FindTargetToUse(i->c_str()))
-      {
-      if(objLib->GetType() == cmTarget::OBJECT_LIBRARY)
-        {
-        objLib->GetLanguages(languages);
-        }
-      }
-    }
-  // Copy the set of langauges to the link implementation.
-  for(std::set<cmStdString>::iterator li = languages.begin();
-      li != languages.end(); ++li)
-    {
-    impl.Languages.push_back(*li);
-    }
-}
-
-//----------------------------------------------------------------------------
-void cmGeneratorTarget::ComputeLinkClosure(const char* config, LinkClosure& lc,
-                                  cmTarget const* head) const
-{
-  // Get languages built in this target.
-  std::set<cmStdString> languages;
-  LinkImplementation const* impl = this->GetLinkImplementation(config, head);
-  for(std::vector<std::string>::const_iterator li = impl->Languages.begin();
-      li != impl->Languages.end(); ++li)
-    {
-    languages.insert(*li);
-    }
-
-  // Add interface languages from linked targets.
-  cmTargetCollectLinkLanguages cll(this, config, languages, head);
-  for(std::vector<std::string>::const_iterator li = impl->Libraries.begin();
-      li != impl->Libraries.end(); ++li)
-    {
-    cll.Visit(this->Makefile->FindGeneratorTargetToUse(li->c_str()));
-    }
-
-  // Store the transitive closure of languages.
-  for(std::set<cmStdString>::const_iterator li = languages.begin();
-      li != languages.end(); ++li)
-    {
-    lc.Languages.push_back(*li);
-    }
-
-  // Choose the language whose linker should be used.
-  if(this->GetProperty("HAS_CXX"))
-    {
-    lc.LinkerLanguage = "CXX";
-    }
-  else if(const char* linkerLang = this->GetProperty("LINKER_LANGUAGE"))
-    {
-    lc.LinkerLanguage = linkerLang;
-    }
-  else
-    {
-    // Find the language with the highest preference value.
-    cmTargetSelectLinker tsl(this);
-
-    // First select from the languages compiled directly in this target.
-    for(std::vector<std::string>::const_iterator li = impl->Languages.begin();
-        li != impl->Languages.end(); ++li)
-      {
-      tsl.Consider(li->c_str());
-      }
-
-    // Now consider languages that propagate from linked targets.
-    for(std::set<cmStdString>::const_iterator sit = languages.begin();
-        sit != languages.end(); ++sit)
-      {
-      std::string propagates = "CMAKE_"+*sit+"_LINKER_PREFERENCE_PROPAGATES";
-      if(this->Makefile->IsOn(propagates.c_str()))
-        {
-        tsl.Consider(sit->c_str());
-        }
-      }
-
-    lc.LinkerLanguage = tsl.Choose();
-    }
-}
-
-//----------------------------------------------------------------------------
-void cmGeneratorTarget::GetFullNameComponents(std::string& prefix,
-                                              std::string& base,
-                                     std::string& suffix, const char* config,
-                                     bool implib) const
-{
-  this->GetFullNameInternal(config, implib, prefix, base, suffix);
-}
-
-//----------------------------------------------------------------------------
-std::string
-cmGeneratorTarget::BuildMacContentDirectory(const std::string& base,
-                                            const char* config,
-                                            bool contentOnly) const
-{
-  std::string fpath = base;
-  if(this->Target->IsAppBundleOnApple())
-    {
-    fpath += this->GetAppBundleDirectory(config, contentOnly);
-    }
-  if(this->Target->IsFrameworkOnApple())
-    {
-    fpath += this->GetFrameworkDirectory(config, contentOnly);
-    }
-  if(this->Target->IsCFBundleOnApple())
-    {
-    fpath += this->GetCFBundleDirectory(config, contentOnly);
-    }
-  return fpath;
-}
-
-//----------------------------------------------------------------------------
-std::string cmGeneratorTarget::GetMacContentDirectory(const char* config,
-                                             bool implib) const
-{
-  // Start with the output directory for the target.
-  std::string fpath = this->Target->GetDirectory(config, implib);
-  fpath += "/";
-  bool contentOnly = true;
-  if(this->Target->IsFrameworkOnApple())
-    {
-    // additional files with a framework go into the version specific
-    // directory
-    contentOnly = false;
-    }
-  fpath = this->BuildMacContentDirectory(fpath, config, contentOnly);
-  return fpath;
-}
-
-//----------------------------------------------------------------------------
 void cmGeneratorTarget::ClassifySources()
 {
   cmsys::RegularExpression header(CM_HEADER_REGEX);
@@ -1273,930 +460,6 @@ cmGeneratorTarget::UseObjectLibraries(std::vector<std::string>& objs) const
 }
 
 //----------------------------------------------------------------------------
-void cmGeneratorTarget::GetTransitivePropertyLinkLibraries(
-                                      const char* config,
-                                      cmTarget const *headTarget,
-                                      std::vector<std::string> &libs) const
-{
-  LinkInterface const* iface = this->GetLinkInterface(config, headTarget);
-  if (!iface)
-    {
-    return;
-    }
-  if(this->GetType() != cmTarget::STATIC_LIBRARY
-      || this->Target->GetPolicyStatusCMP0022() == cmPolicies::WARN
-      || this->Target->GetPolicyStatusCMP0022() == cmPolicies::OLD)
-    {
-    libs = iface->Libraries;
-    return;
-    }
-
-  const char* linkIfaceProp = "INTERFACE_LINK_LIBRARIES";
-  const char* interfaceLibs = this->GetProperty(linkIfaceProp);
-
-  if (!interfaceLibs)
-    {
-    return;
-    }
-
-  // The interface libraries have been explicitly set.
-  cmListFileBacktrace lfbt;
-  cmGeneratorExpression ge(lfbt);
-  cmGeneratorExpressionDAGChecker dagChecker(lfbt, this->GetName(),
-                                              linkIfaceProp, 0, 0);
-  dagChecker.SetTransitivePropertiesOnly();
-  cmSystemTools::ExpandListArgument(ge.Parse(interfaceLibs)->Evaluate(
-                                      this->Makefile,
-                                      config,
-                                      false,
-                                      headTarget,
-                                      this->Target, &dagChecker), libs);
-}
-
-//----------------------------------------------------------------------------
-template<typename PropertyType>
-PropertyType getTypedProperty(cmTarget const* tgt, const char *prop,
-                              PropertyType *);
-
-//----------------------------------------------------------------------------
-template<>
-bool getTypedProperty<bool>(cmTarget const* tgt, const char *prop, bool *)
-{
-  return tgt->GetPropertyAsBool(prop);
-}
-
-//----------------------------------------------------------------------------
-template<>
-const char *getTypedProperty<const char *>(cmTarget const* tgt,
-                                           const char *prop,
-                                           const char **)
-{
-  return tgt->GetProperty(prop);
-}
-
-enum CompatibleType
-{
-  BoolType,
-  StringType,
-  NumberMinType,
-  NumberMaxType
-};
-
-//----------------------------------------------------------------------------
-template<typename PropertyType>
-std::pair<bool, PropertyType> consistentProperty(PropertyType lhs,
-                                                 PropertyType rhs,
-                                                 CompatibleType t);
-
-//----------------------------------------------------------------------------
-template<>
-std::pair<bool, bool> consistentProperty(bool lhs, bool rhs, CompatibleType)
-{
-  return std::make_pair(lhs == rhs, lhs);
-}
-
-//----------------------------------------------------------------------------
-std::pair<bool, const char*> consistentStringProperty(const char *lhs,
-                                                      const char *rhs)
-{
-  const bool b = strcmp(lhs, rhs) == 0;
-  return std::make_pair(b, b ? lhs : 0);
-}
-
-#if defined(_MSC_VER) && _MSC_VER <= 1200
-template<typename T> const T&
-cmMaximum(const T& l, const T& r) {return l > r ? l : r;}
-template<typename T> const T&
-cmMinimum(const T& l, const T& r) {return l < r ? l : r;}
-#else
-#define cmMinimum std::min
-#define cmMaximum std::max
-#endif
-
-//----------------------------------------------------------------------------
-std::pair<bool, const char*> consistentNumberProperty(const char *lhs,
-                                                      const char *rhs,
-                                                      CompatibleType t)
-{
-  char *pEnd;
-
-#if defined(_MSC_VER)
-  static const char* const null_ptr = 0;
-#else
-# define null_ptr 0
-#endif
-
-  long lnum = strtol(lhs, &pEnd, 0);
-  if (pEnd == lhs || *pEnd != '\0' || errno == ERANGE)
-    {
-    return std::pair<bool, const char*>(false, null_ptr);
-    }
-
-  long rnum = strtol(rhs, &pEnd, 0);
-  if (pEnd == rhs || *pEnd != '\0' || errno == ERANGE)
-    {
-    return std::pair<bool, const char*>(false, null_ptr);
-    }
-
-#if !defined(_MSC_VER)
-#undef null_ptr
-#endif
-
-  if (t == NumberMaxType)
-    {
-    return std::make_pair(true, cmMaximum(lnum, rnum) == lnum ? lhs : rhs);
-    }
-  else
-    {
-    return std::make_pair(true, cmMinimum(lnum, rnum) == lnum ? lhs : rhs);
-    }
-}
-
-//----------------------------------------------------------------------------
-template<>
-std::pair<bool, const char*> consistentProperty(const char *lhs,
-                                                const char *rhs,
-                                                CompatibleType t)
-{
-  if (!lhs && !rhs)
-    {
-    return std::make_pair(true, lhs);
-    }
-  if (!lhs)
-    {
-    return std::make_pair(true, rhs);
-    }
-  if (!rhs)
-    {
-    return std::make_pair(true, lhs);
-    }
-
-#if defined(_MSC_VER)
-  static const char* const null_ptr = 0;
-#else
-# define null_ptr 0
-#endif
-
-  switch(t)
-  {
-  case BoolType:
-    assert(!"consistentProperty for strings called with BoolType");
-    return std::pair<bool, const char*>(false, null_ptr);
-  case StringType:
-    return consistentStringProperty(lhs, rhs);
-  case NumberMinType:
-  case NumberMaxType:
-    return consistentNumberProperty(lhs, rhs, t);
-  }
-  assert(!"Unreachable!");
-  return std::pair<bool, const char*>(false, null_ptr);
-
-#if !defined(_MSC_VER)
-#undef null_ptr
-#endif
-
-}
-
-template<typename PropertyType>
-PropertyType impliedValue(PropertyType);
-template<>
-bool impliedValue<bool>(bool)
-{
-  return false;
-}
-
-template<>
-const char* impliedValue<const char*>(const char*)
-{
-  return "";
-}
-
-template<typename PropertyType>
-std::string valueAsString(PropertyType);
-template<>
-std::string valueAsString<bool>(bool value)
-{
-  return value ? "TRUE" : "FALSE";
-}
-template<>
-std::string valueAsString<const char*>(const char* value)
-{
-  return value ? value : "(unset)";
-}
-
-//----------------------------------------------------------------------------
-void
-cmGeneratorTarget::ReportPropertyOrigin(const std::string &p,
-                               const std::string &result,
-                               const std::string &report,
-                               const std::string &compatibilityType) const
-{
-  std::vector<std::string> debugProperties;
-  const char *debugProp =
-          this->Makefile->GetDefinition("CMAKE_DEBUG_TARGET_PROPERTIES");
-  if (debugProp)
-    {
-    cmSystemTools::ExpandListArgument(debugProp, debugProperties);
-    }
-
-  bool debugOrigin = !this->DebugCompatiblePropertiesDone[p]
-                    && std::find(debugProperties.begin(),
-                                 debugProperties.end(),
-                                 p)
-                        != debugProperties.end();
-
-  if (this->Makefile->IsGeneratingBuildSystem())
-    {
-    this->DebugCompatiblePropertiesDone[p] = true;
-    }
-  if (!debugOrigin)
-    {
-    return;
-    }
-
-  std::string areport = compatibilityType;
-  areport += std::string(" of property \"") + p + "\" for target \"";
-  areport += std::string(this->GetName());
-  areport += "\" (result: \"";
-  areport += result;
-  areport += "\"):\n" + report;
-
-  cmListFileBacktrace lfbt;
-  this->Makefile->GetCMakeInstance()->IssueMessage(cmake::LOG, areport, lfbt);
-}
-
-//----------------------------------------------------------------------------
-std::string compatibilityType(CompatibleType t)
-{
-  switch(t)
-    {
-    case BoolType:
-      return "Boolean compatibility";
-    case StringType:
-      return "String compatibility";
-    case NumberMaxType:
-      return "Numeric maximum compatibility";
-    case NumberMinType:
-      return "Numeric minimum compatibility";
-    }
-  assert(!"Unreachable!");
-  return "";
-}
-
-//----------------------------------------------------------------------------
-std::string compatibilityAgree(CompatibleType t, bool dominant)
-{
-  switch(t)
-    {
-    case BoolType:
-    case StringType:
-      return dominant ? "(Disagree)\n" : "(Agree)\n";
-    case NumberMaxType:
-    case NumberMinType:
-      return dominant ? "(Dominant)\n" : "(Ignored)\n";
-    }
-  assert(!"Unreachable!");
-  return "";
-}
-
-//----------------------------------------------------------------------------
-template<typename PropertyType>
-PropertyType checkInterfacePropertyCompatibility(cmGeneratorTarget const* tgt,
-                                          const std::string &p,
-                                          const char *config,
-                                          const char *defaultValue,
-                                          CompatibleType t,
-                                          PropertyType *)
-{
-  PropertyType propContent = getTypedProperty<PropertyType>(tgt->Target,
-                                                            p.c_str(),
-                                                            0);
-  const bool explicitlySet = tgt->Target->GetProperties()
-                                  .find(p.c_str())
-                                  != tgt->Target->GetProperties().end();
-  const bool impliedByUse =
-          tgt->Target->IsNullImpliedByLinkLibraries(p);
-  assert((impliedByUse ^ explicitlySet)
-      || (!impliedByUse && !explicitlySet));
-
-  cmComputeLinkInformation *info = tgt->GetLinkInformation(config);
-  if(!info)
-    {
-    return propContent;
-    }
-  const cmComputeLinkInformation::ItemVector &deps = info->GetItems();
-  bool propInitialized = explicitlySet;
-
-  std::string report = " * Target \"";
-  report += tgt->GetName();
-  if (explicitlySet)
-    {
-    report += "\" has property content \"";
-    report += valueAsString<PropertyType>(propContent);
-    report += "\"\n";
-    }
-  else if (impliedByUse)
-    {
-    report += "\" property is implied by use.\n";
-    }
-  else
-    {
-    report += "\" property not set.\n";
-    }
-
-  for(cmComputeLinkInformation::ItemVector::const_iterator li =
-      deps.begin();
-      li != deps.end(); ++li)
-    {
-    // An error should be reported if one dependency
-    // has INTERFACE_POSITION_INDEPENDENT_CODE ON and the other
-    // has INTERFACE_POSITION_INDEPENDENT_CODE OFF, or if the
-    // target itself has a POSITION_INDEPENDENT_CODE which disagrees
-    // with a dependency.
-
-    if (!li->Target)
-      {
-      continue;
-      }
-
-    const bool ifaceIsSet = li->Target->GetProperties()
-                            .find("INTERFACE_" + p)
-                            != li->Target->GetProperties().end();
-    PropertyType ifacePropContent =
-                    getTypedProperty<PropertyType>(li->Target,
-                              ("INTERFACE_" + p).c_str(), 0);
-
-    std::string reportEntry;
-    if (ifaceIsSet)
-      {
-      reportEntry += " * Target \"";
-      reportEntry += li->Target->GetName();
-      reportEntry += "\" property value \"";
-      reportEntry += valueAsString<PropertyType>(ifacePropContent);
-      reportEntry += "\" ";
-      }
-
-    if (explicitlySet)
-      {
-      if (ifaceIsSet)
-        {
-        std::pair<bool, PropertyType> consistent =
-                                  consistentProperty(propContent,
-                                                     ifacePropContent, t);
-        report += reportEntry;
-        report += compatibilityAgree(t, propContent != consistent.second);
-        if (!consistent.first)
-          {
-          cmOStringStream e;
-          e << "Property " << p << " on target \""
-            << tgt->GetName() << "\" does\nnot match the "
-            "INTERFACE_" << p << " property requirement\nof "
-            "dependency \"" << li->Target->GetName() << "\".\n";
-          cmSystemTools::Error(e.str().c_str());
-          break;
-          }
-        else
-          {
-          propContent = consistent.second;
-          continue;
-          }
-        }
-      else
-        {
-        // Explicitly set on target and not set in iface. Can't disagree.
-        continue;
-        }
-      }
-    else if (impliedByUse)
-      {
-      propContent = impliedValue<PropertyType>(propContent);
-
-      if (ifaceIsSet)
-        {
-        std::pair<bool, PropertyType> consistent =
-                                  consistentProperty(propContent,
-                                                     ifacePropContent, t);
-        report += reportEntry;
-        report += compatibilityAgree(t, propContent != consistent.second);
-        if (!consistent.first)
-          {
-          cmOStringStream e;
-          e << "Property " << p << " on target \""
-            << tgt->GetName() << "\" is\nimplied to be " << defaultValue
-            << " because it was used to determine the link libraries\n"
-               "already. The INTERFACE_" << p << " property on\ndependency \""
-            << li->Target->GetName() << "\" is in conflict.\n";
-          cmSystemTools::Error(e.str().c_str());
-          break;
-          }
-        else
-          {
-          propContent = consistent.second;
-          continue;
-          }
-        }
-      else
-        {
-        // Implicitly set on target and not set in iface. Can't disagree.
-        continue;
-        }
-      }
-    else
-      {
-      if (ifaceIsSet)
-        {
-        if (propInitialized)
-          {
-          std::pair<bool, PropertyType> consistent =
-                                    consistentProperty(propContent,
-                                                       ifacePropContent, t);
-          report += reportEntry;
-          report += compatibilityAgree(t, propContent != consistent.second);
-          if (!consistent.first)
-            {
-            cmOStringStream e;
-            e << "The INTERFACE_" << p << " property of \""
-              << li->Target->GetName() << "\" does\nnot agree with the value "
-                "of " << p << " already determined\nfor \""
-              << tgt->GetName() << "\".\n";
-            cmSystemTools::Error(e.str().c_str());
-            break;
-            }
-          else
-            {
-            propContent = consistent.second;
-            continue;
-            }
-          }
-        else
-          {
-          report += reportEntry + "(Interface set)\n";
-          propContent = ifacePropContent;
-          propInitialized = true;
-          }
-        }
-      else
-        {
-        // Not set. Nothing to agree on.
-        continue;
-        }
-      }
-    }
-
-  tgt->ReportPropertyOrigin(p, valueAsString<PropertyType>(propContent),
-                            report, compatibilityType(t));
-  return propContent;
-}
-
-//----------------------------------------------------------------------------
-bool
-cmGeneratorTarget::GetLinkInterfaceDependentBoolProperty(const std::string &p,
-                                                     const char *config) const
-{
-  return checkInterfacePropertyCompatibility<bool>(this, p, config, "FALSE",
-                                                   BoolType, 0);
-}
-
-//----------------------------------------------------------------------------
-const char * cmGeneratorTarget::GetLinkInterfaceDependentStringProperty(
-                                                      const std::string &p,
-                                                      const char *config) const
-{
-  return checkInterfacePropertyCompatibility<const char *>(this,
-                                                           p,
-                                                           config,
-                                                           "empty",
-                                                           StringType, 0);
-}
-
-//----------------------------------------------------------------------------
-const char * cmGeneratorTarget::GetLinkInterfaceDependentNumberMinProperty(
-                                                      const std::string &p,
-                                                      const char *config) const
-{
-  return checkInterfacePropertyCompatibility<const char *>(this,
-                                                           p,
-                                                           config,
-                                                           "empty",
-                                                           NumberMinType, 0);
-}
-
-//----------------------------------------------------------------------------
-const char * cmGeneratorTarget::GetLinkInterfaceDependentNumberMaxProperty(
-                                                      const std::string &p,
-                                                      const char *config) const
-{
-  return checkInterfacePropertyCompatibility<const char *>(this,
-                                                           p,
-                                                           config,
-                                                           "empty",
-                                                           NumberMaxType, 0);
-}
-
-//----------------------------------------------------------------------------
-bool isLinkDependentProperty(cmGeneratorTarget const* tgt,
-                             const std::string &p,
-                             const char *interfaceProperty,
-                             const char *config)
-{
-  cmComputeLinkInformation *info = tgt->GetLinkInformation(config);
-  if(!info)
-    {
-    return false;
-    }
-
-  const cmComputeLinkInformation::ItemVector &deps = info->GetItems();
-
-  for(cmComputeLinkInformation::ItemVector::const_iterator li =
-      deps.begin();
-      li != deps.end(); ++li)
-    {
-    if (!li->Target)
-      {
-      continue;
-      }
-    const char *prop = li->Target->GetProperty(interfaceProperty);
-    if (!prop)
-      {
-      continue;
-      }
-
-    std::vector<std::string> props;
-    cmSystemTools::ExpandListArgument(prop, props);
-
-    for(std::vector<std::string>::iterator pi = props.begin();
-        pi != props.end(); ++pi)
-      {
-      if (*pi == p)
-        {
-        return true;
-        }
-      }
-    }
-
-  return false;
-}
-
-//----------------------------------------------------------------------------
-bool
-cmGeneratorTarget::IsLinkInterfaceDependentBoolProperty(const std::string &p,
-                                           const char *config) const
-{
-  if (this->GetType() == cmTarget::OBJECT_LIBRARY
-      || this->GetType() == cmTarget::INTERFACE_LIBRARY)
-    {
-    return false;
-    }
-  return (p == "POSITION_INDEPENDENT_CODE") ||
-    isLinkDependentProperty(this, p, "COMPATIBLE_INTERFACE_BOOL",
-                                 config);
-}
-
-//----------------------------------------------------------------------------
-bool
-cmGeneratorTarget::IsLinkInterfaceDependentStringProperty(const std::string &p,
-                                    const char *config) const
-{
-  if (this->GetType() == cmTarget::OBJECT_LIBRARY
-      || this->GetType() == cmTarget::INTERFACE_LIBRARY)
-    {
-    return false;
-    }
-  return isLinkDependentProperty(this, p, "COMPATIBLE_INTERFACE_STRING",
-                                 config);
-}
-
-//----------------------------------------------------------------------------
-bool cmGeneratorTarget::IsLinkInterfaceDependentNumberMinProperty(
-                                    const std::string &p,
-                                    const char *config) const
-{
-  if (this->GetType() == cmTarget::OBJECT_LIBRARY
-      || this->GetType() == cmTarget::INTERFACE_LIBRARY)
-    {
-    return false;
-    }
-  return isLinkDependentProperty(this, p, "COMPATIBLE_INTERFACE_NUMBER_MIN",
-                                 config);
-}
-
-//----------------------------------------------------------------------------
-bool cmGeneratorTarget::IsLinkInterfaceDependentNumberMaxProperty(
-                                    const std::string &p,
-                                    const char *config) const
-{
-  if (this->GetType() == cmTarget::OBJECT_LIBRARY
-      || this->GetType() == cmTarget::INTERFACE_LIBRARY)
-    {
-    return false;
-    }
-  return isLinkDependentProperty(this, p, "COMPATIBLE_INTERFACE_NUMBER_MAX",
-                                 config);
-}
-
-template<typename PropertyType>
-PropertyType getLinkInterfaceDependentProperty(cmGeneratorTarget const* tgt,
-                                               const std::string prop,
-                                               const char *config,
-                                               CompatibleType,
-                                               PropertyType *);
-
-template<>
-bool getLinkInterfaceDependentProperty(cmGeneratorTarget const* tgt,
-                                       const std::string prop,
-                                       const char *config,
-                                       CompatibleType, bool *)
-{
-  return tgt->GetLinkInterfaceDependentBoolProperty(prop, config);
-}
-
-template<>
-const char * getLinkInterfaceDependentProperty(cmGeneratorTarget const* tgt,
-                                               const std::string prop,
-                                               const char *config,
-                                               CompatibleType t,
-                                               const char **)
-{
-  switch(t)
-  {
-  case BoolType:
-    assert(!"String compatibility check function called for boolean");
-    return 0;
-  case StringType:
-    return tgt->GetLinkInterfaceDependentStringProperty(prop, config);
-  case NumberMinType:
-    return tgt->GetLinkInterfaceDependentNumberMinProperty(prop, config);
-  case NumberMaxType:
-    return tgt->GetLinkInterfaceDependentNumberMaxProperty(prop, config);
-  }
-  assert(!"Unreachable!");
-  return 0;
-}
-
-//----------------------------------------------------------------------------
-template<typename PropertyType>
-void checkPropertyConsistency(cmGeneratorTarget const* depender,
-                              cmTarget const* dependee,
-                              const char *propName,
-                              std::set<cmStdString> &emitted,
-                              const char *config,
-                              CompatibleType t,
-                              PropertyType *)
-{
-  const char *prop = dependee->GetProperty(propName);
-  if (!prop)
-    {
-    return;
-    }
-
-  std::vector<std::string> props;
-  cmSystemTools::ExpandListArgument(prop, props);
-  std::string pdir =
-    dependee->GetMakefile()->GetRequiredDefinition("CMAKE_ROOT");
-  pdir += "/Help/prop_tgt/";
-
-  for(std::vector<std::string>::iterator pi = props.begin();
-      pi != props.end(); ++pi)
-    {
-    std::string pname = cmSystemTools::HelpFileName(*pi);
-    std::string pfile = pdir + pname + ".rst";
-    if(cmSystemTools::FileExists(pfile.c_str(), true))
-      {
-      cmOStringStream e;
-      e << "Target \"" << dependee->GetName() << "\" has property \""
-        << *pi << "\" listed in its " << propName << " property.  "
-          "This is not allowed.  Only user-defined properties may appear "
-          "listed in the " << propName << " property.";
-      depender->GetMakefile()->IssueMessage(cmake::FATAL_ERROR, e.str());
-      return;
-      }
-    if(emitted.insert(*pi).second)
-      {
-      getLinkInterfaceDependentProperty<PropertyType>(depender, *pi, config,
-                                                      t, 0);
-      if (cmSystemTools::GetErrorOccuredFlag())
-        {
-        return;
-        }
-      }
-    }
-}
-
-cmMakefile* cmGeneratorTarget::GetMakefile() const
-{
-  return this->Target->GetMakefile();
-}
-
-static cmStdString intersect(const std::set<cmStdString> &s1,
-                             const std::set<cmStdString> &s2)
-{
-  std::set<cmStdString> intersect;
-  std::set_intersection(s1.begin(),s1.end(),
-                        s2.begin(),s2.end(),
-                      std::inserter(intersect,intersect.begin()));
-  if (!intersect.empty())
-    {
-    return *intersect.begin();
-    }
-  return "";
-}
-static cmStdString intersect(const std::set<cmStdString> &s1,
-                       const std::set<cmStdString> &s2,
-                       const std::set<cmStdString> &s3)
-{
-  cmStdString result;
-  result = intersect(s1, s2);
-  if (!result.empty())
-    return result;
-  result = intersect(s1, s3);
-  if (!result.empty())
-    return result;
-  return intersect(s2, s3);
-}
-static cmStdString intersect(const std::set<cmStdString> &s1,
-                       const std::set<cmStdString> &s2,
-                       const std::set<cmStdString> &s3,
-                       const std::set<cmStdString> &s4)
-{
-  cmStdString result;
-  result = intersect(s1, s2);
-  if (!result.empty())
-    return result;
-  result = intersect(s1, s3);
-  if (!result.empty())
-    return result;
-  result = intersect(s1, s4);
-  if (!result.empty())
-    return result;
-  return intersect(s2, s3, s4);
-}
-
-//----------------------------------------------------------------------------
-void
-cmGeneratorTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info,
-                                              const char* config) const
-{
-  const cmComputeLinkInformation::ItemVector &deps = info->GetItems();
-
-  std::set<cmStdString> emittedBools;
-  std::set<cmStdString> emittedStrings;
-  std::set<cmStdString> emittedMinNumbers;
-  std::set<cmStdString> emittedMaxNumbers;
-
-  for(cmComputeLinkInformation::ItemVector::const_iterator li =
-      deps.begin();
-      li != deps.end(); ++li)
-    {
-    if (!li->Target)
-      {
-      continue;
-      }
-
-    checkPropertyConsistency<bool>(this, li->Target,
-                                   "COMPATIBLE_INTERFACE_BOOL",
-                                   emittedBools, config, BoolType, 0);
-    if (cmSystemTools::GetErrorOccuredFlag())
-      {
-      return;
-      }
-    checkPropertyConsistency<const char *>(this, li->Target,
-                                           "COMPATIBLE_INTERFACE_STRING",
-                                           emittedStrings, config,
-                                           StringType, 0);
-    if (cmSystemTools::GetErrorOccuredFlag())
-      {
-      return;
-      }
-    checkPropertyConsistency<const char *>(this, li->Target,
-                                           "COMPATIBLE_INTERFACE_NUMBER_MIN",
-                                           emittedMinNumbers, config,
-                                           NumberMinType, 0);
-    if (cmSystemTools::GetErrorOccuredFlag())
-      {
-      return;
-      }
-    checkPropertyConsistency<const char *>(this, li->Target,
-                                           "COMPATIBLE_INTERFACE_NUMBER_MAX",
-                                           emittedMaxNumbers, config,
-                                           NumberMaxType, 0);
-    if (cmSystemTools::GetErrorOccuredFlag())
-      {
-      return;
-      }
-    }
-
-  std::string prop = intersect(emittedBools,
-                               emittedStrings,
-                               emittedMinNumbers,
-                               emittedMaxNumbers);
-
-  if (!prop.empty())
-    {
-    std::set<std::string> props;
-    std::set<cmStdString>::const_iterator i = emittedBools.find(prop);
-    if (i != emittedBools.end())
-      {
-      props.insert("COMPATIBLE_INTERFACE_BOOL");
-      }
-    i = emittedStrings.find(prop);
-    if (i != emittedStrings.end())
-      {
-      props.insert("COMPATIBLE_INTERFACE_STRING");
-      }
-    i = emittedMinNumbers.find(prop);
-    if (i != emittedMinNumbers.end())
-      {
-      props.insert("COMPATIBLE_INTERFACE_NUMBER_MIN");
-      }
-    i = emittedMaxNumbers.find(prop);
-    if (i != emittedMaxNumbers.end())
-      {
-      props.insert("COMPATIBLE_INTERFACE_NUMBER_MAX");
-      }
-
-    std::string propsString = *props.begin();
-    props.erase(props.begin());
-    while (props.size() > 1)
-      {
-      propsString += ", " + *props.begin();
-      props.erase(props.begin());
-      }
-   if (props.size() == 1)
-     {
-     propsString += " and the " + *props.begin();
-     }
-    cmOStringStream e;
-    e << "Property \"" << prop << "\" appears in both the "
-      << propsString <<
-    " property in the dependencies of target \"" << this->GetName() <<
-    "\".  This is not allowed. A property may only require compatibility "
-    "in a boolean interpretation, a numeric minimum, a numeric maximum or a "
-    "string interpretation, but not a mixture.";
-    this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
-    }
-}
-
-//----------------------------------------------------------------------------
-cmComputeLinkInformation*
-cmGeneratorTarget::GetLinkInformation(const char* config,
-                                      cmTarget const* head) const
-{
-  cmTarget const* headTarget = head ? head : this->Target;
-  // Lookup any existing information for this configuration.
-  TargetConfigPair key(headTarget,
-                                  cmSystemTools::UpperCase(config?config:""));
-  cmTargetLinkInformationMap::iterator
-    i = this->LinkInformation.find(key);
-  if(i == this->LinkInformation.end())
-    {
-    // Compute information for this configuration.
-    cmComputeLinkInformation* info =
-      new cmComputeLinkInformation(this, config, headTarget);
-    if(!info || !info->Compute())
-      {
-      delete info;
-      info = 0;
-      }
-
-    // Store the information for this configuration.
-    cmTargetLinkInformationMap::value_type entry(key, info);
-    i = this->LinkInformation.insert(entry).first;
-
-    if (info)
-      {
-      this->CheckPropertyCompatibility(info, config);
-      }
-    }
-  return i->second;
-}
-
-//----------------------------------------------------------------------------
-void cmGeneratorTarget::GetAutoUicOptions(std::vector<std::string> &result,
-                                 const char *config) const
-{
-  const char *prop
-            = this->GetLinkInterfaceDependentStringProperty("AUTOUIC_OPTIONS",
-                                                            config);
-  if (!prop)
-    {
-    return;
-    }
-  cmListFileBacktrace lfbt;
-  cmGeneratorExpression ge(lfbt);
-
-  cmGeneratorExpressionDAGChecker dagChecker(lfbt,
-                                      this->GetName(),
-                                      "AUTOUIC_OPTIONS", 0, 0);
-  cmSystemTools::ExpandListArgument(ge.Parse(prop)
-                                      ->Evaluate(this->Makefile,
-                                                config,
-                                                false,
-                                                this->Target,
-                                                &dagChecker),
-                                  result);
-}
-
-//----------------------------------------------------------------------------
 class cmTargetTraceDependencies
 {
 public:
@@ -2344,8 +607,7 @@ bool cmTargetTraceDependencies::IsUtility(std::string const& dep)
     }
 
   // Check for a target with this name.
-  if(cmGeneratorTarget* t
-                    = this->Makefile->FindGeneratorTargetToUse(util.c_str()))
+  if(cmTarget* t = this->Makefile->FindTargetToUse(util.c_str()))
     {
     // If we find the target and the dep was given as a full path,
     // then make sure it was not a full path to something else, and
@@ -2518,304 +780,10 @@ const char* cmGeneratorTarget::GetCreateRuleVariable() const
 }
 
 //----------------------------------------------------------------------------
-static void processIncludeDirectories(cmTarget const* tgt,
-      const std::vector<cmGeneratorTarget::TargetPropertyEntry*> &entries,
-      std::vector<std::string> &includes,
-      std::set<std::string> &uniqueIncludes,
-      cmGeneratorExpressionDAGChecker *dagChecker,
-      const char *config, bool debugIncludes)
-{
-  cmMakefile *mf = tgt->GetMakefile();
-
-  for (std::vector<cmGeneratorTarget::TargetPropertyEntry*>::const_iterator
-      it = entries.begin(), end = entries.end(); it != end; ++it)
-    {
-    bool testIsOff = true;
-    bool cacheIncludes = false;
-    std::vector<std::string> entryIncludes = (*it)->CachedEntries;
-    if(!entryIncludes.empty())
-      {
-      testIsOff = false;
-      }
-    else
-      {
-      cmSystemTools::ExpandListArgument((*it)->ge->Evaluate(mf,
-                                                config,
-                                                false,
-                                                tgt,
-                                                dagChecker),
-                                      entryIncludes);
-      if (mf->IsGeneratingBuildSystem()
-          && !(*it)->ge->GetHadContextSensitiveCondition())
-        {
-        cacheIncludes = true;
-        }
-      }
-    std::string usedIncludes;
-    cmListFileBacktrace lfbt;
-    for(std::vector<std::string>::iterator
-          li = entryIncludes.begin(); li != entryIncludes.end(); ++li)
-      {
-      std::string targetName = (*it)->TargetName;
-      std::string evaluatedTargetName;
-      {
-      cmGeneratorExpression ge(lfbt);
-      cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
-                                                        ge.Parse(targetName);
-      evaluatedTargetName = cge->Evaluate(mf, config, false, tgt, 0, 0);
-      }
-
-      cmTarget *dependentTarget = mf->FindTargetToUse(targetName.c_str());
-
-      const bool fromImported = dependentTarget
-                             && dependentTarget->IsImported();
-
-      cmTarget *evaluatedDependentTarget =
-        (targetName != evaluatedTargetName)
-          ? mf->FindTargetToUse(evaluatedTargetName.c_str())
-          : 0;
-
-      targetName = evaluatedTargetName;
-
-      const bool fromEvaluatedImported = evaluatedDependentTarget
-                             && evaluatedDependentTarget->IsImported();
-
-      if ((fromImported || fromEvaluatedImported)
-          && !cmSystemTools::FileExists(li->c_str()))
-        {
-        cmOStringStream e;
-        cmake::MessageType messageType = cmake::FATAL_ERROR;
-        if (fromEvaluatedImported)
-          {
-          switch(mf->GetPolicyStatus(cmPolicies::CMP0027))
-            {
-            case cmPolicies::WARN:
-              e << (mf->GetPolicies()
-                    ->GetPolicyWarning(cmPolicies::CMP0027)) << "\n";
-            case cmPolicies::OLD:
-              messageType = cmake::AUTHOR_WARNING;
-              break;
-            case cmPolicies::REQUIRED_ALWAYS:
-            case cmPolicies::REQUIRED_IF_USED:
-            case cmPolicies::NEW:
-              break;
-            }
-          }
-        e << "Imported target \"" << targetName << "\" includes "
-             "non-existent path\n  \"" << *li << "\"\nin its "
-             "INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:\n"
-             "* The path was deleted, renamed, or moved to another "
-             "location.\n"
-             "* An install or uninstall procedure did not complete "
-             "successfully.\n"
-             "* The installation package was faulty and references files it "
-             "does not provide.\n";
-        tgt->GetMakefile()->IssueMessage(messageType, e.str().c_str());
-        return;
-        }
-
-      if (!cmSystemTools::FileIsFullPath(li->c_str()))
-        {
-        cmOStringStream e;
-        bool noMessage = false;
-        cmake::MessageType messageType = cmake::FATAL_ERROR;
-        if (!targetName.empty())
-          {
-          e << "Target \"" << targetName << "\" contains relative "
-            "path in its INTERFACE_INCLUDE_DIRECTORIES:\n"
-            "  \"" << *li << "\"";
-          }
-        else
-          {
-          switch(tgt->GetPolicyStatusCMP0021())
-            {
-            case cmPolicies::WARN:
-              {
-              e << (mf->GetPolicies()
-                    ->GetPolicyWarning(cmPolicies::CMP0021)) << "\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;
-            }
-          e << "Found relative path while evaluating include directories of "
-          "\"" << tgt->GetName() << "\":\n  \"" << *li << "\"\n";
-          }
-        if (!noMessage)
-          {
-          tgt->GetMakefile()->IssueMessage(messageType, e.str().c_str());
-          if (messageType == cmake::FATAL_ERROR)
-            {
-            return;
-            }
-          }
-        }
-
-      if (testIsOff && !cmSystemTools::IsOff(li->c_str()))
-        {
-        cmSystemTools::ConvertToUnixSlashes(*li);
-        }
-      std::string inc = *li;
-
-      if(uniqueIncludes.insert(inc).second)
-        {
-        includes.push_back(inc);
-        if (debugIncludes)
-          {
-          usedIncludes += " * " + inc + "\n";
-          }
-        }
-      }
-    if (cacheIncludes)
-      {
-      (*it)->CachedEntries = entryIncludes;
-      }
-    if (!usedIncludes.empty())
-      {
-      mf->GetCMakeInstance()->IssueMessage(cmake::LOG,
-                            std::string("Used includes for target ")
-                            + tgt->GetName() + ":\n"
-                            + usedIncludes, (*it)->ge->GetBacktrace());
-      }
-    }
-}
-
-//----------------------------------------------------------------------------
 std::vector<std::string>
 cmGeneratorTarget::GetIncludeDirectories(const char *config) const
 {
-  std::vector<std::string> includes;
-  std::set<std::string> uniqueIncludes;
-  cmListFileBacktrace lfbt;
-
-  cmGeneratorExpressionDAGChecker dagChecker(lfbt,
-                                             this->GetName(),
-                                             "INCLUDE_DIRECTORIES", 0, 0);
-
-  std::vector<std::string> debugProperties;
-  const char *debugProp =
-              this->Makefile->GetDefinition("CMAKE_DEBUG_TARGET_PROPERTIES");
-  if (debugProp)
-    {
-    cmSystemTools::ExpandListArgument(debugProp, debugProperties);
-    }
-
-  bool debugIncludes = !this->DebugIncludesDone
-                    && std::find(debugProperties.begin(),
-                                 debugProperties.end(),
-                                 "INCLUDE_DIRECTORIES")
-                        != debugProperties.end();
-
-  if (this->Makefile->IsGeneratingBuildSystem())
-    {
-    this->DebugIncludesDone = true;
-    }
-
-  processIncludeDirectories(this->Target,
-                            this->Target->GetIncludeDirectoriesEntries(),
-                            includes,
-                            uniqueIncludes,
-                            &dagChecker,
-                            config,
-                            debugIncludes);
-
-  std::string configString = config ? config : "";
-  if (!this->CacheLinkInterfaceIncludeDirectoriesDone[configString])
-    {
-    for (std::vector<cmValueWithOrigin>::const_iterator
-        it = this->Target->GetLinkImplementationPropertyEntries().begin(),
-        end = this->Target->GetLinkImplementationPropertyEntries().end();
-        it != end; ++it)
-      {
-      if (!cmGeneratorExpression::IsValidTargetName(it->Value)
-          && cmGeneratorExpression::Find(it->Value) == std::string::npos)
-        {
-        continue;
-        }
-      {
-      cmGeneratorExpression ge(lfbt);
-      cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
-                                                        ge.Parse(it->Value);
-      std::string result = cge->Evaluate(this->Makefile, config,
-                                        false, this->Target, 0, 0);
-      if (!this->Makefile->FindTargetToUse(result.c_str()))
-        {
-        continue;
-        }
-      }
-      std::string includeGenex = "$<TARGET_PROPERTY:" +
-                              it->Value + ",INTERFACE_INCLUDE_DIRECTORIES>";
-      if (cmGeneratorExpression::Find(it->Value) != std::string::npos)
-        {
-        // Because it->Value is a generator expression, ensure that it
-        // evaluates to the non-empty string before being used in the
-        // TARGET_PROPERTY expression.
-        includeGenex = "$<$<BOOL:" + it->Value + ">:" + includeGenex + ">";
-        }
-      cmGeneratorExpression ge(it->Backtrace);
-      cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(
-                                                              includeGenex);
-
-      this
-        ->CachedLinkInterfaceIncludeDirectoriesEntries[configString].push_back(
-                        new cmGeneratorTarget::TargetPropertyEntry(cge,
-                                                              it->Value));
-      }
-
-    if(this->Makefile->IsOn("APPLE"))
-      {
-      LinkImplementation const* impl =
-                     this->GetLinkImplementation(config, this->Target);
-      for(std::vector<std::string>::const_iterator
-          it = impl->Libraries.begin();
-          it != impl->Libraries.end(); ++it)
-        {
-        std::string libDir = cmSystemTools::CollapseFullPath(it->c_str());
-
-        static cmsys::RegularExpression
-          frameworkCheck("(.*\\.framework)(/Versions/[^/]+)?/[^/]+$");
-        if(!frameworkCheck.find(libDir))
-          {
-          continue;
-          }
-
-        libDir = frameworkCheck.match(1);
-
-        cmGeneratorExpression ge(lfbt);
-        cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
-                  ge.Parse(libDir.c_str());
-        this->CachedLinkInterfaceIncludeDirectoriesEntries[configString]
-                .push_back(new cmGeneratorTarget::TargetPropertyEntry(cge));
-        }
-      }
-    }
-
-  processIncludeDirectories(this->Target,
-    this->CachedLinkInterfaceIncludeDirectoriesEntries[configString],
-                            includes,
-                            uniqueIncludes,
-                            &dagChecker,
-                            config,
-                            debugIncludes);
-
-  if (!this->Makefile->IsGeneratingBuildSystem())
-    {
-    deleteAndClear2(
-                this->CachedLinkInterfaceIncludeDirectoriesEntries);
-    }
-  else
-    {
-    this->CacheLinkInterfaceIncludeDirectoriesDone[configString]
-                                                                      = true;
-    }
-
-  return includes;
+  return this->Target->GetIncludeDirectories(config);
 }
 
 //----------------------------------------------------------------------------
@@ -2837,14 +805,14 @@ void cmGeneratorTarget::GenerateTargetManifest(const char* config) const
   std::string pdbName;
   if(this->GetType() == cmTarget::EXECUTABLE)
     {
-    this->GetExecutableNames(name, realName, impName, pdbName,
+    this->Target->GetExecutableNames(name, realName, impName, pdbName,
                                      config);
     }
   else if(this->GetType() == cmTarget::STATIC_LIBRARY ||
           this->GetType() == cmTarget::SHARED_LIBRARY ||
           this->GetType() == cmTarget::MODULE_LIBRARY)
     {
-    this->GetLibraryNames(name, soName, realName, impName, pdbName,
+    this->Target->GetLibraryNames(name, soName, realName, impName, pdbName,
                                   config);
     }
   else
@@ -2894,718 +862,6 @@ void cmGeneratorTarget::GenerateTargetManifest(const char* config) const
     }
 }
 
-//----------------------------------------------------------------------------
-std::string cmGeneratorTarget::GetFullPath(const char* config,
-                                           bool implib, bool realname) const
-{
-  if(this->Target->IsImported())
-    {
-    return this->Target->ImportedGetFullPath(config, implib);
-    }
-  else
-    {
-    return this->NormalGetFullPath(config, implib, realname);
-    }
-}
-
-std::string cmGeneratorTarget::NormalGetFullPath(const char* config,
-                                                 bool implib,
-                                                 bool realname) const
-{
-  std::string fpath = this->Target->GetDirectory(config, implib);
-  fpath += "/";
-  if(this->Target->IsAppBundleOnApple())
-    {
-    fpath = this->BuildMacContentDirectory(fpath, config, false);
-    fpath += "/";
-    }
-
-  // Add the full name of the target.
-  if(implib)
-    {
-    fpath += this->GetFullName(config, true);
-    }
-  else if(realname)
-    {
-    fpath += this->NormalGetRealName(config);
-    }
-  else
-    {
-    fpath += this->GetFullName(config, false);
-    }
-  return fpath;
-}
-
-//----------------------------------------------------------------------------
-std::string cmGeneratorTarget::NormalGetRealName(const char* config) const
-{
-  // This should not be called for imported targets.
-  // TODO: Split cmTarget into a class hierarchy to get compile-time
-  // enforcement of the limited imported target API.
-  if(this->Target->IsImported())
-    {
-    std::string msg =  "NormalGetRealName called on imported target: ";
-    msg += this->GetName();
-    this->Makefile->
-      IssueMessage(cmake::INTERNAL_ERROR,
-                   msg.c_str());
-    }
-
-  if(this->GetType() == cmTarget::EXECUTABLE)
-    {
-    // Compute the real name that will be built.
-    std::string name;
-    std::string realName;
-    std::string impName;
-    std::string pdbName;
-    this->GetExecutableNames(name, realName, impName, pdbName, config);
-    return realName;
-    }
-  else
-    {
-    // Compute the real name that will be built.
-    std::string name;
-    std::string soName;
-    std::string realName;
-    std::string impName;
-    std::string pdbName;
-    this->GetLibraryNames(name, soName, realName,
-                          impName, pdbName, config);
-    return realName;
-    }
-}
-
-//----------------------------------------------------------------------------
-void cmGeneratorTarget::GetLibraryNames(std::string& name,
-                               std::string& soName,
-                               std::string& realName,
-                               std::string& impName,
-                               std::string& pdbName,
-                               const char* config) const
-{
-  // This should not be called for imported targets.
-  // TODO: Split cmTarget into a class hierarchy to get compile-time
-  // enforcement of the limited imported target API.
-  if(this->Target->IsImported())
-    {
-    std::string msg =  "GetLibraryNames called on imported target: ";
-    msg += this->GetName();
-    this->Makefile->IssueMessage(cmake::INTERNAL_ERROR,
-                                 msg.c_str());
-    return;
-    }
-
-  // Check for library version properties.
-  const char* version = this->GetProperty("VERSION");
-  const char* soversion = this->GetProperty("SOVERSION");
-  if(!this->HasSOName(config) ||
-     this->Target->IsFrameworkOnApple())
-    {
-    // Versioning is supported only for shared libraries and modules,
-    // and then only when the platform supports an soname flag.
-    version = 0;
-    soversion = 0;
-    }
-  if(version && !soversion)
-    {
-    // The soversion must be set if the library version is set.  Use
-    // the library version as the soversion.
-    soversion = version;
-    }
-  if(!version && soversion)
-    {
-    // Use the soversion as the library version.
-    version = soversion;
-    }
-
-  // Get the components of the library name.
-  std::string prefix;
-  std::string base;
-  std::string suffix;
-  this->GetFullNameInternal(config, false, prefix, base, suffix);
-
-  // The library name.
-  name = prefix+base+suffix;
-
-  if(this->Target->IsFrameworkOnApple())
-    {
-    realName = prefix;
-    realName += "Versions/";
-    realName += this->Target->GetFrameworkVersion();
-    realName += "/";
-    realName += base;
-    soName = realName;
-    }
-  else
-  {
-    // The library's soname.
-    this->ComputeVersionedName(soName, prefix, base, suffix,
-                              name, soversion);
-
-    // The library's real name on disk.
-    this->ComputeVersionedName(realName, prefix, base, suffix,
-                              name, version);
-  }
-
-  // The import library name.
-  if(this->GetType() == cmTarget::SHARED_LIBRARY ||
-     this->GetType() == cmTarget::MODULE_LIBRARY)
-    {
-    impName = this->GetFullNameInternal(config, true);
-    }
-  else
-    {
-    impName = "";
-    }
-
-  // The program database file name.
-  pdbName = this->GetPDBName(config);
-}
-
-//----------------------------------------------------------------------------
-void cmGeneratorTarget::GetExecutableNames(std::string& name,
-                                  std::string& realName,
-                                  std::string& impName,
-                                  std::string& pdbName,
-                                  const char* config) const
-{
-  // This should not be called for imported targets.
-  // TODO: Split cmTarget into a class hierarchy to get compile-time
-  // enforcement of the limited imported target API.
-  if(this->Target->IsImported())
-    {
-    std::string msg =
-      "GetExecutableNames called on imported target: ";
-    msg += this->GetName();
-    this->GetMakefile()->IssueMessage(cmake::INTERNAL_ERROR, msg.c_str());
-    }
-
-  // This versioning is supported only for executables and then only
-  // when the platform supports symbolic links.
-#if defined(_WIN32) && !defined(__CYGWIN__)
-  const char* version = 0;
-#else
-  // Check for executable version properties.
-  const char* version = this->GetProperty("VERSION");
-  if(this->GetType() != cmTarget::EXECUTABLE || this->Makefile->IsOn("XCODE"))
-    {
-    version = 0;
-    }
-#endif
-
-  // Get the components of the executable name.
-  std::string prefix;
-  std::string base;
-  std::string suffix;
-  this->GetFullNameInternal(config, false, prefix, base, suffix);
-
-  // The executable name.
-  name = prefix+base+suffix;
-
-  // The executable's real name on disk.
-#if defined(__CYGWIN__)
-  realName = prefix+base;
-#else
-  realName = name;
-#endif
-  if(version)
-    {
-    realName += "-";
-    realName += version;
-    }
-#if defined(__CYGWIN__)
-  realName += suffix;
-#endif
-
-  // The import library name.
-  impName = this->GetFullNameInternal(config, true);
-
-  // The program database file name.
-  pdbName = this->GetPDBName(config);
-}
-
-//----------------------------------------------------------------------------
-cmGeneratorTarget::LinkInterface const*
-cmGeneratorTarget::GetLinkInterface(const char* config,
-                                    cmTarget const* head) const
-{
-  // Imported targets have their own link interface.
-  if(this->Target->IsImported())
-    {
-    if(cmTarget::ImportInfo const* info = this->Target->GetImportInfo(config,
-                                                                      head))
-      {
-      return &info->LinkInterface;
-      }
-    return 0;
-    }
-
-  // Link interfaces are not supported for executables that do not
-  // export symbols.
-  if(this->GetType() == cmTarget::EXECUTABLE &&
-     !this->Target->IsExecutableWithExports())
-    {
-    return 0;
-    }
-
-  // Lookup any existing link interface for this configuration.
-  TargetConfigPair key(head, cmSystemTools::UpperCase(config? config : ""));
-  LinkInterfaceMapType::iterator
-    i = this->LinkInterfaceMap.find(key);
-  if(i == this->LinkInterfaceMap.end())
-    {
-    // Compute the link interface for this configuration.
-    OptionalLinkInterface iface;
-    iface.Exists = this->ComputeLinkInterface(config, iface, head);
-
-    // Store the information for this configuration.
-    LinkInterfaceMapType::value_type entry(key, iface);
-    i = this->LinkInterfaceMap.insert(entry).first;
-    }
-
-  return i->second.Exists? &i->second : 0;
-}
-
-//----------------------------------------------------------------------------
-bool cmGeneratorTarget::ComputeLinkInterface(const char* config,
-                                             LinkInterface& iface,
-                                             cmTarget const *headTarget) const
-{
-  // Construct the property name suffix for this configuration.
-  std::string suffix = "_";
-  if(config && *config)
-    {
-    suffix += cmSystemTools::UpperCase(config);
-    }
-  else
-    {
-    suffix += "NOCONFIG";
-    }
-
-  // An explicit list of interface libraries may be set for shared
-  // libraries and executables that export symbols.
-  const char* explicitLibraries = 0;
-  std::string linkIfaceProp;
-  if(this->Target->PolicyStatusCMP0022 != cmPolicies::OLD &&
-     this->Target->PolicyStatusCMP0022 != cmPolicies::WARN)
-    {
-    // CMP0022 NEW behavior is to use INTERFACE_LINK_LIBRARIES.
-    linkIfaceProp = "INTERFACE_LINK_LIBRARIES";
-    explicitLibraries = this->GetProperty(linkIfaceProp.c_str());
-    }
-  else if(this->GetType() == cmTarget::SHARED_LIBRARY ||
-          this->Target->IsExecutableWithExports())
-    {
-    // CMP0022 OLD behavior is to use LINK_INTERFACE_LIBRARIES if set on a
-    // shared lib or executable.
-
-    // Lookup the per-configuration property.
-    linkIfaceProp = "LINK_INTERFACE_LIBRARIES";
-    linkIfaceProp += suffix;
-    explicitLibraries = this->GetProperty(linkIfaceProp.c_str());
-
-    // If not set, try the generic property.
-    if(!explicitLibraries)
-      {
-      linkIfaceProp = "LINK_INTERFACE_LIBRARIES";
-      explicitLibraries = this->GetProperty(linkIfaceProp.c_str());
-      }
-    }
-
-  if(explicitLibraries
-      && this->Target->GetPolicyStatusCMP0022() == cmPolicies::WARN
-      && !this->PolicyWarnedCMP0022)
-    {
-    // Compare the explicitly set old link interface properties to the
-    // preferred new link interface property one and warn if different.
-    const char* newExplicitLibraries =
-      this->GetProperty("INTERFACE_LINK_LIBRARIES");
-    if (newExplicitLibraries
-        && strcmp(newExplicitLibraries, explicitLibraries) != 0)
-      {
-      cmOStringStream w;
-      w <<
-        (this->Makefile->GetPolicies()
-         ->GetPolicyWarning(cmPolicies::CMP0022)) << "\n"
-        "Target \"" << this->GetName() << "\" has an "
-        "INTERFACE_LINK_LIBRARIES property which differs from its " <<
-        linkIfaceProp << " properties."
-        "\n"
-        "INTERFACE_LINK_LIBRARIES:\n"
-        "  " << newExplicitLibraries << "\n" <<
-        linkIfaceProp << ":\n"
-        "  " << (explicitLibraries ? explicitLibraries : "(empty)") << "\n";
-      this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
-      this->PolicyWarnedCMP0022 = true;
-      }
-    }
-
-  // There is no implicit link interface for executables or modules
-  // so if none was explicitly set then there is no link interface.
-  if(!explicitLibraries &&
-     (this->GetType() == cmTarget::EXECUTABLE ||
-      (this->GetType() == cmTarget::MODULE_LIBRARY)))
-    {
-    return false;
-    }
-
-  if(explicitLibraries)
-    {
-    // The interface libraries have been explicitly set.
-    cmListFileBacktrace lfbt;
-    cmGeneratorExpression ge(lfbt);
-    cmGeneratorExpressionDAGChecker dagChecker(lfbt, this->GetName(),
-                                               linkIfaceProp, 0, 0);
-    cmSystemTools::ExpandListArgument(ge.Parse(explicitLibraries)->Evaluate(
-                                        this->Makefile,
-                                        config,
-                                        false,
-                                        headTarget,
-                                        this->Target, &dagChecker),
-                                      iface.Libraries);
-
-    if(this->GetType() == cmTarget::SHARED_LIBRARY
-        || this->GetType() == cmTarget::STATIC_LIBRARY
-        || this->GetType() == cmTarget::INTERFACE_LIBRARY)
-      {
-      // Shared libraries may have runtime implementation dependencies
-      // on other shared libraries that are not in the interface.
-      std::set<cmStdString> emitted;
-      for(std::vector<std::string>::const_iterator
-            li = iface.Libraries.begin(); li != iface.Libraries.end(); ++li)
-        {
-        emitted.insert(*li);
-        }
-      if (this->GetType() != cmTarget::INTERFACE_LIBRARY)
-        {
-        LinkImplementation const* impl =
-                              this->GetLinkImplementation(config, headTarget);
-        for(std::vector<std::string>::const_iterator
-              li = impl->Libraries.begin(); li != impl->Libraries.end(); ++li)
-          {
-          if(emitted.insert(*li).second)
-            {
-            if(cmTarget* tgt = this->Makefile->FindTargetToUse(li->c_str()))
-              {
-              // This is a runtime dependency on another shared library.
-              if(tgt->GetType() == cmTarget::SHARED_LIBRARY)
-                {
-                iface.SharedDeps.push_back(*li);
-                }
-              }
-            else
-              {
-              // TODO: Recognize shared library file names.  Perhaps this
-              // should be moved to cmComputeLinkInformation, but that creates
-              // a chicken-and-egg problem since this list is needed for its
-              // construction.
-              }
-            }
-          }
-        if(this->Target->LinkLanguagePropagatesToDependents())
-          {
-          // Targets using this archive need its language runtime libraries.
-          iface.Languages = impl->Languages;
-          }
-        }
-      }
-    }
-  else if (this->Target->GetPolicyStatusCMP0022() == cmPolicies::WARN
-        || this->Target->GetPolicyStatusCMP0022() == cmPolicies::OLD)
-    // If CMP0022 is NEW then the plain tll signature sets the
-    // INTERFACE_LINK_LIBRARIES, so if we get here then the project
-    // cleared the property explicitly and we should not fall back
-    // to the link implementation.
-    {
-    // The link implementation is the default link interface.
-    LinkImplementation const* impl =
-                              this->GetLinkImplementation(config, headTarget);
-    iface.ImplementationIsInterface = true;
-    iface.Libraries = impl->Libraries;
-    if(this->Target->LinkLanguagePropagatesToDependents())
-      {
-      // Targets using this archive need its language runtime libraries.
-      iface.Languages = impl->Languages;
-      }
-
-    if(this->Target->GetPolicyStatusCMP0022() == cmPolicies::WARN &&
-       !this->PolicyWarnedCMP0022)
-      {
-      // Compare the link implementation fallback link interface to the
-      // preferred new link interface property and warn if different.
-      cmListFileBacktrace lfbt;
-      cmGeneratorExpression ge(lfbt);
-      cmGeneratorExpressionDAGChecker dagChecker(lfbt, this->GetName(),
-                                      "INTERFACE_LINK_LIBRARIES", 0, 0);
-      std::vector<std::string> ifaceLibs;
-      const char* newExplicitLibraries =
-        this->GetProperty("INTERFACE_LINK_LIBRARIES");
-      cmSystemTools::ExpandListArgument(
-        ge.Parse(newExplicitLibraries)->Evaluate(this->Makefile,
-                                                 config,
-                                                 false,
-                                                 headTarget,
-                                                 this->Target, &dagChecker),
-        ifaceLibs);
-      if (ifaceLibs != impl->Libraries)
-        {
-        std::string oldLibraries;
-        std::string newLibraries;
-        const char *sep = "";
-        for(std::vector<std::string>::const_iterator it
-              = impl->Libraries.begin(); it != impl->Libraries.end(); ++it)
-          {
-          oldLibraries += sep;
-          oldLibraries += *it;
-          sep = ";";
-          }
-        sep = "";
-        for(std::vector<std::string>::const_iterator it
-              = ifaceLibs.begin(); it != ifaceLibs.end(); ++it)
-          {
-          newLibraries += sep;
-          newLibraries += *it;
-          sep = ";";
-          }
-        if(oldLibraries.empty())
-          { oldLibraries = "(empty)"; }
-        if(newLibraries.empty())
-          { newLibraries = "(empty)"; }
-
-        cmOStringStream w;
-        w <<
-          (this->Makefile->GetPolicies()
-           ->GetPolicyWarning(cmPolicies::CMP0022)) << "\n"
-          "Target \"" << this->GetName() << "\" has an "
-          "INTERFACE_LINK_LIBRARIES property.  "
-          "This should be preferred as the source of the link interface "
-          "for this library but because CMP0022 is not set CMake is "
-          "ignoring the property and using the link implementation "
-          "as the link interface instead."
-          "\n"
-          "INTERFACE_LINK_LIBRARIES:\n"
-          "  " << newLibraries << "\n"
-          "Link implementation:\n"
-          "  " << oldLibraries << "\n";
-        this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
-        this->PolicyWarnedCMP0022 = true;
-        }
-      }
-    }
-
-  if(this->GetType() == cmTarget::STATIC_LIBRARY)
-    {
-    // How many repetitions are needed if this library has cyclic
-    // dependencies?
-    std::string propName = "LINK_INTERFACE_MULTIPLICITY";
-    propName += suffix;
-    if(const char* config_reps = this->GetProperty(propName.c_str()))
-      {
-      sscanf(config_reps, "%u", &iface.Multiplicity);
-      }
-    else if(const char* reps =
-            this->GetProperty("LINK_INTERFACE_MULTIPLICITY"))
-      {
-      sscanf(reps, "%u", &iface.Multiplicity);
-      }
-    }
-
-  return true;
-}
-
-
-//----------------------------------------------------------------------------
-std::string
-cmGeneratorTarget::GetFullNameInternal(const char* config, bool implib) const
-{
-  std::string prefix;
-  std::string base;
-  std::string suffix;
-  this->GetFullNameInternal(config, implib, prefix, base, suffix);
-  return prefix+base+suffix;
-}
-
-//----------------------------------------------------------------------------
-void cmGeneratorTarget::GetFullNameInternal(const char* config,
-                                   bool implib,
-                                   std::string& outPrefix,
-                                   std::string& outBase,
-                                   std::string& outSuffix) const
-{
-  // Use just the target name for non-main target types.
-  if(this->GetType() != cmTarget::STATIC_LIBRARY &&
-     this->GetType() != cmTarget::SHARED_LIBRARY &&
-     this->GetType() != cmTarget::MODULE_LIBRARY &&
-     this->GetType() != cmTarget::EXECUTABLE)
-    {
-    outPrefix = "";
-    outBase = this->GetName();
-    outSuffix = "";
-    return;
-    }
-
-  // Return an empty name for the import library if this platform
-  // does not support import libraries.
-  if(implib &&
-     !this->Makefile->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX"))
-    {
-    outPrefix = "";
-    outBase = "";
-    outSuffix = "";
-    return;
-    }
-
-  // The implib option is only allowed for shared libraries, module
-  // libraries, and executables.
-  if(this->GetType() != cmTarget::SHARED_LIBRARY &&
-     this->GetType() != cmTarget::MODULE_LIBRARY &&
-     this->GetType() != cmTarget::EXECUTABLE)
-    {
-    implib = false;
-    }
-
-  // Compute the full name for main target types.
-  const char* targetPrefix = (implib
-                              ? this->GetProperty("IMPORT_PREFIX")
-                              : this->GetProperty("PREFIX"));
-  const char* targetSuffix = (implib
-                              ? this->GetProperty("IMPORT_SUFFIX")
-                              : this->GetProperty("SUFFIX"));
-  const char* configPostfix = 0;
-  if(config && *config)
-    {
-    std::string configProp = cmSystemTools::UpperCase(config);
-    configProp += "_POSTFIX";
-    configPostfix = this->GetProperty(configProp.c_str());
-    // Mac application bundles and frameworks have no postfix.
-    if(configPostfix &&
-       (this->Target->IsAppBundleOnApple()
-         || this->Target->IsFrameworkOnApple()))
-      {
-      configPostfix = 0;
-      }
-    }
-  const char* prefixVar = this->Target->GetPrefixVariableInternal(implib);
-  const char* suffixVar = this->Target->GetSuffixVariableInternal(implib);
-
-  // Check for language-specific default prefix and suffix.
-  if(const char* ll = this->GetLinkerLanguage(config, this->Target))
-    {
-    if(!targetSuffix && suffixVar && *suffixVar)
-      {
-      std::string langSuff = suffixVar + std::string("_") + ll;
-      targetSuffix = this->Makefile->GetDefinition(langSuff.c_str());
-      }
-    if(!targetPrefix && prefixVar && *prefixVar)
-      {
-      std::string langPrefix = prefixVar + std::string("_") + ll;
-      targetPrefix = this->Makefile->GetDefinition(langPrefix.c_str());
-      }
-    }
-
-  // if there is no prefix on the target use the cmake definition
-  if(!targetPrefix && prefixVar)
-    {
-    targetPrefix = this->Makefile->GetSafeDefinition(prefixVar);
-    }
-  // if there is no suffix on the target use the cmake definition
-  if(!targetSuffix && suffixVar)
-    {
-    targetSuffix = this->Makefile->GetSafeDefinition(suffixVar);
-    }
-
-  // frameworks have directory prefix but no suffix
-  std::string fw_prefix;
-  if(this->Target->IsFrameworkOnApple())
-    {
-    fw_prefix = this->GetOutputName(config, false);
-    fw_prefix += ".framework/";
-    targetPrefix = fw_prefix.c_str();
-    targetSuffix = 0;
-    }
-
-  if(this->Target->IsCFBundleOnApple())
-    {
-    fw_prefix = this->GetOutputName(config, false);
-    fw_prefix += ".";
-    const char *ext = this->GetProperty("BUNDLE_EXTENSION");
-    if (!ext)
-      {
-      ext = "bundle";
-      }
-    fw_prefix += ext;
-    fw_prefix += "/Contents/MacOS/";
-    targetPrefix = fw_prefix.c_str();
-    targetSuffix = 0;
-    }
-
-  // Begin the final name with the prefix.
-  outPrefix = targetPrefix?targetPrefix:"";
-
-  // Append the target name or property-specified name.
-  outBase += this->GetOutputName(config, implib);
-
-  // Append the per-configuration postfix.
-  outBase += configPostfix?configPostfix:"";
-
-  // Name shared libraries with their version number on some platforms.
-  if(const char* soversion = this->GetProperty("SOVERSION"))
-    {
-    if(this->GetType() == cmTarget::SHARED_LIBRARY && !implib &&
-       this->Makefile->IsOn("CMAKE_SHARED_LIBRARY_NAME_WITH_VERSION"))
-      {
-      outBase += "-";
-      outBase += soversion;
-      }
-    }
-
-  // Append the suffix.
-  outSuffix = targetSuffix?targetSuffix:"";
-}
-
-
-//----------------------------------------------------------------------------
-const char* cmGeneratorTarget::GetLinkerLanguage(const char* config,
-                                                 cmTarget const* head) const
-{
-  cmTarget const* headTarget = head ? head : this->Target;
-  const char* lang = this->GetLinkClosure(config, headTarget)
-                                                    ->LinkerLanguage.c_str();
-  return *lang? lang : 0;
-}
-
-//----------------------------------------------------------------------------
-std::string cmGeneratorTarget::GetPDBName(const char* config) const
-{
-  std::string prefix;
-  std::string base;
-  std::string suffix;
-  this->GetFullNameInternal(config, false, prefix, base, suffix);
-
-  std::vector<std::string> props;
-  std::string configUpper =
-    cmSystemTools::UpperCase(config? config : "");
-  if(!configUpper.empty())
-    {
-    // PDB_NAME_<CONFIG>
-    props.push_back("PDB_NAME_" + configUpper);
-    }
-
-  // PDB_NAME
-  props.push_back("PDB_NAME");
-
-  for(std::vector<std::string>::const_iterator i = props.begin();
-      i != props.end(); ++i)
-    {
-    if(const char* outName = this->GetProperty(i->c_str()))
-      {
-      base = outName;
-      break;
-      }
-    }
-  return prefix+base+".pdb";
-}
-
 bool cmStrictTargetComparison::operator()(cmTarget const* t1,
                                           cmTarget const* t2) const
 {
@@ -3617,250 +873,3 @@ bool cmStrictTargetComparison::operator()(cmTarget const* t1,
     }
   return nameResult < 0;
 }
-
-//----------------------------------------------------------------------------
-bool cmGeneratorTarget::HasMacOSXRpathInstallNameDir(const char* 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, this->Target))
-      {
-      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"))
-    {
-    cmOStringStream 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->GetLocalGenerator()->GetGlobalGenerator()->
-      AddCMP0042WarnTarget(this->GetName());
-    }
-
-  if(cmp0042 == cmPolicies::NEW)
-    {
-    return true;
-    }
-
-  return false;
-}
-
-//----------------------------------------------------------------------------
-void cmGeneratorTarget::ComputeVersionedName(std::string& vName,
-                                             std::string const& prefix,
-                                             std::string const& base,
-                                             std::string const& suffix,
-                                             std::string const& name,
-                                             const char* version) const
-{
-  const bool apple = this->Makefile->IsOn("APPLE");
-  vName = apple ? (prefix+base) : name;
-  if(version)
-    {
-    vName += ".";
-    vName += version;
-    }
-  vName += apple ? suffix : std::string();
-}
-
-//----------------------------------------------------------------------------
-bool cmGeneratorTarget::HaveBuildTreeRPATH(const char *config) const
-{
-  if (this->GetPropertyAsBool("SKIP_BUILD_RPATH"))
-    {
-    return false;
-    }
-  std::vector<std::string> libs;
-  this->GetDirectLinkLibraries(config, libs, this->Target);
-  return !libs.empty();
-}
-
-//----------------------------------------------------------------------------
-bool cmGeneratorTarget::HaveInstallTreeRPATH() const
-{
-  const char* install_rpath = this->GetProperty("INSTALL_RPATH");
-  return (install_rpath && *install_rpath) &&
-          !this->Makefile->IsOn("CMAKE_SKIP_INSTALL_RPATH");
-}
-
-//----------------------------------------------------------------------------
-std::string cmGeneratorTarget::GetOutputName(const char* config,
-                                             bool implib) const
-{
-  std::vector<std::string> props;
-  std::string type = this->Target->GetOutputTargetType(implib);
-  std::string configUpper = cmSystemTools::UpperCase(config? config : "");
-  if(!type.empty() && !configUpper.empty())
-    {
-    // <ARCHIVE|LIBRARY|RUNTIME>_OUTPUT_NAME_<CONFIG>
-    props.push_back(type + "_OUTPUT_NAME_" + configUpper);
-    }
-  if(!type.empty())
-    {
-    // <ARCHIVE|LIBRARY|RUNTIME>_OUTPUT_NAME
-    props.push_back(type + "_OUTPUT_NAME");
-    }
-  if(!configUpper.empty())
-    {
-    // OUTPUT_NAME_<CONFIG>
-    props.push_back("OUTPUT_NAME_" + configUpper);
-    // <CONFIG>_OUTPUT_NAME
-    props.push_back(configUpper + "_OUTPUT_NAME");
-    }
-  // OUTPUT_NAME
-  props.push_back("OUTPUT_NAME");
-
-  for(std::vector<std::string>::const_iterator i = props.begin();
-      i != props.end(); ++i)
-    {
-    if(const char* outName = this->GetProperty(i->c_str()))
-      {
-      return outName;
-      }
-    }
-  return this->GetName();
-}
-
-//----------------------------------------------------------------------------
-void cmGeneratorTarget::GetDirectLinkLibraries(const char *config,
-                            std::vector<std::string> &libs,
-                            cmTarget const* head) const
-{
-  const char *prop = this->GetProperty("LINK_LIBRARIES");
-  if (prop)
-    {
-    cmListFileBacktrace lfbt;
-    cmGeneratorExpression ge(lfbt);
-    const cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
-
-    cmGeneratorExpressionDAGChecker dagChecker(lfbt,
-                                        this->GetName(),
-                                        "LINK_LIBRARIES", 0, 0);
-    cmSystemTools::ExpandListArgument(cge->Evaluate(this->Makefile,
-                                        config,
-                                        false,
-                                        head,
-                                        &dagChecker),
-                                      libs);
-
-    std::set<cmStdString> seenProps = cge->GetSeenTargetProperties();
-    for (std::set<cmStdString>::const_iterator it = seenProps.begin();
-        it != seenProps.end(); ++it)
-      {
-      if (!this->GetProperty(it->c_str()))
-        {
-        this->Target->LinkImplicitNullProperties.insert(*it);
-        }
-      }
-    }
-}
-
-//----------------------------------------------------------------------------
-void cmGeneratorTarget::GetInterfaceLinkLibraries(const char *config,
-                        std::vector<std::string> &libs, cmTarget *head) const
-{
-  const char *prop = this->GetProperty("INTERFACE_LINK_LIBRARIES");
-  if (prop)
-    {
-    cmListFileBacktrace lfbt;
-    cmGeneratorExpression ge(lfbt);
-    const cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
-
-    cmGeneratorExpressionDAGChecker dagChecker(lfbt,
-                                        this->GetName(),
-                                        "INTERFACE_LINK_LIBRARIES", 0, 0);
-    cmSystemTools::ExpandListArgument(cge->Evaluate(this->Makefile,
-                                        config,
-                                        false,
-                                        head,
-                                        &dagChecker),
-                                      libs);
-    }
-}
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index adc2414..17a223a 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -13,9 +13,7 @@
 #define cmGeneratorTarget_h
 
 #include "cmStandardIncludes.h"
-#include "cmGeneratorExpression.h"
 
-class cmComputeLinkInformation;
 class cmCustomCommand;
 class cmGlobalGenerator;
 class cmLocalGenerator;
@@ -23,31 +21,10 @@ class cmMakefile;
 class cmSourceFile;
 class cmTarget;
 
-struct cmTargetLinkInformationMap:
-  public std::map<std::pair<cmTarget const*, std::string>,
-                           cmComputeLinkInformation*>
-{
-  typedef std::map<std::pair<cmTarget const*, std::string>,
-                   cmComputeLinkInformation*> derived;
-  cmTargetLinkInformationMap() {}
-  cmTargetLinkInformationMap(cmTargetLinkInformationMap const& r);
-  ~cmTargetLinkInformationMap();
-};
-
-struct TargetConfigPair : public std::pair<cmTarget const*, std::string> {
-  TargetConfigPair(cmTarget const* tgt, const std::string &config)
-    : std::pair<cmTarget const*, std::string>(tgt, config) {}
-};
-
 class cmGeneratorTarget
 {
 public:
   cmGeneratorTarget(cmTarget*);
-  ~cmGeneratorTarget();
-
-  bool IsImported() const;
-  const char *GetLocation(const char* config) const;
-  const char *NormalGetLocation(const char* config) const;
 
   int GetType() const;
   const char *GetName() const;
@@ -70,53 +47,6 @@ public:
   void GetCustomCommands(std::vector<cmSourceFile*>&) const;
   void GetExpectedResxHeaders(std::set<std::string>&) const;
 
-  /** Get the full path to the target according to the settings in its
-      makefile and the configuration type.  */
-  std::string GetFullPath(const char* config=0, bool implib = false,
-                          bool realname = false) const;
-  std::string NormalGetFullPath(const char* config, bool implib,
-                                bool realname) const;
-  std::string NormalGetRealName(const char* config) const;
-
-  /** Get the full name of the target according to the settings in its
-      makefile.  */
-  std::string GetFullName(const char* config=0, bool implib = false) const;
-
-  /** @return the Mac framework directory without the base. */
-  std::string GetFrameworkDirectory(const char* config, bool rootDir) const;
-
-  /** @return the Mac CFBundle directory without the base */
-  std::string GetCFBundleDirectory(const char* config, bool contentOnly) const;
-
-  /** @return the Mac App directory without the base */
-  std::string GetAppBundleDirectory(const char* config,
-                                    bool contentOnly) const;
-
-  /** Return the install name directory for the target in the
-    * build tree.  For example: "\@rpath/", "\@loader_path/",
-    * or "/full/path/to/library".  */
-  std::string GetInstallNameDirForBuildTree(const char* config) const;
-
-  /** Return the install name directory for the target in the
-    * install tree.  For example: "\@rpath/" or "\@loader_path/". */
-  std::string GetInstallNameDirForInstallTree() const;
-
-  /** Get the soname of the target.  Allowed only for a shared library.  */
-  std::string GetSOName(const char* config) const;
-
-  void GetFullNameComponents(std::string& prefix,
-                             std::string& base, std::string& suffix,
-                             const char* config=0, bool implib = false) const;
-
-  /** Append to @a base the mac content directory and return it. */
-  std::string BuildMacContentDirectory(const std::string& base,
-                                       const char* config = 0,
-                                       bool contentOnly = true) const;
-
-  /** @return the mac content directory for this target. */
-  std::string GetMacContentDirectory(const char* config = 0,
-                                     bool implib = false) const;
-
   cmTarget* Target;
   cmMakefile* Makefile;
   cmLocalGenerator* LocalGenerator;
@@ -124,22 +54,6 @@ public:
 
   std::string ModuleDefinitionFile;
 
-  /** Link information from the transitive closure of the link
-      implementation and the interfaces of its dependencies.  */
-  struct LinkClosure
-  {
-    // The preferred linker language.
-    std::string LinkerLanguage;
-
-    // Languages whose runtime libraries must be linked.
-    std::vector<std::string> Languages;
-  };
-
-  LinkClosure const* GetLinkClosure(const char* config,
-                                    cmTarget const* head) const;
-  void ComputeLinkClosure(const char* config, LinkClosure& lc,
-                          cmTarget const* head) const;
-
   /** Full path with trailing slash to the top-level directory
       holding object files for this target.  Includes the build
       time config name placeholder if needed for the generator.  */
@@ -147,40 +61,6 @@ public:
 
   void UseObjectLibraries(std::vector<std::string>& objs) const;
 
-  mutable cmTargetLinkInformationMap LinkInformation;
-
-  cmComputeLinkInformation* GetLinkInformation(const char* config,
-                                               cmTarget const* head = 0) const;
-
-  bool IsLinkInterfaceDependentBoolProperty(const std::string &p,
-                                            const char *config) const;
-  bool IsLinkInterfaceDependentStringProperty(const std::string &p,
-                                              const char *config) const;
-  bool IsLinkInterfaceDependentNumberMinProperty(const std::string &p,
-                                                 const char *config) const;
-  bool IsLinkInterfaceDependentNumberMaxProperty(const std::string &p,
-                                                 const char *config) const;
-
-  bool GetLinkInterfaceDependentBoolProperty(const std::string &p,
-                                             const char *config) const;
-  const char *GetLinkInterfaceDependentStringProperty(const std::string &p,
-                                                    const char *config) const;
-  const char *GetLinkInterfaceDependentNumberMinProperty(const std::string &p,
-                                                    const char *config) const;
-  const char *GetLinkInterfaceDependentNumberMaxProperty(const std::string &p,
-                                                    const char *config) const;
-
-  void CheckPropertyCompatibility(cmComputeLinkInformation *info,
-                                  const char* config) const;
-
-  cmMakefile* GetMakefile() const;
-
-  /** Whether this library has \@rpath and platform supports it.  */
-  bool HasMacOSXRpathInstallNameDir(const char* config) const;
-
-  /** Whether this library defaults to \@rpath.  */
-  bool MacOSXRpathInstallNameDirDefault() const;
-
   void GetAppleArchs(const char* config,
                      std::vector<std::string>& archVec) const;
 
@@ -202,136 +82,18 @@ public:
    */
   void TraceDependencies();
 
-  /** The link interface specifies transitive library dependencies and
-      other information needed by targets that link to this target.  */
-  struct LinkInterface
-  {
-    // Languages whose runtime libraries must be linked.
-    std::vector<std::string> Languages;
-
-    // Libraries listed in the interface.
-    std::vector<std::string> Libraries;
-
-    // Shared library dependencies needed for linking on some platforms.
-    std::vector<std::string> SharedDeps;
-
-    // Number of repetitions of a strongly connected component of two
-    // or more static libraries.
-    int Multiplicity;
-
-    bool ImplementationIsInterface;
-
-    LinkInterface(): Multiplicity(0), ImplementationIsInterface(false) {}
-  };
-
-  // Cache link interface computation from each configuration.
-  struct OptionalLinkInterface: public LinkInterface
-  {
-    OptionalLinkInterface(): Exists(false) {}
-    bool Exists;
-  };
-  typedef std::map<TargetConfigPair, OptionalLinkInterface>
-                                                        LinkInterfaceMapType;
-
-  /** Get the link interface for the given configuration.  Returns 0
-      if the target cannot be linked.  */
-  LinkInterface const* GetLinkInterface(const char* config,
-                                        cmTarget const*) const;
-  void GetTransitivePropertyLinkLibraries(const char* config,
-                                        cmTarget const *headTarget,
-                                        std::vector<std::string> &libs) const;
-
-  bool ComputeLinkInterface(const char* config, LinkInterface& iface,
-                                    cmTarget const*headTarget) const;
-
   void ClassifySources();
   void LookupObjectLibraries();
 
   /** Get sources that must be built before the given source.  */
   std::vector<cmSourceFile*> const* GetSourceDepends(cmSourceFile* sf) const;
 
-  /** Get the name of the pdb file for the target.  */
-  std::string GetPDBName(const char* config=0) const;
-
-  /** Whether this library has soname enabled and platform supports it.  */
-  bool HasSOName(const char* config) const;
-
-  struct TargetPropertyEntry {
-    TargetPropertyEntry(cmsys::auto_ptr<cmCompiledGeneratorExpression> cge,
-      const std::string &targetName = std::string())
-      : ge(cge), TargetName(targetName)
-    {}
-    const cmsys::auto_ptr<cmCompiledGeneratorExpression> ge;
-    std::vector<std::string> CachedEntries;
-    const std::string TargetName;
-  };
-
-  void ReportPropertyOrigin(const std::string &p,
-                            const std::string &result,
-                            const std::string &report,
-                            const std::string &compatibilityType) const;
-
-  void GetAutoUicOptions(std::vector<std::string> &result,
-                         const char *config) const;
-
-  /** Get the names of the executable needed to generate a build rule
-      that takes into account executable version numbers.  This should
-      be called only on an executable target.  */
-  void GetExecutableNames(std::string& name, std::string& realName,
-                          std::string& impName,
-                          std::string& pdbName, const char* config) const;
-
-  /** Get the names of the library needed to generate a build rule
-      that takes into account shared library version numbers.  This
-      should be called only on a library target.  */
-  void GetLibraryNames(std::string& name, std::string& soName,
-                       std::string& realName, std::string& impName,
-                       std::string& pdbName, const char* config) const;
-
-  /**
-   * Compute whether this target must be relinked before installing.
-   */
-  bool NeedRelinkBeforeInstall(const char* config) const;
-
-  /** Return true if builtin chrpath will work for this target */
-  bool IsChrpathUsed(const char* config) const;
-
-  ///! Return the preferred linker language for this target
-  const char* GetLinkerLanguage(const char* config = 0,
-                                cmTarget const* head = 0) const;
-
-  /** The link implementation specifies the direct library
-      dependencies needed by the object files of the target.  */
-  struct LinkImplementation
-  {
-    // Languages whose runtime libraries must be linked.
-    std::vector<std::string> Languages;
-
-    // Libraries linked directly in this configuration.
-    std::vector<std::string> Libraries;
-  };
-  typedef std::map<cmStdString, LinkImplementation> LinkImplMapType;
-
-  LinkImplementation const* GetLinkImplementation(const char* config,
-                                                  cmTarget const* head) const;
-
-  bool HaveBuildTreeRPATH(const char *config) const;
-  bool HaveInstallTreeRPATH() const;
-
-  void GetDirectLinkLibraries(const char *config,
-                              std::vector<std::string> &,
-                              cmTarget const* head) const;
-  void GetInterfaceLinkLibraries(const char *config,
-                              std::vector<std::string> &,
-                              cmTarget *head) const;
-
-  std::string GetOutputName(const char* config, bool implib) const;
-
 private:
   friend class cmTargetTraceDependencies;
   struct SourceEntry { std::vector<cmSourceFile*> Depends; };
   typedef std::map<cmSourceFile*, SourceEntry> SourceEntriesType;
   SourceEntriesType SourceEntries;
+
   std::vector<cmSourceFile*> CustomCommands;
   std::vector<cmSourceFile*> ExtraSources;
   std::vector<cmSourceFile*> HeaderSources;
@@ -344,32 +106,6 @@ private:
   std::vector<cmSourceFile*> ObjectSources;
   std::vector<cmTarget*> ObjectLibraries;
   mutable std::map<std::string, std::vector<std::string> > SystemIncludesCache;
-  mutable bool DebugIncludesDone;
-  mutable std::map<std::string, std::vector<TargetPropertyEntry*> >
-                                CachedLinkInterfaceIncludeDirectoriesEntries;
-  mutable std::map<std::string, bool> CacheLinkInterfaceIncludeDirectoriesDone;
-  mutable std::map<std::string, bool> DebugCompatiblePropertiesDone;
-  mutable LinkInterfaceMapType LinkInterfaceMap;
-  mutable bool PolicyWarnedCMP0022;
-  mutable LinkImplMapType LinkImplMap;
-
-  std::string GetFullNameInternal(const char* config, bool implib) const;
-  void GetFullNameInternal(const char* config, bool implib,
-                           std::string& outPrefix, std::string& outBase,
-                           std::string& outSuffix) const;
-  void ComputeLinkImplementation(const char* config,
-                                 LinkImplementation& impl,
-                                 cmTarget const* head) const;
-
-  void ComputeVersionedName(std::string& vName,
-                            std::string const& prefix,
-                            std::string const& base,
-                            std::string const& suffix,
-                            std::string const& name,
-                            const char* version) const;
-
-  typedef std::map<TargetConfigPair, LinkClosure> LinkClosureMapType;
-  mutable LinkClosureMapType LinkClosureMap;
 
   cmGeneratorTarget(cmGeneratorTarget const&);
   void operator=(cmGeneratorTarget const&);
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index a9fa501..f883fbe 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -195,6 +195,21 @@ cmGlobalGenerator::AddBuildExportExportSet(cmExportBuildFileGenerator* gen)
   this->BuildExportExportSets[gen->GetMainExportFileName()] = gen;
 }
 
+bool cmGlobalGenerator::GenerateImportFile(const std::string &file)
+{
+  std::map<std::string, cmExportBuildFileGenerator*>::iterator it
+                                          = this->BuildExportSets.find(file);
+  if (it != this->BuildExportSets.end())
+    {
+    bool result = it->second->GenerateImportFile();
+    delete it->second;
+    it->second = 0;
+    this->BuildExportSets.erase(it);
+    return result;
+    }
+  return false;
+}
+
 bool
 cmGlobalGenerator::IsExportedTargetsFile(const std::string &filename) const
 {
@@ -948,20 +963,19 @@ void cmGlobalGenerator::ClearEnabledLanguages()
 }
 
 bool cmGlobalGenerator::IsDependedOn(const char* project,
-                                     cmGeneratorTarget const* targetIn)
+                                     cmTarget const* targetIn)
 {
   // Get all local gens for this project
   std::vector<cmLocalGenerator*>* gens = &this->ProjectMap[project];
   // loop over local gens and get the targets for each one
   for(unsigned int i = 0; i < gens->size(); ++i)
     {
-    const cmGeneratorTargetsType& targets = (*gens)[i]->GetMakefile()
-                                                      ->GetGeneratorTargets();
-    for (cmGeneratorTargetsType::const_iterator l = targets.begin();
+    cmTargets& targets = (*gens)[i]->GetMakefile()->GetTargets();
+    for (cmTargets::iterator l = targets.begin();
          l != targets.end(); l++)
       {
-      cmGeneratorTarget *target = l->second;
-      TargetDependSet const& tgtdeps = this->GetTargetDirectDepends(*target);
+      cmTarget& target = l->second;
+      TargetDependSet const& tgtdeps = this->GetTargetDirectDepends(target);
       if(tgtdeps.count(targetIn))
         {
         return true;
@@ -1127,7 +1141,6 @@ void cmGlobalGenerator::Generate()
 
   // Create per-target generator information.
   this->CreateGeneratorTargets();
-  this->ForceLinkerLanguages();
 
 #ifdef CMAKE_BUILD_WITH_CMAKE
   for (AutogensType::iterator it = autogens.begin(); it != autogens.end();
@@ -1235,9 +1248,9 @@ bool cmGlobalGenerator::ComputeTargetDepends()
     {
     return false;
     }
-  std::vector<cmGeneratorTarget const*> const& targets = ctd.GetTargets();
-  for(std::vector<cmGeneratorTarget const*>::const_iterator ti
-      = targets.begin(); ti != targets.end(); ++ti)
+  std::vector<cmTarget const*> const& targets = ctd.GetTargets();
+  for(std::vector<cmTarget const*>::const_iterator ti = targets.begin();
+      ti != targets.end(); ++ti)
     {
     ctd.GetTargetDirectDepends(*ti, this->TargetDependencies[*ti]);
     }
@@ -1501,6 +1514,29 @@ void cmGlobalGenerator::CheckLocalGenerators()
         {
         continue;
         }
+      const cmTarget::LinkLibraryVectorType& libs =
+        l->second.GetOriginalLinkLibraries();
+      for(cmTarget::LinkLibraryVectorType::const_iterator lib = libs.begin();
+          lib != libs.end(); ++lib)
+        {
+        if(lib->first.size() > 9 &&
+           cmSystemTools::IsNOTFOUND(lib->first.c_str()))
+          {
+          std::string varName = lib->first.substr(0, lib->first.size()-9);
+          cmCacheManager::CacheIterator it =
+            manager->GetCacheIterator(varName.c_str());
+          if(it.GetPropertyAsBool("ADVANCED"))
+            {
+            varName += " (ADVANCED)";
+            }
+          std::string text = notFoundMap[varName];
+          text += "\n    linked by target \"";
+          text += l->second.GetName();
+          text += "\" in directory ";
+          text+=this->LocalGenerators[i]->GetMakefile()->GetCurrentDirectory();
+          notFoundMap[varName] = text;
+          }
+        }
       std::vector<std::string> incs;
       const char *incDirProp = l->second.GetProperty("INCLUDE_DIRECTORIES");
       if (!incDirProp)
@@ -1952,27 +1988,25 @@ void cmGlobalGenerator::FillLocalGeneratorToTargetMap()
     {
     cmLocalGenerator* lg = *lgi;
     cmMakefile* mf = lg->GetMakefile();
-    const cmGeneratorTargetsType& targets = mf->GetGeneratorTargets();
-    for(cmGeneratorTargetsType::const_iterator t = targets.begin();
-        t != targets.end(); ++t)
+    cmTargets& targets = mf->GetTargets();
+    for(cmTargets::iterator t = targets.begin(); t != targets.end(); ++t)
       {
-      cmGeneratorTarget* target = t->second;
+      cmTarget& target = t->second;
 
       // Consider the directory containing the target and all its
       // parents until something excludes the target.
-      for(cmLocalGenerator* clg = lg;
-          clg && !this->IsExcluded(clg, *target->Target);
+      for(cmLocalGenerator* clg = lg; clg && !this->IsExcluded(clg, target);
           clg = clg->GetParent())
         {
         // This local generator includes the target.
         std::set<cmTarget const*>& targetSet =
           this->LocalGeneratorToTargetMap[clg];
-        targetSet.insert(target->Target);
+        targetSet.insert(&target);
 
         // Add dependencies of the included target.  An excluded
         // target may still be included if it is a dependency of a
         // non-excluded target.
-        TargetDependSet const& tgtdeps = this->GetTargetDirectDepends(*target);
+        TargetDependSet const& tgtdeps = this->GetTargetDirectDepends(target);
         for(TargetDependSet::const_iterator ti = tgtdeps.begin();
             ti != tgtdeps.end(); ++ti)
           {
@@ -2059,18 +2093,6 @@ cmGlobalGenerator::FindTarget(const char* project, const char* name,
   return 0;
 }
 
-
-//----------------------------------------------------------------------------
-cmGeneratorTarget*
-cmGlobalGenerator::FindGeneratorTarget(const char* project, const char* name)
-{
-  if (cmTarget *t = this->FindTarget(project, name))
-    {
-    return this->GetGeneratorTarget(t);
-    }
-  return 0;
-}
-
 //----------------------------------------------------------------------------
 bool
 cmGlobalGenerator::NameResolvesToFramework(const std::string& libname) const
@@ -2509,7 +2531,7 @@ void cmGlobalGenerator::AppendDirectoryForConfig(const char*, const char*,
 
 //----------------------------------------------------------------------------
 cmGlobalGenerator::TargetDependSet const&
-cmGlobalGenerator::GetTargetDirectDepends(cmGeneratorTarget const& target)
+cmGlobalGenerator::GetTargetDirectDepends(cmTarget const& target)
 {
   return this->TargetDependencies[&target];
 }
@@ -2605,19 +2627,18 @@ void cmGlobalGenerator::GetTargetSets(TargetDependSet& projectTargets,
       }
     cmMakefile* mf = (*i)->GetMakefile();
     // Get the targets in the makefile
-    const cmGeneratorTargetsType &tgts = mf->GetGeneratorTargets();
+    cmTargets &tgts = mf->GetTargets();
     // loop over all the targets
-    for (cmGeneratorTargetsType::const_iterator l = tgts.begin();
-         l != tgts.end(); ++l)
+    for (cmTargets::iterator l = tgts.begin(); l != tgts.end(); ++l)
       {
-      cmGeneratorTarget* target = l->second;
-      if(this->IsRootOnlyTarget(target->Target) &&
-         target->Target->GetMakefile() != root->GetMakefile())
+      cmTarget* target = &l->second;
+      if(this->IsRootOnlyTarget(target) &&
+         target->GetMakefile() != root->GetMakefile())
         {
         continue;
         }
       // put the target in the set of original targets
-      originalTargets.insert(target->Target);
+      originalTargets.insert(target);
       // Get the set of targets that depend on target
       this->AddTargetDepends(target, projectTargets);
       }
@@ -2632,7 +2653,7 @@ bool cmGlobalGenerator::IsRootOnlyTarget(cmTarget* target)
 }
 
 //----------------------------------------------------------------------------
-void cmGlobalGenerator::AddTargetDepends(cmGeneratorTarget const* target,
+void cmGlobalGenerator::AddTargetDepends(cmTarget const* target,
                                          TargetDependSet& projectTargets)
 {
   // add the target itself
@@ -2644,11 +2665,7 @@ void cmGlobalGenerator::AddTargetDepends(cmGeneratorTarget const* target,
     for(TargetDependSet::const_iterator i = ts.begin(); i != ts.end(); ++i)
       {
       cmTarget const* dtarget = *i;
-      cmGeneratorTarget *gtgt = dtarget->GetMakefile()->GetLocalGenerator()
-                                ->GetGlobalGenerator()
-                                ->GetGeneratorTarget(dtarget);
-
-      this->AddTargetDepends(gtgt, projectTargets);
+      this->AddTargetDepends(dtarget, projectTargets);
       }
     }
 }
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index b3f6827..fc5cab9 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -211,8 +211,6 @@ public:
 
   void AddAlias(const char *name, cmTarget *tgt);
   bool IsAlias(const char *name) const;
-  cmGeneratorTarget* FindGeneratorTarget(const char* project,
-                                         const char* name);
 
   /** Determine if a name resolves to a framework on disk or a built target
       that is a framework. */
@@ -220,7 +218,7 @@ public:
 
   /** If check to see if the target is linked to by any other
       target in the project */
-  bool IsDependedOn(const char* project, cmGeneratorTarget const* target);
+  bool IsDependedOn(const char* project, cmTarget const* target);
   ///! Find a local generator by its startdirectory
   cmLocalGenerator* FindLocalGenerator(const char* start_dir);
 
@@ -268,8 +266,7 @@ public:
 
   // what targets does the specified target depend on directly
   // via a target_link_libraries or add_dependencies
-  TargetDependSet const&
-  GetTargetDirectDepends(cmGeneratorTarget const& target);
+  TargetDependSet const& GetTargetDirectDepends(cmTarget const& target);
 
   /** Get per-target generator information.  */
   cmGeneratorTarget* GetGeneratorTarget(cmTarget const*) const;
@@ -316,6 +313,7 @@ public:
   void AddBuildExportSet(cmExportBuildFileGenerator*);
   void AddBuildExportExportSet(cmExportBuildFileGenerator*);
   bool IsExportedTargetsFile(const std::string &filename) const;
+  bool GenerateImportFile(const std::string &file);
   cmExportBuildFileGenerator*
   GetExportedTargetsFile(const std::string &filename) const;
   void AddCMP0042WarnTarget(const std::string& target);
@@ -328,7 +326,7 @@ protected:
                              TargetDependSet& originalTargets,
                              cmLocalGenerator* root, GeneratorVector const&);
   virtual bool IsRootOnlyTarget(cmTarget* target);
-  void AddTargetDepends(cmGeneratorTarget const* target,
+  void AddTargetDepends(cmTarget const* target,
                         TargetDependSet& projectTargets);
   void SetLanguageEnabledFlag(const char* l, cmMakefile* mf);
   void SetLanguageEnabledMaps(const char* l, cmMakefile* mf);
@@ -415,8 +413,6 @@ private:
   void CheckRuleHashes(std::string const& pfile, std::string const& home);
   void WriteRuleHashes(std::string const& pfile);
 
-  virtual void ForceLinkerLanguages() {}
-
   void WriteSummary();
   void WriteSummary(cmTarget* target);
   void FinalizeTargetCompileInfo();
@@ -431,7 +427,7 @@ private:
   std::vector<std::string> FilesReplacedDuringGenerate;
 
   // Store computed inter-target dependencies.
-  typedef std::map<cmGeneratorTarget const*, TargetDependSet> TargetDependMap;
+  typedef std::map<cmTarget const*, TargetDependSet> TargetDependMap;
   TargetDependMap TargetDependencies;
 
   // Per-target generator information.
diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx
index c6fcf4e..ed0e15b 100644
--- a/Source/cmGlobalKdevelopGenerator.cxx
+++ b/Source/cmGlobalKdevelopGenerator.cxx
@@ -70,18 +70,13 @@ void cmGlobalKdevelopGenerator::Generate()
          lg!=lgs.end(); lg++)
       {
       cmMakefile* makefile=(*lg)->GetMakefile();
-      cmGeneratorTargetsType targets=makefile->GetGeneratorTargets();
-      for (cmGeneratorTargetsType::iterator ti = targets.begin();
+      cmTargets& targets=makefile->GetTargets();
+      for (cmTargets::iterator ti = targets.begin();
            ti != targets.end(); ti++)
         {
-        if (ti->second->IsImported())
+        if (ti->second.GetType()==cmTarget::EXECUTABLE)
           {
-          continue;
-          }
-
-        if (ti->second->GetType()==cmTarget::EXECUTABLE)
-          {
-          executable = ti->second->GetLocation(0);
+          executable = ti->second.GetLocation(0);
           break;
           }
         }
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 631962f..ec91b0f 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -850,14 +850,10 @@ cmGlobalNinjaGenerator
   case cmTarget::SHARED_LIBRARY:
   case cmTarget::STATIC_LIBRARY:
   case cmTarget::MODULE_LIBRARY:
-    {
-    cmGeneratorTarget *gtgt = target->GetMakefile()->GetLocalGenerator()
-                                    ->GetGlobalGenerator()
-                                    ->GetGeneratorTarget(target);
     outputs.push_back(ng->ConvertToNinjaPath(
-      gtgt->GetFullPath(configName, false, realname).c_str()));
+      target->GetFullPath(configName, false, realname).c_str()));
     break;
-    }
+
   case cmTarget::OBJECT_LIBRARY:
   case cmTarget::UTILITY: {
     std::string path = ng->ConvertToNinjaPath(
@@ -893,12 +889,8 @@ cmGlobalNinjaGenerator
     std::set<cmStdString> const& utils = target->GetUtilities();
     std::copy(utils.begin(), utils.end(), std::back_inserter(outputs));
   } else {
-    cmGeneratorTarget *gtgt = target->GetMakefile()->GetLocalGenerator()
-                                    ->GetGlobalGenerator()
-                                    ->GetGeneratorTarget(target);
-
     cmTargetDependSet const& targetDeps =
-      this->GetTargetDirectDepends(*gtgt);
+      this->GetTargetDirectDepends(*target);
     for (cmTargetDependSet::const_iterator i = targetDeps.begin();
          i != targetDeps.end(); ++i)
       {
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index e328589..0b37a07 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -491,7 +491,7 @@ cmGlobalUnixMakefileGenerator3
       // Add this to the list of depends rules in this directory.
       if((!check_all || !l->second->GetPropertyAsBool("EXCLUDE_FROM_ALL")) &&
          (!check_relink ||
-          l->second
+          l->second->Target
                    ->NeedRelinkBeforeInstall(lg->ConfigurationName.c_str())))
         {
         std::string tname = lg->GetRelativeTargetDirectory(*l->second->Target);
@@ -698,8 +698,9 @@ cmGlobalUnixMakefileGenerator3
                           localName.c_str(), depends, commands, true);
 
         // Add a local name for the rule to relink the target before
-        // installation.-
-        if(t->second->NeedRelinkBeforeInstall(lg->ConfigurationName.c_str()))
+        // installation.
+        if(t->second->Target
+                    ->NeedRelinkBeforeInstall(lg->ConfigurationName.c_str()))
           {
           makeTargetName = lg->GetRelativeTargetDirectory(*t->second->Target);
           makeTargetName += "/preinstall";
@@ -876,7 +877,8 @@ cmGlobalUnixMakefileGenerator3
                         t->second->GetName(), depends, commands, true);
 
       // Add rules to prepare the target for installation.
-      if(t->second->NeedRelinkBeforeInstall(lg->ConfigurationName.c_str()))
+      if(t->second->Target
+                  ->NeedRelinkBeforeInstall(lg->ConfigurationName.c_str()))
         {
         localName = lg->GetRelativeTargetDirectory(*t->second->Target);
         localName += "/preinstall";
@@ -926,12 +928,7 @@ cmGlobalUnixMakefileGenerator3
   if(emitted.insert(target).second)
     {
     count = this->ProgressMap[target].Marks.size();
-
-    cmGeneratorTarget *gtgt = target->GetMakefile()->GetLocalGenerator()
-                                    ->GetGlobalGenerator()
-                                    ->GetGeneratorTarget(target);
-
-    TargetDependSet const& depends = this->GetTargetDirectDepends(*gtgt);
+    TargetDependSet const& depends = this->GetTargetDirectDepends(*target);
     for(TargetDependSet::const_iterator di = depends.begin();
         di != depends.end(); ++di)
       {
@@ -1020,11 +1017,7 @@ cmGlobalUnixMakefileGenerator3
 ::AppendGlobalTargetDepends(std::vector<std::string>& depends,
                             cmTarget& target)
 {
-  cmGeneratorTarget *gtgt = target.GetMakefile()->GetLocalGenerator()
-                                  ->GetGlobalGenerator()
-                                  ->GetGeneratorTarget(&target);
-
-  TargetDependSet const& depends_set = this->GetTargetDirectDepends(*gtgt);
+  TargetDependSet const& depends_set = this->GetTargetDirectDepends(target);
   for(TargetDependSet::const_iterator i = depends_set.begin();
       i != depends_set.end(); ++i)
     {
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 26e5c2a..f7a42fc 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -346,6 +346,7 @@ void cmGlobalXCodeGenerator::Generate()
     // add ALL_BUILD, INSTALL, etc
     this->AddExtraTargets(root, it->second);
     }
+  this->ForceLinkerLanguages();
   this->cmGlobalGenerator::Generate();
   if(cmSystemTools::GetErrorOccuredFlag())
     {
@@ -1236,13 +1237,12 @@ void cmGlobalXCodeGenerator::ForceLinkerLanguage(cmTarget& cmtarget)
     return;
     }
 
-  cmGeneratorTarget *gtgt = this->GetGeneratorTarget(&cmtarget);
-  const char* llang = gtgt->GetLinkerLanguage("NOCONFIG");
+  const char* llang = cmtarget.GetLinkerLanguage("NOCONFIG");
   if(!llang) { return; }
 
   // If the language is compiled as a source trust Xcode to link with it.
-  cmGeneratorTarget::LinkImplementation const* impl =
-    gtgt->GetLinkImplementation("NOCONFIG", &cmtarget);
+  cmTarget::LinkImplementation const* impl =
+    cmtarget.GetLinkImplementation("NOCONFIG", &cmtarget);
   for(std::vector<std::string>::const_iterator li = impl->Languages.begin();
       li != impl->Languages.end(); ++li)
     {
@@ -1710,8 +1710,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
                  (target.GetType() == cmTarget::EXECUTABLE) ||
                  shared);
 
-  cmGeneratorTarget *gtgt = this->GetGeneratorTarget(&target);
-  const char* lang = gtgt->GetLinkerLanguage(configName);
+  const char* lang = target.GetLinkerLanguage(configName);
   std::string cflags;
   if(lang)
     {
@@ -1763,6 +1762,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
     // Add the export symbol definition for shared library objects.
     this->AppendDefines(ppDefs, exportMacro);
     }
+  cmGeneratorTarget *gtgt = this->GetGeneratorTarget(&target);
   std::vector<std::string> targetDefines;
   target.GetCompileDefinitions(targetDefines, configName);
   this->AppendDefines(ppDefs, targetDefines);
@@ -1852,11 +1852,11 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
   std::string pnprefix;
   std::string pnbase;
   std::string pnsuffix;
-  gtgt->GetFullNameComponents(pnprefix, pnbase, pnsuffix, configName);
+  target.GetFullNameComponents(pnprefix, pnbase, pnsuffix, configName);
 
   const char* version = target.GetProperty("VERSION");
   const char* soversion = target.GetProperty("SOVERSION");
-  if(!gtgt->HasSOName(configName) || target.IsFrameworkOnApple())
+  if(!target.HasSOName(configName) || target.IsFrameworkOnApple())
     {
     version = 0;
     soversion = 0;
@@ -2114,7 +2114,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
       }
     }
   // Add framework search paths needed for linking.
-  if(cmComputeLinkInformation* cli = gtgt->GetLinkInformation(configName))
+  if(cmComputeLinkInformation* cli = target.GetLinkInformation(configName))
     {
     std::vector<std::string> const& fwDirs = cli->GetFrameworkPaths();
     for(std::vector<std::string>::const_iterator fdi = fwDirs.begin();
@@ -2237,7 +2237,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
   if(target.GetType() == cmTarget::SHARED_LIBRARY)
     {
     // Get the install_name directory for the build tree.
-    install_name_dir = gtgt->GetInstallNameDirForBuildTree(configName);
+    install_name_dir = target.GetInstallNameDirForBuildTree(configName);
     // Xcode doesn't create the correct install_name in some cases.
     // That is, if the INSTALL_PATH is empty, or if we have versioning
     // of dylib libraries, we want to specify the install_name.
@@ -2251,7 +2251,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
       install_name += install_name_dir;
       install_name += "/";
       }
-    install_name += gtgt->GetSOName(configName);
+    install_name += target.GetSOName(configName);
 
     if((realName != soName) || install_name_dir.empty())
       {
@@ -2264,7 +2264,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
                               this->CreateString(install_name_dir.c_str()));
 
   // Create the LD_RUNPATH_SEARCH_PATHS
-  cmComputeLinkInformation* pcli = gtgt->GetLinkInformation(configName);
+  cmComputeLinkInformation* pcli = target.GetLinkInformation(configName);
   if(pcli)
     {
     std::string search_paths;
@@ -2609,8 +2609,7 @@ cmGlobalXCodeGenerator::CreateXCodeTarget(cmTarget& cmtarget,
     }
   else
     {
-    cmGeneratorTarget *gtgt = this->GetGeneratorTarget(&cmtarget);
-    fullName = gtgt->GetFullName(defConfig.c_str());
+    fullName = cmtarget.GetFullName(defConfig.c_str());
     }
   fileRef->AddAttribute("path", this->CreateString(fullName.c_str()));
   fileRef->AddAttribute("refType", this->CreateString("0"));
@@ -2835,8 +2834,7 @@ void cmGlobalXCodeGenerator
       }
 
     // Compute the link library and directory information.
-    cmGeneratorTarget* gtgt = this->GetGeneratorTarget(cmtarget);
-    cmComputeLinkInformation* pcli = gtgt->GetLinkInformation(configName);
+    cmComputeLinkInformation* pcli = cmtarget->GetLinkInformation(configName);
     if(!pcli)
       {
       continue;
@@ -3503,7 +3501,6 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
       {
       cmXCodeObject* target = *i;
       cmTarget* t =target->GetTarget();
-      cmGeneratorTarget *gt = this->GetGeneratorTarget(t);
 
       if(t->GetType() == cmTarget::EXECUTABLE ||
 // Nope - no post-build for OBJECT_LIRBRARY
@@ -3521,7 +3518,7 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
          t->GetType() == cmTarget::SHARED_LIBRARY ||
          t->GetType() == cmTarget::MODULE_LIBRARY)
         {
-        std::string tfull = gt->GetFullPath(configName);
+        std::string tfull = t->GetFullPath(configName);
         std::string trel = this->ConvertToRelativeForMake(tfull.c_str());
 
         // Add this target to the post-build phases of its dependencies.
@@ -3572,7 +3569,7 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
             std::string universalFile = universal;
             universalFile += *arch;
             universalFile += "/";
-            universalFile += gt->GetFullName(configName);
+            universalFile += t->GetFullName(configName);
             makefileStream << "\t/bin/rm -f "
                            <<
               this->ConvertToRelativeForMake(universalFile.c_str())
diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx
index 8944c69..3a7070e 100644
--- a/Source/cmGraphVizWriter.cxx
+++ b/Source/cmGraphVizWriter.cxx
@@ -291,7 +291,6 @@ void cmGraphVizWriter::WriteConnections(const char* targetName,
                                     std::set<std::string>& insertedConnections,
                                     cmGeneratedFileStream& str) const
 {
-  (void)insertedConnections;
   std::map<cmStdString, const cmTarget* >::const_iterator targetPtrIt =
                                              this->TargetPtrs.find(targetName);
 
@@ -310,6 +309,39 @@ void cmGraphVizWriter::WriteConnections(const char* targetName,
 
   std::string myNodeName = this->TargetNamesNodes.find(targetName)->second;
 
+  const cmTarget::LinkLibraryVectorType* ll =
+                            &(targetPtrIt->second->GetOriginalLinkLibraries());
+
+  for (cmTarget::LinkLibraryVectorType::const_iterator llit = ll->begin();
+       llit != ll->end();
+       ++ llit )
+    {
+    const char* libName = llit->first.c_str();
+    std::map<cmStdString, cmStdString>::const_iterator libNameIt =
+                                          this->TargetNamesNodes.find(libName);
+
+    // can happen e.g. if GRAPHVIZ_TARGET_IGNORE_REGEX is used
+    if(libNameIt == this->TargetNamesNodes.end())
+      {
+      continue;
+      }
+
+    std::string connectionName = myNodeName;
+    connectionName += "-";
+    connectionName += libNameIt->second;
+    if (insertedConnections.find(connectionName) == insertedConnections.end())
+      {
+      insertedConnections.insert(connectionName);
+      this->WriteNode(libName, this->TargetPtrs.find(libName)->second,
+                      insertedNodes, str);
+
+      str << "    \"" << myNodeName.c_str() << "\" -> \""
+          << libNameIt->second.c_str() << "\"";
+      str << " // " << targetName << " -> " << libName << std::endl;
+      this->WriteConnections(libName, insertedNodes, insertedConnections, str);
+      }
+    }
+
 }
 
 
@@ -318,7 +350,6 @@ void cmGraphVizWriter::WriteDependerConnections(const char* targetName,
                                     std::set<std::string>& insertedConnections,
                                     cmGeneratedFileStream& str) const
 {
-  (void)insertedConnections;
   std::map<cmStdString, const cmTarget* >::const_iterator targetPtrIt =
                                              this->TargetPtrs.find(targetName);
 
@@ -355,7 +386,45 @@ void cmGraphVizWriter::WriteDependerConnections(const char* targetName,
 
     // Now we have a target, check whether it links against targetName.
     // If so, draw a connection, and then continue with dependers on that one.
+    const cmTarget::LinkLibraryVectorType* ll =
+                            &(dependerIt->second->GetOriginalLinkLibraries());
 
+    for (cmTarget::LinkLibraryVectorType::const_iterator llit = ll->begin();
+         llit != ll->end();
+         ++ llit )
+      {
+      std::string libName = llit->first.c_str();
+      if (libName == targetName)
+        {
+        // So this target links against targetName.
+        std::map<cmStdString, cmStdString>::const_iterator dependerNodeNameIt =
+                                this->TargetNamesNodes.find(dependerIt->first);
+
+        if(dependerNodeNameIt != this->TargetNamesNodes.end())
+          {
+          std::string connectionName = dependerNodeNameIt->second;
+          connectionName += "-";
+          connectionName += myNodeName;
+
+          if (insertedConnections.find(connectionName) ==
+                                                     insertedConnections.end())
+            {
+            insertedConnections.insert(connectionName);
+            this->WriteNode(dependerIt->first.c_str(), dependerIt->second,
+                            insertedNodes, str);
+
+            str << "    \"" << dependerNodeNameIt->second << "\" -> \""
+                << myNodeName << "\"";
+            str << " // " <<targetName<< " -> " <<dependerIt->first<<std::endl;
+            this->WriteDependerConnections(dependerIt->first.c_str(),
+                                      insertedNodes, insertedConnections, str);
+            }
+
+
+          }
+        break;
+        }
+      }
     }
 
 }
@@ -444,6 +513,31 @@ int cmGraphVizWriter::CollectAllExternalLibs(int cnt)
         // Skip ignored targets
         continue;
         }
+      const cmTarget::LinkLibraryVectorType* ll =
+                                     &(tit->second.GetOriginalLinkLibraries());
+      for (cmTarget::LinkLibraryVectorType::const_iterator llit = ll->begin();
+           llit != ll->end();
+           ++ llit )
+        {
+        const char* libName = llit->first.c_str();
+        if (this->IgnoreThisTarget(libName))
+          {
+          // Skip ignored targets
+          continue;
+          }
+
+        std::map<cmStdString, const cmTarget*>::const_iterator tarIt =
+                                                this->TargetPtrs.find(libName);
+        if ( tarIt == this->TargetPtrs.end() )
+          {
+          cmOStringStream ostr;
+          ostr << this->GraphNodePrefix << cnt++;
+          this->TargetNamesNodes[libName] = ostr.str();
+          this->TargetPtrs[libName] = NULL;
+          // str << "    \"" << ostr.c_str() << "\" [ label=\"" << libName
+          // <<  "\" shape=\"ellipse\"];" << std::endl;
+          }
+        }
       }
     }
    return cnt;
diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx
index 8870cf8..e8ee33f 100644
--- a/Source/cmIncludeCommand.cxx
+++ b/Source/cmIncludeCommand.cxx
@@ -97,15 +97,37 @@ bool cmIncludeCommand
                                         ->GetGlobalGenerator();
   if (gg->IsExportedTargetsFile(fname_abs))
     {
-    cmOStringStream e;
-    e << (this->Makefile->GetPolicies()
-          ->GetPolicyWarning(cmPolicies::CMP0024)) << "\n";
-    e << "The file\n  " << fname_abs << "\nwas generated by the export() "
-      "command.  It may not be used as the argument to the "
-      "include() command.  Use ALIAS targets instead to refer to targets "
-      "by alternative names.\n";
-    this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str().c_str());
-    return false;
+    const char *modal = 0;
+    cmake::MessageType messageType = cmake::AUTHOR_WARNING;
+
+    switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0024))
+      {
+      case cmPolicies::WARN:
+        modal = "should";
+      case cmPolicies::OLD:
+        break;
+      case cmPolicies::REQUIRED_IF_USED:
+      case cmPolicies::REQUIRED_ALWAYS:
+      case cmPolicies::NEW:
+        modal = "may";
+        messageType = cmake::FATAL_ERROR;
+      }
+    if (modal)
+      {
+      cmOStringStream e;
+      e << (this->Makefile->GetPolicies()
+            ->GetPolicyWarning(cmPolicies::CMP0024)) << "\n";
+      e << "The file\n  " << fname_abs << "\nwas generated by the export() "
+        "command.  It " << modal << " not be used as the argument to the "
+        "include() command.  Use ALIAS targets instead to refer to targets "
+        "by alternative names.\n";
+      this->Makefile->IssueMessage(messageType, e.str().c_str());
+      if (messageType == cmake::FATAL_ERROR)
+        {
+        return false;
+        }
+      }
+    gg->GenerateImportFile(fname_abs);
     }
 
   std::string fullFilePath;
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index 54aa0b7..68f45a6 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -16,7 +16,6 @@
 #include "cmLocalGenerator.h"
 #include "cmMakefile.h"
 #include "cmake.h"
-#include "cmGeneratorTarget.h"
 
 #include <assert.h>
 
@@ -27,8 +26,7 @@ cmInstallTargetGenerator
                            std::vector<std::string> const& configurations,
                            const char* component, bool optional):
   cmInstallGenerator(dest, configurations, component), Target(&t),
-  ImportLibrary(implib), FilePermissions(file_permissions),
-  Optional(optional), GeneratorTarget(0)
+  ImportLibrary(implib), FilePermissions(file_permissions), Optional(optional)
 {
   this->ActionsPerConfig = true;
   this->NamelinkMode = NamelinkModeNone;
@@ -64,10 +62,9 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os,
                                                        const char* config,
                                                        Indent const& indent)
 {
-  this->CreateGeneratorTarget();
   // Compute the build tree directory from which to copy the target.
   std::string fromDirConfig;
-  if(this->GeneratorTarget->NeedRelinkBeforeInstall(config))
+  if(this->Target->NeedRelinkBeforeInstall(config))
     {
     fromDirConfig = this->Target->GetMakefile()->GetStartOutputDirectory();
     fromDirConfig += cmake::GetCMakeFilesDirectory();
@@ -115,8 +112,7 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os,
     std::string targetNameReal;
     std::string targetNameImport;
     std::string targetNamePDB;
-    this->CreateGeneratorTarget();
-    this->GeneratorTarget->GetExecutableNames(targetName, targetNameReal,
+    this->Target->GetExecutableNames(targetName, targetNameReal,
                                      targetNameImport, targetNamePDB,
                                      config);
     if(this->ImportLibrary)
@@ -176,11 +172,9 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os,
     std::string targetNameReal;
     std::string targetNameImport;
     std::string targetNamePDB;
-    this->CreateGeneratorTarget();
-    this->GeneratorTarget->GetLibraryNames(targetName, targetNameSO,
-                                           targetNameReal,
-                                           targetNameImport, targetNamePDB,
-                                           config);
+    this->Target->GetLibraryNames(targetName, targetNameSO, targetNameReal,
+                                  targetNameImport, targetNamePDB,
+                                  config);
     if(this->ImportLibrary)
       {
       // There is a bug in cmInstallCommand if this fails.
@@ -341,16 +335,13 @@ cmInstallTargetGenerator::GetInstallFilename(cmTarget const* target,
 {
   std::string fname;
   // Compute the name of the library.
-  cmGeneratorTarget *gtgt = target->GetMakefile()->GetLocalGenerator()
-                                  ->GetGlobalGenerator()
-                                  ->GetGeneratorTarget(target);
   if(target->GetType() == cmTarget::EXECUTABLE)
     {
     std::string targetName;
     std::string targetNameReal;
     std::string targetNameImport;
     std::string targetNamePDB;
-    gtgt->GetExecutableNames(targetName, targetNameReal,
+    target->GetExecutableNames(targetName, targetNameReal,
                                targetNameImport, targetNamePDB,
                                config);
     if(nameType == NameImplib)
@@ -380,7 +371,7 @@ cmInstallTargetGenerator::GetInstallFilename(cmTarget const* target,
     std::string targetNameReal;
     std::string targetNameImport;
     std::string targetNamePDB;
-    gtgt->GetLibraryNames(targetName, targetNameSO, targetNameReal,
+    target->GetLibraryNames(targetName, targetNameSO, targetNameReal,
                             targetNameImport, targetNamePDB, config);
     if(nameType == NameImplib)
       {
@@ -497,17 +488,6 @@ void cmInstallTargetGenerator::PostReplacementTweaks(std::ostream& os,
   this->AddStripRule(os, indent, file);
 }
 
-void cmInstallTargetGenerator::CreateGeneratorTarget()
-{
-  if (!this->GeneratorTarget)
-    {
-    this->GeneratorTarget = this->Target->GetMakefile()
-                                        ->GetLocalGenerator()
-                                        ->GetGlobalGenerator()
-                                        ->GetGeneratorTarget(this->Target);
-    }
-}
-
 //----------------------------------------------------------------------------
 void
 cmInstallTargetGenerator
@@ -531,13 +511,10 @@ cmInstallTargetGenerator
     return;
     }
 
-  this->CreateGeneratorTarget();
-
   // Build a map of build-tree install_name to install-tree install_name for
   // shared libraries linked to this target.
   std::map<cmStdString, cmStdString> install_name_remap;
-  if(cmComputeLinkInformation* cli =
-                            this->GeneratorTarget->GetLinkInformation(config))
+  if(cmComputeLinkInformation* cli = this->Target->GetLinkInformation(config))
     {
     std::set<cmTarget const*> const& sharedLibs
                                             = cli->GetSharedLibrariesLinked();
@@ -552,15 +529,11 @@ cmInstallTargetGenerator
         continue;
         }
 
-      cmGeneratorTarget *gtgt = tgt->GetMakefile()
-                                          ->GetLocalGenerator()
-                                          ->GetGlobalGenerator()
-                                          ->GetGeneratorTarget(tgt);
       // If the build tree and install tree use different path
       // components of the install_name field then we need to create a
       // mapping to be applied after installation.
-      std::string for_build = gtgt->GetInstallNameDirForBuildTree(config);
-      std::string for_install = gtgt->GetInstallNameDirForInstallTree();
+      std::string for_build = tgt->GetInstallNameDirForBuildTree(config);
+      std::string for_install = tgt->GetInstallNameDirForInstallTree();
       if(for_build != for_install)
         {
         // The directory portions differ.  Append the filename to
@@ -585,9 +558,9 @@ cmInstallTargetGenerator
   if(this->Target->GetType() == cmTarget::SHARED_LIBRARY)
     {
     std::string for_build =
-      this->GeneratorTarget->GetInstallNameDirForBuildTree(config);
+      this->Target->GetInstallNameDirForBuildTree(config);
     std::string for_install =
-      this->GeneratorTarget->GetInstallNameDirForInstallTree();
+      this->Target->GetInstallNameDirForInstallTree();
 
     if(this->Target->IsFrameworkOnApple() && for_install.empty())
       {
@@ -634,25 +607,21 @@ cmInstallTargetGenerator
 ::AddRPathCheckRule(std::ostream& os, Indent const& indent,
                     const char* config, std::string const& toDestDirPath)
 {
-  this->CreateGeneratorTarget();
-
   // Skip the chrpath if the target does not need it.
-  if(this->ImportLibrary || !this->GeneratorTarget->IsChrpathUsed(config))
+  if(this->ImportLibrary || !this->Target->IsChrpathUsed(config))
     {
     return;
     }
+
   // Skip if on Apple
   if(this->Target->GetMakefile()->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME"))
     {
     return;
     }
 
-  this->CreateGeneratorTarget();
-
   // Get the link information for this target.
   // It can provide the RPATH.
-  cmComputeLinkInformation* cli =
-                            this->GeneratorTarget->GetLinkInformation(config);
+  cmComputeLinkInformation* cli = this->Target->GetLinkInformation(config);
   if(!cli)
     {
     return;
@@ -675,19 +644,15 @@ cmInstallTargetGenerator
 ::AddChrpathPatchRule(std::ostream& os, Indent const& indent,
                       const char* config, std::string const& toDestDirPath)
 {
-  this->CreateGeneratorTarget();
   // Skip the chrpath if the target does not need it.
-  if(this->ImportLibrary || !this->GeneratorTarget->IsChrpathUsed(config))
+  if(this->ImportLibrary || !this->Target->IsChrpathUsed(config))
     {
     return;
     }
 
-  this->CreateGeneratorTarget();
-
   // Get the link information for this target.
   // It can provide the RPATH.
-  cmComputeLinkInformation* cli =
-                            this->GeneratorTarget->GetLinkInformation(config);
+  cmComputeLinkInformation* cli = this->Target->GetLinkInformation(config);
   if(!cli)
     {
     return;
diff --git a/Source/cmInstallTargetGenerator.h b/Source/cmInstallTargetGenerator.h
index 39b310f..18c3957 100644
--- a/Source/cmInstallTargetGenerator.h
+++ b/Source/cmInstallTargetGenerator.h
@@ -14,8 +14,7 @@
 
 #include "cmInstallGenerator.h"
 #include "cmTarget.h"
-
-class cmGeneratorTarget;
+#include "cmGeneratorTarget.h"
 
 /** \class cmInstallTargetGenerator
  * \brief Generate target installation rules.
@@ -95,8 +94,6 @@ protected:
   void AddRanlibRule(std::ostream& os, Indent const& indent,
                      const std::string& toDestDirPath);
 
-  void CreateGeneratorTarget();
-
   cmTarget* Target;
   bool ImportLibrary;
   std::string FilePermissions;
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 8d882ff..3effe38 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -687,7 +687,7 @@ void cmLocalGenerator::AddBuildTargetRule(const char* llang,
   std::string createRule = "CMAKE_";
   createRule += llang;
   createRule += target.GetCreateRuleVariable();
-  std::string targetName = target.GetFullName();
+  std::string targetName = target.Target->GetFullName();
   // Executable :
   // Shared Library:
   // Static Library:
@@ -736,7 +736,7 @@ void cmLocalGenerator::AddBuildTargetRule(const char* llang,
     // Store this command line.
     commandLines.push_back(commandLine);
     }
-  std::string targetFullPath = target.GetFullPath();
+  std::string targetFullPath = target.Target->GetFullPath();
   // Generate a meaningful comment for the command.
   std::string comment = "Linking ";
   comment += llang;
@@ -774,7 +774,7 @@ void cmLocalGenerator
       case cmTarget::MODULE_LIBRARY:
       case cmTarget::EXECUTABLE:
         {
-        const char* llang = target.GetLinkerLanguage();
+        const char* llang = target.Target->GetLinkerLanguage();
         if(!llang)
           {
           cmSystemTools::Error
@@ -1681,7 +1681,7 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
         linkFlags += this->Makefile->GetSafeDefinition(build.c_str());
         linkFlags += " ";
         }
-      const char* linkLanguage = target->GetLinkerLanguage();
+      const char* linkLanguage = target->Target->GetLinkerLanguage();
       if(!linkLanguage)
         {
         cmSystemTools::Error
@@ -1791,7 +1791,7 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries,
 {
   cmOStringStream fout;
   const char* config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE");
-  cmComputeLinkInformation* pcli = tgt.GetLinkInformation(config);
+  cmComputeLinkInformation* pcli = tgt.Target->GetLinkInformation(config);
   if(!pcli)
     {
     return;
@@ -2021,8 +2021,7 @@ bool cmLocalGenerator::GetRealDependency(const char* inName,
     }
 
   // Look for a CMake target with the given name.
-  if(cmGeneratorTarget* target
-                    = this->Makefile->FindGeneratorTargetToUse(name.c_str()))
+  if(cmTarget* target = this->Makefile->FindTargetToUse(name.c_str()))
     {
     // make sure it is not just a coincidence that the target name
     // found is part of the inName
@@ -2213,10 +2212,8 @@ void cmLocalGenerator::AddCMP0018Flags(std::string &flags, cmTarget* target,
         }
       return;
       }
-    cmGeneratorTarget *gtgt = target->GetMakefile()->GetLocalGenerator()
-                                    ->GetGlobalGenerator()
-                                    ->GetGeneratorTarget(target);
-    if (gtgt->GetLinkInterfaceDependentBoolProperty(
+
+    if (target->GetLinkInterfaceDependentBoolProperty(
                                                 "POSITION_INDEPENDENT_CODE",
                                                 config))
       {
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index a39610e..93722d1 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -445,7 +445,8 @@ void cmLocalUnixMakefileGenerator3
 
       // Add a local name for the rule to relink the target before
       // installation.
-      if(t->second->NeedRelinkBeforeInstall(this->ConfigurationName.c_str()))
+      if(t->second->Target
+                  ->NeedRelinkBeforeInstall(this->ConfigurationName.c_str()))
         {
         makeTargetName = this->GetRelativeTargetDirectory(*t->second->Target);
         makeTargetName += "/preinstall";
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index 5d42205..fb12521 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -1102,8 +1102,7 @@ void cmLocalVisualStudio6Generator
       // Compute the proper name to use to link this library.
       std::string lib;
       std::string libDebug;
-      cmGeneratorTarget* tgt =
-          this->GlobalGenerator->FindGeneratorTarget(0, j->first.c_str());
+      cmTarget* tgt = this->GlobalGenerator->FindTarget(0, j->first.c_str());
       if(tgt)
         {
         lib = cmSystemTools::GetFilenameWithoutExtension
@@ -1249,14 +1248,14 @@ void cmLocalVisualStudio6Generator
     extraLinkOptionsRelWithDebInfo += targetLinkFlags;
     }
 
-  cmGeneratorTarget* gt =
-    this->GlobalGenerator->GetGeneratorTarget(&target);
+
+
 
   // Get standard libraries for this language.
   if(targetBuilds)
     {
     // Get the language to use for linking.
-    const char* linkLanguage = gt->GetLinkerLanguage();
+    const char* linkLanguage = target.GetLinkerLanguage();
     if(!linkLanguage)
       {
       cmSystemTools::Error
@@ -1306,11 +1305,11 @@ void cmLocalVisualStudio6Generator
      target.GetType() == cmTarget::SHARED_LIBRARY ||
      target.GetType() == cmTarget::MODULE_LIBRARY)
     {
-    outputName = gt->GetFullName();
-    outputNameDebug = gt->GetFullName("Debug");
-    outputNameRelease = gt->GetFullName("Release");
-    outputNameMinSizeRel = gt->GetFullName("MinSizeRel");
-    outputNameRelWithDebInfo = gt->GetFullName("RelWithDebInfo");
+    outputName = target.GetFullName();
+    outputNameDebug = target.GetFullName("Debug");
+    outputNameRelease = target.GetFullName("Release");
+    outputNameMinSizeRel = target.GetFullName("MinSizeRel");
+    outputNameRelWithDebInfo = target.GetFullName("RelWithDebInfo");
     }
   else if(target.GetType() == cmTarget::OBJECT_LIBRARY)
     {
@@ -1407,10 +1406,10 @@ void cmLocalVisualStudio6Generator
     fullPathImpRelease += "/";
     fullPathImpMinSizeRel += "/";
     fullPathImpRelWithDebInfo += "/";
-    fullPathImpDebug += gt->GetFullName("Debug", true);
-    fullPathImpRelease += gt->GetFullName("Release", true);
-    fullPathImpMinSizeRel += gt->GetFullName("MinSizeRel", true);
-    fullPathImpRelWithDebInfo += gt->GetFullName("RelWithDebInfo", true);
+    fullPathImpDebug += target.GetFullName("Debug", true);
+    fullPathImpRelease += target.GetFullName("Release", true);
+    fullPathImpMinSizeRel += target.GetFullName("MinSizeRel", true);
+    fullPathImpRelWithDebInfo += target.GetFullName("RelWithDebInfo", true);
 
     targetImplibFlagDebug = "/implib:";
     targetImplibFlagRelease = "/implib:";
@@ -1678,7 +1677,7 @@ void cmLocalVisualStudio6Generator
     if(target.GetType() >= cmTarget::EXECUTABLE &&
        target.GetType() <= cmTarget::OBJECT_LIBRARY)
       {
-      const char* linkLanguage = gt->GetLinkerLanguage();
+      const char* linkLanguage = target.GetLinkerLanguage();
       if(!linkLanguage)
         {
         cmSystemTools::Error
@@ -1808,10 +1807,8 @@ void cmLocalVisualStudio6Generator
                      const std::string extraOptions,
                      std::string& options)
 {
-  cmGeneratorTarget* gt =
-    this->GlobalGenerator->GetGeneratorTarget(&target);
   // Compute the link information for this configuration.
-  cmComputeLinkInformation* pcli = gt->GetLinkInformation(configName);
+  cmComputeLinkInformation* pcli = target.GetLinkInformation(configName);
   if(!pcli)
     {
     return;
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index d4a1e9e..57a4880 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -657,10 +657,6 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
   const char* configType = "10";
   const char* projectType = 0;
   bool targetBuilds = true;
-
-  cmGeneratorTarget* gt =
-    this->GlobalGenerator->GetGeneratorTarget(&target);
-
   switch(target.GetType())
     {
     case cmTarget::OBJECT_LIBRARY:
@@ -692,7 +688,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
   if(strcmp(configType, "10") != 0)
     {
     const char* linkLanguage = (this->FortranProject? "Fortran":
-                                gt->GetLinkerLanguage(configName));
+                                target.GetLinkerLanguage(configName));
     if(!linkLanguage)
       {
       cmSystemTools::Error
@@ -754,6 +750,8 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
   targetOptions.Parse(flags.c_str());
   targetOptions.Parse(defineFlags.c_str());
   targetOptions.ParseFinish();
+  cmGeneratorTarget* gt =
+    this->GlobalGenerator->GetGeneratorTarget(&target);
   std::vector<std::string> targetDefines;
   target.GetCompileDefinitions(targetDefines, configName);
   targetOptions.AddDefines(targetDefines);
@@ -1001,9 +999,6 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
       this->ConvertToXMLOutputPath(this->ModuleDefinitionFile.c_str());
     linkOptions.AddFlag("ModuleDefinitionFile", defFile.c_str());
     }
-  cmGeneratorTarget* gt =
-    this->GlobalGenerator->GetGeneratorTarget(&target);
-
   switch(target.GetType())
     {
     case cmTarget::UNKNOWN_LIBRARY:
@@ -1026,7 +1021,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
       }
     case cmTarget::STATIC_LIBRARY:
     {
-    std::string targetNameFull = gt->GetFullName(configName);
+    std::string targetNameFull = target.GetFullName(configName);
     std::string libpath = target.GetDirectory(configName);
     libpath += "/";
     libpath += targetNameFull;
@@ -1065,11 +1060,11 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
     std::string targetNameFull;
     std::string targetNameImport;
     std::string targetNamePDB;
-    gt->GetLibraryNames(targetName, targetNameSO, targetNameFull,
+    target.GetLibraryNames(targetName, targetNameSO, targetNameFull,
                            targetNameImport, targetNamePDB, configName);
 
     // Compute the link library and directory information.
-    cmComputeLinkInformation* pcli = gt->GetLinkInformation(configName);
+    cmComputeLinkInformation* pcli = target.GetLinkInformation(configName);
     if(!pcli)
       {
       return;
@@ -1161,13 +1156,11 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
     std::string targetNameFull;
     std::string targetNameImport;
     std::string targetNamePDB;
-    gt->GetExecutableNames(targetName, targetNameFull,
+    target.GetExecutableNames(targetName, targetNameFull,
                               targetNameImport, targetNamePDB, configName);
 
     // Compute the link library and directory information.
-    cmGeneratorTarget* gt =
-      this->GlobalGenerator->GetGeneratorTarget(&target);
-    cmComputeLinkInformation* pcli = gt->GetLinkInformation(configName);
+    cmComputeLinkInformation* pcli = target.GetLinkInformation(configName);
     if(!pcli)
       {
       return;
@@ -1546,7 +1539,7 @@ cmLocalVisualStudio7GeneratorFCInfo
       lg->GlobalGenerator->GetLanguageFromExtension
       (sf.GetExtension().c_str());
     const char* sourceLang = lg->GetSourceFileLanguage(sf);
-    const char* linkLanguage = gt->GetLinkerLanguage(i->c_str());
+    const char* linkLanguage = target.GetLinkerLanguage(i->c_str());
     bool needForceLang = false;
     // source file does not match its extension language
     if(lang && sourceLang && strcmp(lang, sourceLang) != 0)
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index c78d41d..479e712 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1488,7 +1488,7 @@ void cmMakefile::AddLinkLibraryForTarget(const char *target,
         this->IssueMessage(cmake::FATAL_ERROR, e.str().c_str());
         }
       }
-    i->second.AddLinkLibrary( target, lib, llt );
+    i->second.AddLinkLibrary( *this, target, lib, llt );
     }
   else
     {
@@ -1991,7 +1991,7 @@ void cmMakefile::AddGlobalLinkInformation(const char* name, cmTarget& target)
     {
     target.AddLinkDirectory(j->c_str());
     }
-  target.MergeLinkLibraries( name, this->LinkLibraries );
+  target.MergeLinkLibraries( *this, name, this->LinkLibraries );
 }
 
 
@@ -2018,6 +2018,10 @@ cmTarget* cmMakefile::AddLibrary(const char* lname, cmTarget::TargetType type,
     }
 
   cmTarget* target = this->AddNewTarget(type, lname);
+  // Clear its dependencies. Otherwise, dependencies might persist
+  // over changes in CMakeLists.txt, making the information stale and
+  // hence useless.
+  target->ClearDependencyInformation( *this, lname );
   if(excludeFromAll)
     {
     target->SetProperty("EXCLUDE_FROM_ALL", "TRUE");
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 8f9589d..69b8092 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -25,7 +25,7 @@ cmMakefileExecutableTargetGenerator
   cmMakefileTargetGenerator(target->Target)
 {
   this->CustomCommandDriver = OnDepends;
-  this->GeneratorTarget->GetExecutableNames(
+  this->Target->GetExecutableNames(
     this->TargetNameOut, this->TargetNameReal, this->TargetNameImport,
     this->TargetNamePDB, this->ConfigName);
 
@@ -58,7 +58,7 @@ void cmMakefileExecutableTargetGenerator::WriteRuleFiles()
 
   // write the link rules
   this->WriteExecutableRule(false);
-  if(this->GeneratorTarget->NeedRelinkBeforeInstall(this->ConfigName))
+  if(this->Target->NeedRelinkBeforeInstall(this->ConfigName))
     {
     // Write rules to link an installable version of the target.
     this->WriteExecutableRule(true);
@@ -94,7 +94,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
   std::string targetNameReal;
   std::string targetNameImport;
   std::string targetNamePDB;
-  this->GeneratorTarget->GetExecutableNames
+  this->Target->GetExecutableNames
     (targetName, targetNameReal, targetNameImport, targetNamePDB,
      this->ConfigName);
 
@@ -157,7 +157,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
 
   // Get the language to use for linking this executable.
   const char* linkLanguage =
-    this->GeneratorTarget->GetLinkerLanguage(this->ConfigName);
+    this->Target->GetLinkerLanguage(this->ConfigName);
 
   // Make sure we have a link language.
   if(!linkLanguage)
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 153c019..d6a0cd4 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -27,7 +27,7 @@ cmMakefileLibraryTargetGenerator
   this->CustomCommandDriver = OnDepends;
   if (this->Target->GetType() != cmTarget::INTERFACE_LIBRARY)
     {
-    this->GeneratorTarget->GetLibraryNames(
+    this->Target->GetLibraryNames(
       this->TargetNameOut, this->TargetNameSO, this->TargetNameReal,
       this->TargetNameImport, this->TargetNamePDB, this->ConfigName);
     }
@@ -68,7 +68,7 @@ void cmMakefileLibraryTargetGenerator::WriteRuleFiles()
       break;
     case cmTarget::SHARED_LIBRARY:
       this->WriteSharedLibraryRules(false);
-      if(this->GeneratorTarget->NeedRelinkBeforeInstall(this->ConfigName))
+      if(this->Target->NeedRelinkBeforeInstall(this->ConfigName))
         {
         // Write rules to link an installable version of the target.
         this->WriteSharedLibraryRules(true);
@@ -76,7 +76,7 @@ void cmMakefileLibraryTargetGenerator::WriteRuleFiles()
       break;
     case cmTarget::MODULE_LIBRARY:
       this->WriteModuleLibraryRules(false);
-      if(this->GeneratorTarget->NeedRelinkBeforeInstall(this->ConfigName))
+      if(this->Target->NeedRelinkBeforeInstall(this->ConfigName))
         {
         // Write rules to link an installable version of the target.
         this->WriteModuleLibraryRules(true);
@@ -132,7 +132,7 @@ void cmMakefileLibraryTargetGenerator::WriteObjectLibraryRules()
 void cmMakefileLibraryTargetGenerator::WriteStaticLibraryRules()
 {
   const char* linkLanguage =
-    this->GeneratorTarget->GetLinkerLanguage(this->ConfigName);
+    this->Target->GetLinkerLanguage(this->ConfigName);
   std::string linkRuleVar = "CMAKE_";
   if (linkLanguage)
     {
@@ -161,7 +161,7 @@ void cmMakefileLibraryTargetGenerator::WriteSharedLibraryRules(bool relink)
     return;
     }
   const char* linkLanguage =
-    this->GeneratorTarget->GetLinkerLanguage(this->ConfigName);
+    this->Target->GetLinkerLanguage(this->ConfigName);
   std::string linkRuleVar = "CMAKE_";
   if (linkLanguage)
     {
@@ -188,7 +188,7 @@ void cmMakefileLibraryTargetGenerator::WriteSharedLibraryRules(bool relink)
 void cmMakefileLibraryTargetGenerator::WriteModuleLibraryRules(bool relink)
 {
   const char* linkLanguage =
-    this->GeneratorTarget->GetLinkerLanguage(this->ConfigName);
+    this->Target->GetLinkerLanguage(this->ConfigName);
   std::string linkRuleVar = "CMAKE_";
   if (linkLanguage)
     {
@@ -214,7 +214,7 @@ void cmMakefileLibraryTargetGenerator::WriteModuleLibraryRules(bool relink)
 void cmMakefileLibraryTargetGenerator::WriteFrameworkRules(bool relink)
 {
   const char* linkLanguage =
-    this->GeneratorTarget->GetLinkerLanguage(this->ConfigName);
+    this->Target->GetLinkerLanguage(this->ConfigName);
   std::string linkRuleVar = "CMAKE_";
   if (linkLanguage)
     {
@@ -249,7 +249,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
 
   // Get the language to use for linking this library.
   const char* linkLanguage =
-    this->GeneratorTarget->GetLinkerLanguage(this->ConfigName);
+    this->Target->GetLinkerLanguage(this->ConfigName);
 
   // Make sure we have a link language.
   if(!linkLanguage)
@@ -277,7 +277,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
   std::string targetNameReal;
   std::string targetNameImport;
   std::string targetNamePDB;
-  this->GeneratorTarget->GetLibraryNames(
+  this->Target->GetLibraryNames(
     targetName, targetNameSO, targetNameReal, targetNameImport, targetNamePDB,
     this->ConfigName);
 
@@ -588,7 +588,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
   vars.Target = targetOutPathReal.c_str();
   vars.LinkLibraries = linkLibs.c_str();
   vars.ObjectsQuoted = buildObjs.c_str();
-  if (this->GeneratorTarget->HasSOName(this->ConfigName))
+  if (this->Target->HasSOName(this->ConfigName))
     {
     vars.SONameFlag = this->Makefile->GetSONameFlag(linkLanguage);
     vars.TargetSOName= targetNameSO.c_str();
@@ -601,7 +601,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
     {
     // Get the install_name directory for the build tree.
     install_name_dir =
-      this->GeneratorTarget->GetInstallNameDirForBuildTree(this->ConfigName);
+      this->Target->GetInstallNameDirForBuildTree(this->ConfigName);
 
     // Set the rule variable replacement value.
     if(install_name_dir.empty())
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 9425f55..7f90078 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -633,10 +633,10 @@ cmMakefileTargetGenerator
      this->Target->GetType() == cmTarget::MODULE_LIBRARY)
     {
     targetFullPathReal =
-      this->GeneratorTarget->GetFullPath(this->ConfigName, false, true);
+      this->Target->GetFullPath(this->ConfigName, false, true);
     targetFullPathPDB = this->Target->GetPDBDirectory(this->ConfigName);
     targetFullPathPDB += "/";
-    targetFullPathPDB += this->GeneratorTarget->GetPDBName(this->ConfigName);
+    targetFullPathPDB += this->Target->GetPDBName(this->ConfigName);
     }
   targetOutPathReal = this->Convert(targetFullPathReal.c_str(),
                                     cmLocalGenerator::START_OUTPUT,
@@ -1008,8 +1008,7 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
     << "set(CMAKE_TARGET_LINKED_INFO_FILES\n";
   std::set<cmTarget const*> emitted;
   const char* cfg = this->LocalGenerator->ConfigurationName.c_str();
-  if(cmComputeLinkInformation* cli =
-                              this->GeneratorTarget->GetLinkInformation(cfg))
+  if(cmComputeLinkInformation* cli = this->Target->GetLinkInformation(cfg))
     {
     cmComputeLinkInformation::ItemVector const& items = cli->GetItems();
     for(cmComputeLinkInformation::ItemVector::const_iterator
@@ -1571,8 +1570,7 @@ std::string cmMakefileTargetGenerator::GetFrameworkFlags(std::string const& l)
 
   std::string flags;
   const char* cfg = this->LocalGenerator->ConfigurationName.c_str();
-  if(cmComputeLinkInformation* cli =
-                              this->GeneratorTarget->GetLinkInformation(cfg))
+  if(cmComputeLinkInformation* cli = this->Target->GetLinkInformation(cfg))
     {
     std::vector<std::string> const& frameworks = cli->GetFrameworkPaths();
     for(std::vector<std::string>::const_iterator i = frameworks.begin();
@@ -1603,8 +1601,7 @@ void cmMakefileTargetGenerator
 
   // Loop over all library dependencies.
   const char* cfg = this->LocalGenerator->ConfigurationName.c_str();
-  if(cmComputeLinkInformation* cli =
-                              this->GeneratorTarget->GetLinkInformation(cfg))
+  if(cmComputeLinkInformation* cli = this->Target->GetLinkInformation(cfg))
     {
     std::vector<std::string> const& libDeps = cli->GetDepends();
     for(std::vector<std::string>::const_iterator j = libDeps.begin();
@@ -1673,7 +1670,7 @@ std::string cmMakefileTargetGenerator::GetLinkRule(const char* linkRuleVar)
   if(this->Target->HasImplibGNUtoMS())
     {
     std::string ruleVar = "CMAKE_";
-    ruleVar += this->GeneratorTarget->GetLinkerLanguage(this->ConfigName);
+    ruleVar += this->Target->GetLinkerLanguage(this->ConfigName);
     ruleVar += "_GNUtoMS_RULE";
     if(const char* rule = this->Makefile->GetDefinition(ruleVar.c_str()))
       {
@@ -1836,8 +1833,7 @@ cmMakefileTargetGenerator
 
     // Lookup the response file reference flag.
     std::string responseFlagVar = "CMAKE_";
-    responseFlagVar += this->GeneratorTarget
-                           ->GetLinkerLanguage(this->ConfigName);
+    responseFlagVar += this->Target->GetLinkerLanguage(this->ConfigName);
     responseFlagVar += "_RESPONSE_FILE_LINK_FLAG";
     const char* responseFlag =
       this->Makefile->GetDefinition(responseFlagVar.c_str());
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 1faed1d..73ba815 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -37,15 +37,16 @@ cmNinjaNormalTargetGenerator(cmGeneratorTarget* target)
   , TargetNamePDB()
   , TargetLinkLanguage(0)
 {
-  this->TargetLinkLanguage = target->GetLinkerLanguage(this->GetConfigName());
+  this->TargetLinkLanguage = target->Target
+                                   ->GetLinkerLanguage(this->GetConfigName());
   if (target->GetType() == cmTarget::EXECUTABLE)
-    this->GetGeneratorTarget()->GetExecutableNames(this->TargetNameOut,
+    target->Target->GetExecutableNames(this->TargetNameOut,
                                this->TargetNameReal,
                                this->TargetNameImport,
                                this->TargetNamePDB,
                                GetLocalGenerator()->GetConfigName());
   else
-    this->GetGeneratorTarget()->GetLibraryNames(this->TargetNameOut,
+    target->Target->GetLibraryNames(this->TargetNameOut,
                             this->TargetNameSO,
                             this->TargetNameReal,
                             this->TargetNameImport,
@@ -388,13 +389,13 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
   cmTarget::TargetType targetType = this->GetTarget()->GetType();
 
   std::string targetOutput = ConvertToNinjaPath(
-    this->GetGeneratorTarget()->GetFullPath(this->GetConfigName()).c_str());
+    this->GetTarget()->GetFullPath(this->GetConfigName()).c_str());
   std::string targetOutputReal = ConvertToNinjaPath(
-    this->GetGeneratorTarget()->GetFullPath(this->GetConfigName(),
+    this->GetTarget()->GetFullPath(this->GetConfigName(),
                                    /*implib=*/false,
                                    /*realpath=*/true).c_str());
   std::string targetOutputImplib = ConvertToNinjaPath(
-    this->GetGeneratorTarget()->GetFullPath(this->GetConfigName(),
+    this->GetTarget()->GetFullPath(this->GetConfigName(),
                                    /*implib=*/true).c_str());
 
   if (this->GetTarget()->IsAppBundleOnApple())
@@ -486,12 +487,12 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
   } else {
     vars["ARCH_FLAGS"] = flags;
   }
-  if (this->GetGeneratorTarget()->HasSOName(this->GetConfigName())) {
+  if (this->GetTarget()->HasSOName(this->GetConfigName())) {
     vars["SONAME_FLAG"] =
       this->GetMakefile()->GetSONameFlag(this->TargetLinkLanguage);
     vars["SONAME"] = this->TargetNameSO;
     if (targetType == cmTarget::SHARED_LIBRARY) {
-      std::string install_name_dir = this->GetGeneratorTarget()
+      std::string install_name_dir = this->GetTarget()
         ->GetInstallNameDirForBuildTree(this->GetConfigName());
 
       if (!install_name_dir.empty()) {
@@ -519,7 +520,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
     std::string prefix;
     std::string base;
     std::string suffix;
-    this->GetGeneratorTarget()->GetFullNameComponents(prefix, base, suffix);
+    this->GetTarget()->GetFullNameComponents(prefix, base, suffix);
     std::string dbg_suffix = ".dbg";
     // TODO: Where to document?
     if (mf->GetDefinition("CMAKE_DEBUG_SYMBOL_SUFFIX"))
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index d6b4433..82f8d1b 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -245,7 +245,7 @@ cmNinjaDeps cmNinjaTargetGenerator::ComputeLinkDeps() const
     return cmNinjaDeps();
 
   cmComputeLinkInformation* cli =
-    this->GeneratorTarget->GetLinkInformation(this->GetConfigName());
+    this->Target->GetLinkInformation(this->GetConfigName());
   if(!cli)
     return cmNinjaDeps();
 
@@ -322,7 +322,7 @@ bool cmNinjaTargetGenerator::SetMsvcTargetPdbVariable(cmNinjaVars& vars) const
       {
       pdbPath = this->Target->GetPDBDirectory(this->GetConfigName());
       pdbPath += "/";
-      pdbPath += this->GeneratorTarget->GetPDBName(this->GetConfigName());
+      pdbPath += this->Target->GetPDBName(this->GetConfigName());
       }
 
     vars["TARGET_PDB"] = this->GetLocalGenerator()->ConvertToOutputFormat(
diff --git a/Source/cmOSXBundleGenerator.cxx b/Source/cmOSXBundleGenerator.cxx
index 439052e..9a340dc 100644
--- a/Source/cmOSXBundleGenerator.cxx
+++ b/Source/cmOSXBundleGenerator.cxx
@@ -21,7 +21,6 @@ cmOSXBundleGenerator::
 cmOSXBundleGenerator(cmGeneratorTarget* target,
                      const char* configName)
  : Target(target->Target)
- , GeneratorTarget(target)
  , Makefile(target->Target->GetMakefile())
  , LocalGenerator(Makefile->GetLocalGenerator())
  , ConfigName(configName)
@@ -48,7 +47,7 @@ void cmOSXBundleGenerator::CreateAppBundle(const std::string& targetName,
   // Compute bundle directory names.
   std::string out = outpath;
   out += "/";
-  out += this->GeneratorTarget->GetAppBundleDirectory(this->ConfigName, false);
+  out += this->Target->GetAppBundleDirectory(this->ConfigName, false);
   cmSystemTools::MakeDirectory(out.c_str());
   this->Makefile->AddCMakeOutputFile(out);
 
@@ -58,8 +57,7 @@ void cmOSXBundleGenerator::CreateAppBundle(const std::string& targetName,
   // to be set.
   std::string plist = outpath;
   plist += "/";
-  plist += this->GeneratorTarget->GetAppBundleDirectory(this->ConfigName,
-                                                        true);
+  plist += this->Target->GetAppBundleDirectory(this->ConfigName, true);
   plist += "/Info.plist";
   this->LocalGenerator->GenerateAppleInfoPList(this->Target,
                                                targetName.c_str(),
@@ -79,11 +77,11 @@ void cmOSXBundleGenerator::CreateFramework(
 
   // Compute the location of the top-level foo.framework directory.
   std::string contentdir = outpath + "/" +
-    this->GeneratorTarget->GetFrameworkDirectory(this->ConfigName, true);
+    this->Target->GetFrameworkDirectory(this->ConfigName, true);
   contentdir += "/";
 
   std::string newoutpath = outpath + "/" +
-    this->GeneratorTarget->GetFrameworkDirectory(this->ConfigName, false);
+    this->Target->GetFrameworkDirectory(this->ConfigName, false);
 
   std::string frameworkVersion = this->Target->GetFrameworkVersion();
 
@@ -174,14 +172,14 @@ void cmOSXBundleGenerator::CreateCFBundle(const std::string& targetName,
   // Compute bundle directory names.
   std::string out = root;
   out += "/";
-  out += this->GeneratorTarget->GetCFBundleDirectory(this->ConfigName, false);
+  out += this->Target->GetCFBundleDirectory(this->ConfigName, false);
   cmSystemTools::MakeDirectory(out.c_str());
   this->Makefile->AddCMakeOutputFile(out);
 
   // Configure the Info.plist file.  Note that it needs the executable name
   // to be set.
   std::string plist =
-    this->GeneratorTarget->GetCFBundleDirectory(this->ConfigName, true);
+    this->Target->GetCFBundleDirectory(this->ConfigName, true);
   plist += "/Info.plist";
   this->LocalGenerator->GenerateAppleInfoPList(this->Target,
                                                targetName.c_str(),
@@ -217,7 +215,7 @@ cmOSXBundleGenerator::InitMacOSXContentDirectory(const char* pkgloc)
   // Construct the full path to the content subdirectory.
 
   std::string macdir =
-    this->GeneratorTarget->GetMacContentDirectory(this->ConfigName,
+    this->Target->GetMacContentDirectory(this->ConfigName,
                                          /*implib*/ false);
   macdir += "/";
   macdir += pkgloc;
diff --git a/Source/cmOSXBundleGenerator.h b/Source/cmOSXBundleGenerator.h
index 660c5be..29b7611 100644
--- a/Source/cmOSXBundleGenerator.h
+++ b/Source/cmOSXBundleGenerator.h
@@ -19,7 +19,6 @@
 #include <set>
 
 class cmTarget;
-class cmGeneratorTarget;
 class cmMakefile;
 class cmLocalGenerator;
 class cmGeneratorTarget;
@@ -61,7 +60,6 @@ private:
 
 private:
   cmTarget* Target;
-  cmGeneratorTarget* GeneratorTarget;
   cmMakefile* Makefile;
   cmLocalGenerator* LocalGenerator;
   const char* ConfigName;
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index bbff11e..da22ab5 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -357,11 +357,8 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget const* target)
     {
     qtVersion = makefile->GetDefinition("QT_VERSION_MAJOR");
     }
-  cmGeneratorTarget *gtgt = target->GetMakefile()->GetLocalGenerator()
-                                  ->GetGlobalGenerator()
-                                  ->GetGeneratorTarget(target);
   if (const char *targetQtVersion =
-        gtgt->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", 0))
+      target->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", 0))
     {
     qtVersion = targetQtVersion;
     }
@@ -565,8 +562,7 @@ void cmQtAutoGenerators::SetupAutoMocTarget(cmTarget const* target,
                           autogenTargetName.c_str());
       return;
       }
-    makefile->AddDefinition("_qt_moc_executable",
-                            qt5Moc->ImportedGetLocation(0));
+    makefile->AddDefinition("_qt_moc_executable", qt5Moc->GetLocation(0));
     }
   else
     {
@@ -626,11 +622,8 @@ void cmQtAutoGenerators::MergeUicOptions(std::vector<std::string> &opts,
 static void GetUicOpts(cmTarget const* target, const char * config,
                        std::string &optString)
 {
-  cmGeneratorTarget *gtgt = target->GetMakefile()->GetLocalGenerator()
-                                  ->GetGlobalGenerator()
-                                  ->GetGeneratorTarget(target);
   std::vector<std::string> opts;
-  gtgt->GetAutoUicOptions(opts, config);
+  target->GetAutoUicOptions(opts, config);
 
   const char* sep = "";
   for(std::vector<std::string>::const_iterator optIt = opts.begin();
@@ -758,8 +751,7 @@ void cmQtAutoGenerators::SetupAutoUicTarget(cmTarget const* target,
       }
     else
       {
-      makefile->AddDefinition("_qt_uic_executable",
-                              qt5Uic->ImportedGetLocation(0));
+      makefile->AddDefinition("_qt_uic_executable", qt5Uic->GetLocation(0));
       }
     }
   else
@@ -948,8 +940,7 @@ void cmQtAutoGenerators::SetupAutoRccTarget(cmTarget const* target)
                           targetName);
       return;
       }
-    makefile->AddDefinition("_qt_rcc_executable",
-                            qt5Rcc->ImportedGetLocation(0));
+    makefile->AddDefinition("_qt_rcc_executable", qt5Rcc->GetLocation(0));
     }
   else
     {
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 324cb5c..4828d20 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -15,6 +15,7 @@
 #include "cmSourceFile.h"
 #include "cmLocalGenerator.h"
 #include "cmGlobalGenerator.h"
+#include "cmComputeLinkInformation.h"
 #include "cmListFileCache.h"
 #include "cmGeneratorExpression.h"
 #include "cmGeneratorExpressionDAGChecker.h"
@@ -61,15 +62,32 @@ struct cmTarget::OutputInfo
 };
 
 //----------------------------------------------------------------------------
+struct cmTarget::ImportInfo
+{
+  bool NoSOName;
+  std::string Location;
+  std::string SOName;
+  std::string ImportLibrary;
+  cmTarget::LinkInterface LinkInterface;
+};
+
+struct TargetConfigPair : public std::pair<cmTarget const* , std::string> {
+  TargetConfigPair(cmTarget const* tgt, const std::string &config)
+    : std::pair<cmTarget const* , std::string>(tgt, config) {}
+};
+
+//----------------------------------------------------------------------------
 class cmTargetInternals
 {
 public:
   cmTargetInternals()
     {
+    this->PolicyWarnedCMP0022 = false;
     this->SourceFileFlagsConstructed = false;
     }
   cmTargetInternals(cmTargetInternals const&)
     {
+    this->PolicyWarnedCMP0022 = false;
     this->SourceFileFlagsConstructed = false;
     }
   ~cmTargetInternals();
@@ -80,6 +98,17 @@ public:
   // The backtrace when the target was created.
   cmListFileBacktrace Backtrace;
 
+  // Cache link interface computation from each configuration.
+  struct OptionalLinkInterface: public cmTarget::LinkInterface
+  {
+    OptionalLinkInterface(): Exists(false) {}
+    bool Exists;
+  };
+  typedef std::map<TargetConfigPair, OptionalLinkInterface>
+                                                          LinkInterfaceMapType;
+  LinkInterfaceMapType LinkInterfaceMap;
+  bool PolicyWarnedCMP0022;
+
   typedef std::map<cmStdString, cmTarget::OutputInfo> OutputInfoMapType;
   OutputInfoMapType OutputInfoMap;
 
@@ -87,37 +116,42 @@ public:
                                                             ImportInfoMapType;
   ImportInfoMapType ImportInfoMap;
 
-  typedef cmGeneratorTarget::TargetPropertyEntry TargetPropertyEntry;
-
+  // Cache link implementation computation from each configuration.
+  typedef std::map<TargetConfigPair,
+                   cmTarget::LinkImplementation> LinkImplMapType;
+  LinkImplMapType LinkImplMap;
+
+  typedef std::map<TargetConfigPair, cmTarget::LinkClosure>
+                                                          LinkClosureMapType;
+  LinkClosureMapType LinkClosureMap;
+
+  struct TargetPropertyEntry {
+    TargetPropertyEntry(cmsys::auto_ptr<cmCompiledGeneratorExpression> cge,
+      const std::string &targetName = std::string())
+      : ge(cge), TargetName(targetName)
+    {}
+    const cmsys::auto_ptr<cmCompiledGeneratorExpression> ge;
+    std::vector<std::string> CachedEntries;
+    const std::string TargetName;
+  };
   std::vector<TargetPropertyEntry*> IncludeDirectoriesEntries;
   std::vector<TargetPropertyEntry*> CompileOptionsEntries;
   std::vector<TargetPropertyEntry*> CompileDefinitionsEntries;
   std::vector<cmValueWithOrigin> LinkImplementationPropertyEntries;
 
   mutable std::map<std::string, std::vector<TargetPropertyEntry*> >
+                                CachedLinkInterfaceIncludeDirectoriesEntries;
+  mutable std::map<std::string, std::vector<TargetPropertyEntry*> >
                                 CachedLinkInterfaceCompileOptionsEntries;
   mutable std::map<std::string, std::vector<TargetPropertyEntry*> >
                                 CachedLinkInterfaceCompileDefinitionsEntries;
 
+  mutable std::map<std::string, bool> CacheLinkInterfaceIncludeDirectoriesDone;
   mutable std::map<std::string, bool> CacheLinkInterfaceCompileDefinitionsDone;
   mutable std::map<std::string, bool> CacheLinkInterfaceCompileOptionsDone;
 };
 
 //----------------------------------------------------------------------------
-const std::vector<cmValueWithOrigin>&
-cmTarget::GetLinkImplementationPropertyEntries()
-{
-  return this->Internal->LinkImplementationPropertyEntries;
-}
-
-//----------------------------------------------------------------------------
-const std::vector<cmGeneratorTarget::TargetPropertyEntry*>&
-cmTarget::GetIncludeDirectoriesEntries()
-{
-  return this->Internal->IncludeDirectoriesEntries;
-}
-
-//----------------------------------------------------------------------------
 void deleteAndClear(
       std::vector<cmTargetInternals::TargetPropertyEntry*> &entries)
 {
@@ -147,6 +181,7 @@ void deleteAndClear(
 //----------------------------------------------------------------------------
 cmTargetInternals::~cmTargetInternals()
 {
+  deleteAndClear(this->CachedLinkInterfaceIncludeDirectoriesEntries);
   deleteAndClear(this->CachedLinkInterfaceCompileOptionsEntries);
   deleteAndClear(this->CachedLinkInterfaceCompileDefinitionsEntries);
 }
@@ -162,11 +197,13 @@ cmTarget::cmTarget()
 #undef INITIALIZE_TARGET_POLICY_MEMBER
 
   this->Makefile = 0;
+  this->LinkLibrariesAnalyzed = false;
   this->HaveInstallRule = false;
   this->DLLPlatform = false;
   this->IsApple = false;
   this->IsImportedTarget = false;
   this->BuildInterfaceIncludesAppended = false;
+  this->DebugIncludesDone = false;
   this->DebugCompileOptionsDone = false;
   this->DebugCompileDefinitionsDone = false;
 }
@@ -372,11 +409,24 @@ void cmTarget::FinishConfigure()
   // system generation uses up-to-date information even if other cache
   // invalidation code in this source file is buggy.
   this->ClearLinkMaps();
+
+  // Do old-style link dependency analysis.
+  this->AnalyzeLibDependencies(*this->Makefile);
 }
 
 //----------------------------------------------------------------------------
 void cmTarget::ClearLinkMaps()
 {
+  this->Internal->LinkImplMap.clear();
+  this->Internal->LinkInterfaceMap.clear();
+  this->Internal->LinkClosureMap.clear();
+  for (cmTargetLinkInformationMap::const_iterator it
+      = this->LinkInformation.begin();
+      it != this->LinkInformation.end(); ++it)
+    {
+    delete it->second;
+    }
+  this->LinkInformation.clear();
 }
 
 //----------------------------------------------------------------------------
@@ -649,7 +699,8 @@ void cmTarget::ConstructSourceFileFlags() const
 }
 
 //----------------------------------------------------------------------------
-void cmTarget::MergeLinkLibraries( const char *selfname,
+void cmTarget::MergeLinkLibraries( cmMakefile& mf,
+                                   const char *selfname,
                                    const LinkLibraryVectorType& libs )
 {
   // Only add on libraries we haven't added on before.
@@ -659,7 +710,7 @@ void cmTarget::MergeLinkLibraries( const char *selfname,
   for( ; i != libs.end(); ++i )
     {
     // This is equivalent to the target_link_libraries plain signature.
-    this->AddLinkLibrary( selfname, i->first.c_str(), i->second );
+    this->AddLinkLibrary( mf, selfname, i->first.c_str(), i->second );
     this->AppendProperty("INTERFACE_LINK_LIBRARIES",
       this->GetDebugGeneratorExpressions(i->first.c_str(), i->second).c_str());
     }
@@ -711,6 +762,34 @@ cmTarget::LinkLibraryType cmTarget::ComputeLinkType(const char* config) const
 }
 
 //----------------------------------------------------------------------------
+void cmTarget::ClearDependencyInformation( cmMakefile& mf,
+                                           const char* target )
+{
+  // Clear the dependencies. The cache variable must exist iff we are
+  // recording dependency information for this target.
+  std::string depname = target;
+  depname += "_LIB_DEPENDS";
+  if (this->RecordDependencies)
+    {
+    mf.AddCacheDefinition(depname.c_str(), "",
+                          "Dependencies for target", cmCacheManager::STATIC);
+    }
+  else
+    {
+    if (mf.GetDefinition( depname.c_str() ))
+      {
+      std::string message = "Target ";
+      message += target;
+      message += " has dependency information when it shouldn't.\n";
+      message += "Your cache is probably stale. Please remove the entry\n  ";
+      message += depname;
+      message += "\nfrom the cache.";
+      cmSystemTools::Error( message.c_str() );
+      }
+    }
+}
+
+//----------------------------------------------------------------------------
 bool cmTarget::NameResolvesToFramework(const std::string& libname) const
 {
   return this->Makefile->GetLocalGenerator()->GetGlobalGenerator()->
@@ -718,6 +797,64 @@ bool cmTarget::NameResolvesToFramework(const std::string& libname) const
 }
 
 //----------------------------------------------------------------------------
+void cmTarget::GetDirectLinkLibraries(const char *config,
+                            std::vector<std::string> &libs,
+                            cmTarget const* head) const
+{
+  const char *prop = this->GetProperty("LINK_LIBRARIES");
+  if (prop)
+    {
+    cmListFileBacktrace lfbt;
+    cmGeneratorExpression ge(lfbt);
+    const cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
+
+    cmGeneratorExpressionDAGChecker dagChecker(lfbt,
+                                        this->GetName(),
+                                        "LINK_LIBRARIES", 0, 0);
+    cmSystemTools::ExpandListArgument(cge->Evaluate(this->Makefile,
+                                        config,
+                                        false,
+                                        head,
+                                        &dagChecker),
+                                      libs);
+
+    std::set<cmStdString> seenProps = cge->GetSeenTargetProperties();
+    for (std::set<cmStdString>::const_iterator it = seenProps.begin();
+        it != seenProps.end(); ++it)
+      {
+      if (!this->GetProperty(it->c_str()))
+        {
+        this->LinkImplicitNullProperties.insert(*it);
+        }
+      }
+    }
+}
+
+//----------------------------------------------------------------------------
+void cmTarget::GetInterfaceLinkLibraries(const char *config,
+                                         std::vector<std::string> &libs,
+                                         cmTarget const* head) const
+{
+  const char *prop = this->GetProperty("INTERFACE_LINK_LIBRARIES");
+  if (prop)
+    {
+    cmListFileBacktrace lfbt;
+    cmGeneratorExpression ge(lfbt);
+    const cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
+
+    cmGeneratorExpressionDAGChecker dagChecker(lfbt,
+                                        this->GetName(),
+                                        "INTERFACE_LINK_LIBRARIES", 0, 0);
+    cmSystemTools::ExpandListArgument(cge->Evaluate(this->Makefile,
+                                        config,
+                                        false,
+                                        head,
+                                        &dagChecker),
+                                      libs);
+    }
+}
+
+//----------------------------------------------------------------------------
 std::string cmTarget::GetDebugGeneratorExpressions(const std::string &value,
                                   cmTarget::LinkLibraryType llt) const
 {
@@ -813,7 +950,8 @@ void cmTarget::GetTllSignatureTraces(cmOStringStream &s,
 }
 
 //----------------------------------------------------------------------------
-void cmTarget::AddLinkLibrary(const char *target, const char* lib,
+void cmTarget::AddLinkLibrary(cmMakefile& mf,
+                              const char *target, const char* lib,
                               LinkLibraryType llt)
 {
   cmTarget *tgt = this->Makefile->FindTargetToUse(lib);
@@ -838,7 +976,48 @@ void cmTarget::AddLinkLibrary(const char *target, const char* lib,
   cmTarget::LibraryID tmp;
   tmp.first = lib;
   tmp.second = llt;
+  this->LinkLibraries.push_back( tmp );
+  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
+  // be a trailing ";". These library names are not canonical, in that
+  // they may be "-framework x", "-ly", "/path/libz.a", etc.
+  // We shouldn't remove duplicates here because external libraries
+  // may be purposefully duplicated to handle recursive dependencies,
+  // and we removing one instance will break the link line. Duplicates
+  // will be appropriately eliminated at emit time.
+  if(this->RecordDependencies)
+    {
+    std::string targetEntry = target;
+    targetEntry += "_LIB_DEPENDS";
+    std::string dependencies;
+    const char* old_val = mf.GetDefinition( targetEntry.c_str() );
+    if( old_val )
+      {
+      dependencies += old_val;
+      }
+    switch (llt)
+      {
+      case cmTarget::GENERAL:
+        dependencies += "general";
+        break;
+      case cmTarget::DEBUG:
+        dependencies += "debug";
+        break;
+      case cmTarget::OPTIMIZED:
+        dependencies += "optimized";
+        break;
+      }
+    dependencies += ";";
+    dependencies += lib;
+    dependencies += ";";
+    mf.AddCacheDefinition( targetEntry.c_str(), dependencies.c_str(),
+                           "Dependencies for the target",
+                           cmCacheManager::STATIC );
+    }
+
 }
 
 //----------------------------------------------------------------------------
@@ -864,6 +1043,147 @@ cmTarget::AddSystemIncludeDirectories(const std::vector<std::string> &incs)
 }
 
 //----------------------------------------------------------------------------
+void
+cmTarget::AnalyzeLibDependencies( const cmMakefile& mf )
+{
+  // There are two key parts of the dependency analysis: (1)
+  // determining the libraries in the link line, and (2) constructing
+  // the dependency graph for those libraries.
+  //
+  // The latter is done using the cache entries that record the
+  // dependencies of each library.
+  //
+  // The former is a more thorny issue, since it is not clear how to
+  // determine if two libraries listed on the link line refer to the a
+  // single library or not. For example, consider the link "libraries"
+  //    /usr/lib/libtiff.so -ltiff
+  // Is this one library or two? The solution implemented here is the
+  // simplest (and probably the only practical) one: two libraries are
+  // the same if their "link strings" are identical. Thus, the two
+  // libraries above are considered distinct. This also means that for
+  // dependency analysis to be effective, the CMake user must specify
+  // libraries build by his project without using any linker flags or
+  // file extensions. That is,
+  //    LINK_LIBRARIES( One Two )
+  // instead of
+  //    LINK_LIBRARIES( -lOne ${binarypath}/libTwo.a )
+  // The former is probably what most users would do, but it never
+  // hurts to document the assumptions. :-) Therefore, in the analysis
+  // code, the "canonical name" of a library is simply its name as
+  // given to a LINK_LIBRARIES command.
+  //
+  // Also, we will leave the original link line intact; we will just add any
+  // dependencies that were missing.
+  //
+  // There is a problem with recursive external libraries
+  // (i.e. libraries with no dependency information that are
+  // recursively dependent). We must make sure that the we emit one of
+  // the libraries twice to satisfy the recursion, but we shouldn't
+  // emit it more times than necessary. In particular, we must make
+  // sure that handling this improbable case doesn't cost us when
+  // dealing with the common case of non-recursive libraries. The
+  // solution is to assume that the recursion is satisfied at one node
+  // of the dependency tree. To illustrate, assume libA and libB are
+  // extrenal and mutually dependent. Suppose libX depends on
+  // libA, and libY on libA and libX. Then
+  //   TARGET_LINK_LIBRARIES( Y X A B A )
+  //   TARGET_LINK_LIBRARIES( X A B A )
+  //   TARGET_LINK_LIBRARIES( Exec Y )
+  // would result in "-lY -lX -lA -lB -lA". This is the correct way to
+  // specify the dependencies, since the mutual dependency of A and B
+  // is resolved *every time libA is specified*.
+  //
+  // Something like
+  //   TARGET_LINK_LIBRARIES( Y X A B A )
+  //   TARGET_LINK_LIBRARIES( X A B )
+  //   TARGET_LINK_LIBRARIES( Exec Y )
+  // would result in "-lY -lX -lA -lB", and the mutual dependency
+  // information is lost. This is because in some case (Y), the mutual
+  // dependency of A and B is listed, while in another other case (X),
+  // it is not. Depending on which line actually emits A, the mutual
+  // dependency may or may not be on the final link line.  We can't
+  // handle this pathalogical case cleanly without emitting extra
+  // libraries for the normal cases. Besides, the dependency
+  // information for X is wrong anyway: if we build an executable
+  // depending on X alone, we would not have the mutual dependency on
+  // A and B resolved.
+  //
+  // IMPROVEMENTS:
+  // -- The current algorithm will not always pick the "optimal" link line
+  //    when recursive dependencies are present. It will instead break the
+  //    cycles at an aribtrary point. The majority of projects won't have
+  //    cyclic dependencies, so this is probably not a big deal. Note that
+  //    the link line is always correct, just not necessary optimal.
+
+ {
+ // Expand variables in link library names.  This is for backwards
+ // compatibility with very early CMake versions and should
+ // eventually be removed.  This code was moved here from the end of
+ // old source list processing code which was called just before this
+ // method.
+ for(LinkLibraryVectorType::iterator p = this->LinkLibraries.begin();
+     p != this->LinkLibraries.end(); ++p)
+   {
+   this->Makefile->ExpandVariablesInString(p->first, true, true);
+   }
+ }
+
+ // The dependency map.
+ DependencyMap dep_map;
+
+ // 1. Build the dependency graph
+ //
+ for(LinkLibraryVectorType::reverse_iterator lib
+       = this->LinkLibraries.rbegin();
+     lib != this->LinkLibraries.rend(); ++lib)
+   {
+   this->GatherDependencies( mf, *lib, dep_map);
+   }
+
+ // 2. Remove any dependencies that are already satisfied in the original
+ // link line.
+ //
+ for(LinkLibraryVectorType::iterator lib = this->LinkLibraries.begin();
+     lib != this->LinkLibraries.end(); ++lib)
+   {
+   for( LinkLibraryVectorType::iterator lib2 = lib;
+        lib2 != this->LinkLibraries.end(); ++lib2)
+     {
+     this->DeleteDependency( dep_map, *lib, *lib2);
+     }
+   }
+
+
+ // 3. Create the new link line by simply emitting any dependencies that are
+ // missing.  Start from the back and keep adding.
+ //
+ std::set<DependencyMap::key_type> done, visited;
+ std::vector<DependencyMap::key_type> newLinkLibraries;
+ for(LinkLibraryVectorType::reverse_iterator lib =
+       this->LinkLibraries.rbegin();
+     lib != this->LinkLibraries.rend(); ++lib)
+   {
+   // skip zero size library entries, this may happen
+   // if a variable expands to nothing.
+   if (lib->first.size() != 0)
+     {
+     this->Emit( *lib, dep_map, done, visited, newLinkLibraries );
+     }
+   }
+
+ // 4. Add the new libraries to the link line.
+ //
+ for( std::vector<DependencyMap::key_type>::reverse_iterator k =
+        newLinkLibraries.rbegin();
+      k != newLinkLibraries.rend(); ++k )
+   {
+   // get the llt from the dep_map
+   this->LinkLibraries.push_back( std::make_pair(k->first,k->second) );
+   }
+ this->LinkLibrariesAnalyzed = true;
+}
+
+//----------------------------------------------------------------------------
 void cmTarget::InsertDependency( DependencyMap& depMap,
                                  const LibraryID& lib,
                                  const LibraryID& dep)
@@ -956,6 +1276,66 @@ void cmTarget::Emit(const LibraryID lib,
 }
 
 //----------------------------------------------------------------------------
+void cmTarget::GatherDependencies( const cmMakefile& mf,
+                                   const LibraryID& lib,
+                                   DependencyMap& dep_map)
+{
+  // If the library is already in the dependency map, then it has
+  // already been fully processed.
+  if( dep_map.find(lib) != dep_map.end() )
+    {
+    return;
+    }
+
+  const char* deps = mf.GetDefinition( (lib.first+"_LIB_DEPENDS").c_str() );
+  if( deps && strcmp(deps,"") != 0 )
+    {
+    // Make sure this library is in the map, even if it has an empty
+    // set of dependencies. This distinguishes the case of explicitly
+    // no dependencies with that of unspecified dependencies.
+    dep_map[lib];
+
+    // Parse the dependency information, which is a set of
+    // type, library pairs separated by ";". There is always a trailing ";".
+    cmTarget::LinkLibraryType llt = cmTarget::GENERAL;
+    std::string depline = deps;
+    std::string::size_type start = 0;
+    std::string::size_type end;
+    end = depline.find( ";", start );
+    while( end != std::string::npos )
+      {
+      std::string l = depline.substr( start, end-start );
+      if( l.size() != 0 )
+        {
+        if (l == "debug")
+          {
+          llt = cmTarget::DEBUG;
+          }
+        else if (l == "optimized")
+          {
+          llt = cmTarget::OPTIMIZED;
+          }
+        else if (l == "general")
+          {
+          llt = cmTarget::GENERAL;
+          }
+        else
+          {
+          LibraryID lib2(l,llt);
+          this->InsertDependency( dep_map, lib, lib2);
+          this->GatherDependencies( mf, lib2, dep_map);
+          llt = cmTarget::GENERAL;
+          }
+        }
+      start = end+1; // skip the ;
+      end = depline.find( ";", start );
+      }
+    // cannot depend on itself
+    this->DeleteDependency( dep_map, lib, lib);
+    }
+}
+
+//----------------------------------------------------------------------------
 static bool whiteListedInterfaceProperty(const char *prop)
 {
   if(cmHasLiteralPrefix(prop, "INTERFACE_"))
@@ -1234,6 +1614,308 @@ void cmTarget::InsertCompileDefinition(const cmValueWithOrigin &entry,
 }
 
 //----------------------------------------------------------------------------
+static void processIncludeDirectories(cmTarget const* tgt,
+      const std::vector<cmTargetInternals::TargetPropertyEntry*> &entries,
+      std::vector<std::string> &includes,
+      std::set<std::string> &uniqueIncludes,
+      cmGeneratorExpressionDAGChecker *dagChecker,
+      const char *config, bool debugIncludes)
+{
+  cmMakefile *mf = tgt->GetMakefile();
+
+  for (std::vector<cmTargetInternals::TargetPropertyEntry*>::const_iterator
+      it = entries.begin(), end = entries.end(); it != end; ++it)
+    {
+    bool testIsOff = true;
+    bool cacheIncludes = false;
+    std::vector<std::string> entryIncludes = (*it)->CachedEntries;
+    if(!entryIncludes.empty())
+      {
+      testIsOff = false;
+      }
+    else
+      {
+      cmSystemTools::ExpandListArgument((*it)->ge->Evaluate(mf,
+                                                config,
+                                                false,
+                                                tgt,
+                                                dagChecker),
+                                      entryIncludes);
+      if (mf->IsGeneratingBuildSystem()
+          && !(*it)->ge->GetHadContextSensitiveCondition())
+        {
+        cacheIncludes = true;
+        }
+      }
+    std::string usedIncludes;
+    cmListFileBacktrace lfbt;
+    for(std::vector<std::string>::iterator
+          li = entryIncludes.begin(); li != entryIncludes.end(); ++li)
+      {
+      std::string targetName = (*it)->TargetName;
+      std::string evaluatedTargetName;
+      {
+      cmGeneratorExpression ge(lfbt);
+      cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
+                                                        ge.Parse(targetName);
+      evaluatedTargetName = cge->Evaluate(mf, config, false, tgt, 0, 0);
+      }
+
+      cmTarget *dependentTarget = mf->FindTargetToUse(targetName.c_str());
+
+      const bool fromImported = dependentTarget
+                             && dependentTarget->IsImported();
+
+      cmTarget *evaluatedDependentTarget =
+        (targetName != evaluatedTargetName)
+          ? mf->FindTargetToUse(evaluatedTargetName.c_str())
+          : 0;
+
+      targetName = evaluatedTargetName;
+
+      const bool fromEvaluatedImported = evaluatedDependentTarget
+                             && evaluatedDependentTarget->IsImported();
+
+      if ((fromImported || fromEvaluatedImported)
+          && !cmSystemTools::FileExists(li->c_str()))
+        {
+        cmOStringStream e;
+        cmake::MessageType messageType = cmake::FATAL_ERROR;
+        if (fromEvaluatedImported)
+          {
+          switch(mf->GetPolicyStatus(cmPolicies::CMP0027))
+            {
+            case cmPolicies::WARN:
+              e << (mf->GetPolicies()
+                    ->GetPolicyWarning(cmPolicies::CMP0027)) << "\n";
+            case cmPolicies::OLD:
+              messageType = cmake::AUTHOR_WARNING;
+              break;
+            case cmPolicies::REQUIRED_ALWAYS:
+            case cmPolicies::REQUIRED_IF_USED:
+            case cmPolicies::NEW:
+              break;
+            }
+          }
+        e << "Imported target \"" << targetName << "\" includes "
+             "non-existent path\n  \"" << *li << "\"\nin its "
+             "INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:\n"
+             "* The path was deleted, renamed, or moved to another "
+             "location.\n"
+             "* An install or uninstall procedure did not complete "
+             "successfully.\n"
+             "* The installation package was faulty and references files it "
+             "does not provide.\n";
+        tgt->GetMakefile()->IssueMessage(messageType, e.str().c_str());
+        return;
+        }
+
+      if (!cmSystemTools::FileIsFullPath(li->c_str()))
+        {
+        cmOStringStream e;
+        bool noMessage = false;
+        cmake::MessageType messageType = cmake::FATAL_ERROR;
+        if (!targetName.empty())
+          {
+          e << "Target \"" << targetName << "\" contains relative "
+            "path in its INTERFACE_INCLUDE_DIRECTORIES:\n"
+            "  \"" << *li << "\"";
+          }
+        else
+          {
+          switch(tgt->GetPolicyStatusCMP0021())
+            {
+            case cmPolicies::WARN:
+              {
+              e << (mf->GetPolicies()
+                    ->GetPolicyWarning(cmPolicies::CMP0021)) << "\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;
+            }
+          e << "Found relative path while evaluating include directories of "
+          "\"" << tgt->GetName() << "\":\n  \"" << *li << "\"\n";
+          }
+        if (!noMessage)
+          {
+          tgt->GetMakefile()->IssueMessage(messageType, e.str().c_str());
+          if (messageType == cmake::FATAL_ERROR)
+            {
+            return;
+            }
+          }
+        }
+
+      if (testIsOff && !cmSystemTools::IsOff(li->c_str()))
+        {
+        cmSystemTools::ConvertToUnixSlashes(*li);
+        }
+      std::string inc = *li;
+
+      if(uniqueIncludes.insert(inc).second)
+        {
+        includes.push_back(inc);
+        if (debugIncludes)
+          {
+          usedIncludes += " * " + inc + "\n";
+          }
+        }
+      }
+    if (cacheIncludes)
+      {
+      (*it)->CachedEntries = entryIncludes;
+      }
+    if (!usedIncludes.empty())
+      {
+      mf->GetCMakeInstance()->IssueMessage(cmake::LOG,
+                            std::string("Used includes for target ")
+                            + tgt->GetName() + ":\n"
+                            + usedIncludes, (*it)->ge->GetBacktrace());
+      }
+    }
+}
+
+//----------------------------------------------------------------------------
+std::vector<std::string>
+cmTarget::GetIncludeDirectories(const char *config) const
+{
+  std::vector<std::string> includes;
+  std::set<std::string> uniqueIncludes;
+  cmListFileBacktrace lfbt;
+
+  cmGeneratorExpressionDAGChecker dagChecker(lfbt,
+                                             this->GetName(),
+                                             "INCLUDE_DIRECTORIES", 0, 0);
+
+  std::vector<std::string> debugProperties;
+  const char *debugProp =
+              this->Makefile->GetDefinition("CMAKE_DEBUG_TARGET_PROPERTIES");
+  if (debugProp)
+    {
+    cmSystemTools::ExpandListArgument(debugProp, debugProperties);
+    }
+
+  bool debugIncludes = !this->DebugIncludesDone
+                    && std::find(debugProperties.begin(),
+                                 debugProperties.end(),
+                                 "INCLUDE_DIRECTORIES")
+                        != debugProperties.end();
+
+  if (this->Makefile->IsGeneratingBuildSystem())
+    {
+    this->DebugIncludesDone = true;
+    }
+
+  processIncludeDirectories(this,
+                            this->Internal->IncludeDirectoriesEntries,
+                            includes,
+                            uniqueIncludes,
+                            &dagChecker,
+                            config,
+                            debugIncludes);
+
+  std::string configString = config ? config : "";
+  if (!this->Internal->CacheLinkInterfaceIncludeDirectoriesDone[configString])
+    {
+    for (std::vector<cmValueWithOrigin>::const_iterator
+        it = this->Internal->LinkImplementationPropertyEntries.begin(),
+        end = this->Internal->LinkImplementationPropertyEntries.end();
+        it != end; ++it)
+      {
+      if (!cmGeneratorExpression::IsValidTargetName(it->Value)
+          && cmGeneratorExpression::Find(it->Value) == std::string::npos)
+        {
+        continue;
+        }
+      {
+      cmGeneratorExpression ge(lfbt);
+      cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
+                                                        ge.Parse(it->Value);
+      std::string result = cge->Evaluate(this->Makefile, config,
+                                        false, this, 0, 0);
+      if (!this->Makefile->FindTargetToUse(result.c_str()))
+        {
+        continue;
+        }
+      }
+      std::string includeGenex = "$<TARGET_PROPERTY:" +
+                              it->Value + ",INTERFACE_INCLUDE_DIRECTORIES>";
+      if (cmGeneratorExpression::Find(it->Value) != std::string::npos)
+        {
+        // Because it->Value is a generator expression, ensure that it
+        // evaluates to the non-empty string before being used in the
+        // TARGET_PROPERTY expression.
+        includeGenex = "$<$<BOOL:" + it->Value + ">:" + includeGenex + ">";
+        }
+      cmGeneratorExpression ge(it->Backtrace);
+      cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(
+                                                              includeGenex);
+
+      this->Internal
+        ->CachedLinkInterfaceIncludeDirectoriesEntries[configString].push_back(
+                        new cmTargetInternals::TargetPropertyEntry(cge,
+                                                              it->Value));
+      }
+
+    if(this->Makefile->IsOn("APPLE"))
+      {
+      LinkImplementation const* impl = this->GetLinkImplementation(config,
+                                                                   this);
+      for(std::vector<std::string>::const_iterator
+          it = impl->Libraries.begin();
+          it != impl->Libraries.end(); ++it)
+        {
+        std::string libDir = cmSystemTools::CollapseFullPath(it->c_str());
+
+        static cmsys::RegularExpression
+          frameworkCheck("(.*\\.framework)(/Versions/[^/]+)?/[^/]+$");
+        if(!frameworkCheck.find(libDir))
+          {
+          continue;
+          }
+
+        libDir = frameworkCheck.match(1);
+
+        cmGeneratorExpression ge(lfbt);
+        cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
+                  ge.Parse(libDir.c_str());
+        this->Internal
+                ->CachedLinkInterfaceIncludeDirectoriesEntries[configString]
+                .push_back(new cmTargetInternals::TargetPropertyEntry(cge));
+        }
+      }
+    }
+
+  processIncludeDirectories(this,
+    this->Internal->CachedLinkInterfaceIncludeDirectoriesEntries[configString],
+                            includes,
+                            uniqueIncludes,
+                            &dagChecker,
+                            config,
+                            debugIncludes);
+
+  if (!this->Makefile->IsGeneratingBuildSystem())
+    {
+    deleteAndClear(
+                this->Internal->CachedLinkInterfaceIncludeDirectoriesEntries);
+    }
+  else
+    {
+    this->Internal->CacheLinkInterfaceIncludeDirectoriesDone[configString]
+                                                                      = true;
+    }
+
+  return includes;
+}
+
+//----------------------------------------------------------------------------
 static void processCompileOptionsInternal(cmTarget const* tgt,
       const std::vector<cmTargetInternals::TargetPropertyEntry*> &entries,
       std::vector<std::string> &options,
@@ -1305,6 +1987,32 @@ static void processCompileOptions(cmTarget const* tgt,
 }
 
 //----------------------------------------------------------------------------
+void cmTarget::GetAutoUicOptions(std::vector<std::string> &result,
+                                 const char *config) const
+{
+  const char *prop
+            = this->GetLinkInterfaceDependentStringProperty("AUTOUIC_OPTIONS",
+                                                            config);
+  if (!prop)
+    {
+    return;
+    }
+  cmListFileBacktrace lfbt;
+  cmGeneratorExpression ge(lfbt);
+
+  cmGeneratorExpressionDAGChecker dagChecker(lfbt,
+                                      this->GetName(),
+                                      "AUTOUIC_OPTIONS", 0, 0);
+  cmSystemTools::ExpandListArgument(ge.Parse(prop)
+                                      ->Evaluate(this->Makefile,
+                                                config,
+                                                false,
+                                                this,
+                                                &dagChecker),
+                                  result);
+}
+
+//----------------------------------------------------------------------------
 void cmTarget::GetCompileOptions(std::vector<std::string> &result,
                                  const char *config) const
 {
@@ -1752,6 +2460,19 @@ std::string cmTarget::GetPDBDirectory(const char* config) const
 }
 
 //----------------------------------------------------------------------------
+const char* cmTarget::GetLocation(const char* config) const
+{
+  if (this->IsImported())
+    {
+    return this->ImportedGetLocation(config);
+    }
+  else
+    {
+    return this->NormalGetLocation(config);
+    }
+}
+
+//----------------------------------------------------------------------------
 const char* cmTarget::ImportedGetLocation(const char* config) const
 {
   static std::string location;
@@ -1760,6 +2481,45 @@ const char* cmTarget::ImportedGetLocation(const char* config) const
 }
 
 //----------------------------------------------------------------------------
+const char* cmTarget::NormalGetLocation(const char* config) const
+{
+  static std::string location;
+  // Handle the configuration-specific case first.
+  if(config)
+    {
+    location = this->GetFullPath(config, false);
+    return location.c_str();
+    }
+
+  // Now handle the deprecated build-time configuration location.
+  location = this->GetDirectory();
+  if(!location.empty())
+    {
+    location += "/";
+    }
+  const char* cfgid = this->Makefile->GetDefinition("CMAKE_CFG_INTDIR");
+  if(cfgid && strcmp(cfgid, ".") != 0)
+    {
+    location += "/";
+    location += cfgid;
+    location += "/";
+    }
+
+  if(this->IsAppBundleOnApple())
+    {
+    std::string macdir = this->BuildMacContentDirectory("", config, false);
+    if(!macdir.empty())
+      {
+      location += "/";
+      location += macdir;
+      }
+    }
+  location += "/";
+  location += this->GetFullName(config, false);
+  return location.c_str();
+}
+
+//----------------------------------------------------------------------------
 void cmTarget::GetTargetVersion(int& major, int& minor) const
 {
   int patch;
@@ -1830,17 +2590,34 @@ bool cmTarget::HandleLocationPropertyPolicy() const
     {
     return true;
     }
+  const char *modal = 0;
+  cmake::MessageType messageType = cmake::AUTHOR_WARNING;
+  switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0026))
+    {
+    case cmPolicies::WARN:
+      modal = "should";
+    case cmPolicies::OLD:
+      break;
+    case cmPolicies::REQUIRED_ALWAYS:
+    case cmPolicies::REQUIRED_IF_USED:
+    case cmPolicies::NEW:
+      modal = "may";
+      messageType = cmake::FATAL_ERROR;
+    }
 
-  cmOStringStream e;
-  e << (this->Makefile->GetPolicies()
-        ->GetPolicyWarning(cmPolicies::CMP0026)) << "\n";
-  e << "The LOCATION property may not be read from target \""
-    << this->GetName() << "\".  Use the target name directly with "
-    "add_custom_command, or use the generator expression $<TARGET_FILE>, "
-    "as appropriate.\n";
-  this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str().c_str());
+  if (modal)
+    {
+    cmOStringStream e;
+    e << (this->Makefile->GetPolicies()
+          ->GetPolicyWarning(cmPolicies::CMP0026)) << "\n";
+    e << "The LOCATION property " << modal << " not be read from target \""
+      << this->GetName() << "\".  Use the target name directly with "
+      "add_custom_command, or use the generator expression $<TARGET_FILE>, "
+      "as appropriate.\n";
+    this->Makefile->IssueMessage(messageType, e.str().c_str());
+    }
 
-  return false;
+  return messageType != cmake::FATAL_ERROR;
 }
 
 //----------------------------------------------------------------------------
@@ -1891,7 +2668,7 @@ const char *cmTarget::GetProperty(const char* prop,
       // cannot take into account the per-configuration name of the
       // target because the configuration type may not be known at
       // CMake time.
-      this->Properties.SetProperty("LOCATION", this->ImportedGetLocation(0),
+      this->Properties.SetProperty("LOCATION", this->GetLocation(0),
                                    cmProperty::TARGET);
       }
 
@@ -1904,8 +2681,8 @@ const char *cmTarget::GetProperty(const char* prop,
         }
       std::string configName = prop+9;
       this->Properties.SetProperty(prop,
-                                this->ImportedGetLocation(configName.c_str()),
-                                cmProperty::TARGET);
+                                   this->GetLocation(configName.c_str()),
+                                   cmProperty::TARGET);
       }
     }
   if(strcmp(prop,"INCLUDE_DIRECTORIES") == 0)
@@ -2032,6 +2809,192 @@ bool cmTarget::GetPropertyAsBool(const char* prop) const
 {
   return cmSystemTools::IsOn(this->GetProperty(prop));
 }
+
+//----------------------------------------------------------------------------
+class cmTargetCollectLinkLanguages
+{
+public:
+  cmTargetCollectLinkLanguages(cmTarget const* target, const char* config,
+                               std::set<cmStdString>& languages,
+                               cmTarget const* head):
+    Config(config), Languages(languages), HeadTarget(head)
+  { this->Visited.insert(target); }
+
+  void Visit(cmTarget const* target)
+    {
+    if(!target || !this->Visited.insert(target).second)
+      {
+      return;
+      }
+
+    cmTarget::LinkInterface const* iface =
+      target->GetLinkInterface(this->Config, this->HeadTarget);
+    if(!iface) { return; }
+
+    for(std::vector<std::string>::const_iterator
+          li = iface->Languages.begin(); li != iface->Languages.end(); ++li)
+      {
+      this->Languages.insert(*li);
+      }
+
+    cmMakefile* mf = target->GetMakefile();
+    for(std::vector<std::string>::const_iterator
+          li = iface->Libraries.begin(); li != iface->Libraries.end(); ++li)
+      {
+      this->Visit(mf->FindTargetToUse(li->c_str()));
+      }
+    }
+private:
+  const char* Config;
+  std::set<cmStdString>& Languages;
+  cmTarget const* HeadTarget;
+  std::set<cmTarget const*> Visited;
+};
+
+//----------------------------------------------------------------------------
+const char* cmTarget::GetLinkerLanguage(const char* config,
+                                        cmTarget const* head) const
+{
+  cmTarget const* headTarget = head ? head : this;
+  const char* lang = this->GetLinkClosure(config, headTarget)
+                                                    ->LinkerLanguage.c_str();
+  return *lang? lang : 0;
+}
+
+//----------------------------------------------------------------------------
+cmTarget::LinkClosure const* cmTarget::GetLinkClosure(const char* config,
+                                                  cmTarget const* head) const
+{
+  TargetConfigPair key(head, cmSystemTools::UpperCase(config ? config : ""));
+  cmTargetInternals::LinkClosureMapType::iterator
+    i = this->Internal->LinkClosureMap.find(key);
+  if(i == this->Internal->LinkClosureMap.end())
+    {
+    LinkClosure lc;
+    this->ComputeLinkClosure(config, lc, head);
+    cmTargetInternals::LinkClosureMapType::value_type entry(key, lc);
+    i = this->Internal->LinkClosureMap.insert(entry).first;
+    }
+  return &i->second;
+}
+
+//----------------------------------------------------------------------------
+class cmTargetSelectLinker
+{
+  int Preference;
+  cmTarget const* Target;
+  cmMakefile* Makefile;
+  cmGlobalGenerator* GG;
+  std::set<cmStdString> Preferred;
+public:
+  cmTargetSelectLinker(cmTarget const* target): Preference(0), Target(target)
+    {
+    this->Makefile = this->Target->GetMakefile();
+    this->GG = this->Makefile->GetLocalGenerator()->GetGlobalGenerator();
+    }
+  void Consider(const char* lang)
+    {
+    int preference = this->GG->GetLinkerPreference(lang);
+    if(preference > this->Preference)
+      {
+      this->Preference = preference;
+      this->Preferred.clear();
+      }
+    if(preference == this->Preference)
+      {
+      this->Preferred.insert(lang);
+      }
+    }
+  std::string Choose()
+    {
+    if(this->Preferred.empty())
+      {
+      return "";
+      }
+    else if(this->Preferred.size() > 1)
+      {
+      cmOStringStream e;
+      e << "Target " << this->Target->GetName()
+        << " contains multiple languages with the highest linker preference"
+        << " (" << this->Preference << "):\n";
+      for(std::set<cmStdString>::const_iterator
+            li = this->Preferred.begin(); li != this->Preferred.end(); ++li)
+        {
+        e << "  " << *li << "\n";
+        }
+      e << "Set the LINKER_LANGUAGE property for this target.";
+      cmake* cm = this->Makefile->GetCMakeInstance();
+      cm->IssueMessage(cmake::FATAL_ERROR, e.str(),
+                       this->Target->GetBacktrace());
+      }
+    return *this->Preferred.begin();
+    }
+};
+
+//----------------------------------------------------------------------------
+void cmTarget::ComputeLinkClosure(const char* config, LinkClosure& lc,
+                                  cmTarget const* head) const
+{
+  // Get languages built in this target.
+  std::set<cmStdString> languages;
+  LinkImplementation const* impl = this->GetLinkImplementation(config, head);
+  for(std::vector<std::string>::const_iterator li = impl->Languages.begin();
+      li != impl->Languages.end(); ++li)
+    {
+    languages.insert(*li);
+    }
+
+  // Add interface languages from linked targets.
+  cmTargetCollectLinkLanguages cll(this, config, languages, head);
+  for(std::vector<std::string>::const_iterator li = impl->Libraries.begin();
+      li != impl->Libraries.end(); ++li)
+    {
+    cll.Visit(this->Makefile->FindTargetToUse(li->c_str()));
+    }
+
+  // Store the transitive closure of languages.
+  for(std::set<cmStdString>::const_iterator li = languages.begin();
+      li != languages.end(); ++li)
+    {
+    lc.Languages.push_back(*li);
+    }
+
+  // Choose the language whose linker should be used.
+  if(this->GetProperty("HAS_CXX"))
+    {
+    lc.LinkerLanguage = "CXX";
+    }
+  else if(const char* linkerLang = this->GetProperty("LINKER_LANGUAGE"))
+    {
+    lc.LinkerLanguage = linkerLang;
+    }
+  else
+    {
+    // Find the language with the highest preference value.
+    cmTargetSelectLinker tsl(this);
+
+    // First select from the languages compiled directly in this target.
+    for(std::vector<std::string>::const_iterator li = impl->Languages.begin();
+        li != impl->Languages.end(); ++li)
+      {
+      tsl.Consider(li->c_str());
+      }
+
+    // Now consider languages that propagate from linked targets.
+    for(std::set<cmStdString>::const_iterator sit = languages.begin();
+        sit != languages.end(); ++sit)
+      {
+      std::string propagates = "CMAKE_"+*sit+"_LINKER_PREFERENCE_PROPAGATES";
+      if(this->Makefile->IsOn(propagates.c_str()))
+        {
+        tsl.Consider(sit->c_str());
+        }
+      }
+
+    lc.LinkerLanguage = tsl.Choose();
+    }
+}
+
 //----------------------------------------------------------------------------
 const char* cmTarget::GetSuffixVariableInternal(bool implib) const
 {
@@ -2082,6 +3045,204 @@ const char* cmTarget::GetPrefixVariableInternal(bool implib) const
 }
 
 //----------------------------------------------------------------------------
+std::string cmTarget::GetPDBName(const char* config) const
+{
+  std::string prefix;
+  std::string base;
+  std::string suffix;
+  this->GetFullNameInternal(config, false, prefix, base, suffix);
+
+  std::vector<std::string> props;
+  std::string configUpper =
+    cmSystemTools::UpperCase(config? config : "");
+  if(!configUpper.empty())
+    {
+    // PDB_NAME_<CONFIG>
+    props.push_back("PDB_NAME_" + configUpper);
+    }
+
+  // PDB_NAME
+  props.push_back("PDB_NAME");
+
+  for(std::vector<std::string>::const_iterator i = props.begin();
+      i != props.end(); ++i)
+    {
+    if(const char* outName = this->GetProperty(i->c_str()))
+      {
+      base = outName;
+      break;
+      }
+    }
+  return prefix+base+".pdb";
+}
+
+//----------------------------------------------------------------------------
+bool cmTarget::HasSOName(const char* config) const
+{
+  // soname is supported only for shared libraries and modules,
+  // and then only when the platform supports an soname flag.
+  return ((this->GetType() == cmTarget::SHARED_LIBRARY ||
+           this->GetType() == cmTarget::MODULE_LIBRARY) &&
+          !this->GetPropertyAsBool("NO_SONAME") &&
+          this->Makefile->GetSONameFlag(this->GetLinkerLanguage(config,
+                                                                this)));
+}
+
+//----------------------------------------------------------------------------
+std::string cmTarget::GetSOName(const char* config) const
+{
+  if(this->IsImported())
+    {
+    // Lookup the imported soname.
+    if(cmTarget::ImportInfo const* info = this->GetImportInfo(config, this))
+      {
+      if(info->NoSOName)
+        {
+        // The imported library has no builtin soname so the name
+        // searched at runtime will be just the filename.
+        return cmSystemTools::GetFilenameName(info->Location);
+        }
+      else
+        {
+        // Use the soname given if any.
+        if(info->SOName.find("@rpath/") == 0)
+          {
+          return info->SOName.substr(6);
+          }
+        return info->SOName;
+        }
+      }
+    else
+      {
+      return "";
+      }
+    }
+  else
+    {
+    // Compute the soname that will be built.
+    std::string name;
+    std::string soName;
+    std::string realName;
+    std::string impName;
+    std::string pdbName;
+    this->GetLibraryNames(name, soName, realName, impName, pdbName, config);
+    return soName;
+    }
+}
+
+//----------------------------------------------------------------------------
+bool cmTarget::HasMacOSXRpathInstallNameDir(const char* 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, this))
+      {
+      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"))
+    {
+    cmOStringStream 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->GetLocalGenerator()->GetGlobalGenerator()->
+      AddCMP0042WarnTarget(this->GetName());
+    }
+
+  if(cmp0042 == cmPolicies::NEW)
+    {
+    return true;
+    }
+
+  return false;
+}
+
+//----------------------------------------------------------------------------
 bool cmTarget::IsImportedSharedLibWithoutSOName(const char* config) const
 {
   if(this->IsImported() && this->GetType() == cmTarget::SHARED_LIBRARY)
@@ -2095,6 +3256,57 @@ bool cmTarget::IsImportedSharedLibWithoutSOName(const char* config) const
 }
 
 //----------------------------------------------------------------------------
+std::string cmTarget::NormalGetRealName(const char* config) const
+{
+  // This should not be called for imported targets.
+  // TODO: Split cmTarget into a class hierarchy to get compile-time
+  // enforcement of the limited imported target API.
+  if(this->IsImported())
+    {
+    std::string msg =  "NormalGetRealName called on imported target: ";
+    msg += this->GetName();
+    this->GetMakefile()->
+      IssueMessage(cmake::INTERNAL_ERROR,
+                   msg.c_str());
+    }
+
+  if(this->GetType() == cmTarget::EXECUTABLE)
+    {
+    // Compute the real name that will be built.
+    std::string name;
+    std::string realName;
+    std::string impName;
+    std::string pdbName;
+    this->GetExecutableNames(name, realName, impName, pdbName, config);
+    return realName;
+    }
+  else
+    {
+    // Compute the real name that will be built.
+    std::string name;
+    std::string soName;
+    std::string realName;
+    std::string impName;
+    std::string pdbName;
+    this->GetLibraryNames(name, soName, realName, impName, pdbName, config);
+    return realName;
+    }
+}
+
+//----------------------------------------------------------------------------
+std::string cmTarget::GetFullName(const char* config, bool implib) const
+{
+  if(this->IsImported())
+    {
+    return this->GetFullNameImported(config, implib);
+    }
+  else
+    {
+    return this->GetFullNameInternal(config, implib);
+    }
+}
+
+//----------------------------------------------------------------------------
 std::string
 cmTarget::GetFullNameImported(const char* config, bool implib) const
 {
@@ -2103,6 +3315,56 @@ cmTarget::GetFullNameImported(const char* config, bool implib) const
 }
 
 //----------------------------------------------------------------------------
+void cmTarget::GetFullNameComponents(std::string& prefix, std::string& base,
+                                     std::string& suffix, const char* config,
+                                     bool implib) const
+{
+  this->GetFullNameInternal(config, implib, prefix, base, suffix);
+}
+
+//----------------------------------------------------------------------------
+std::string cmTarget::GetFullPath(const char* config, bool implib,
+                                  bool realname) const
+{
+  if(this->IsImported())
+    {
+    return this->ImportedGetFullPath(config, implib);
+    }
+  else
+    {
+    return this->NormalGetFullPath(config, implib, realname);
+    }
+}
+
+//----------------------------------------------------------------------------
+std::string cmTarget::NormalGetFullPath(const char* config, bool implib,
+                                        bool realname) const
+{
+  std::string fpath = this->GetDirectory(config, implib);
+  fpath += "/";
+  if(this->IsAppBundleOnApple())
+    {
+    fpath = this->BuildMacContentDirectory(fpath, config, false);
+    fpath += "/";
+    }
+
+  // Add the full name of the target.
+  if(implib)
+    {
+    fpath += this->GetFullName(config, true);
+    }
+  else if(realname)
+    {
+    fpath += this->NormalGetRealName(config);
+    }
+  else
+    {
+    fpath += this->GetFullName(config, false);
+    }
+  return fpath;
+}
+
+//----------------------------------------------------------------------------
 std::string
 cmTarget::ImportedGetFullPath(const char* config, bool implib) const
 {
@@ -2120,6 +3382,321 @@ cmTarget::ImportedGetFullPath(const char* config, bool implib) const
 }
 
 //----------------------------------------------------------------------------
+std::string
+cmTarget::GetFullNameInternal(const char* config, bool implib) const
+{
+  std::string prefix;
+  std::string base;
+  std::string suffix;
+  this->GetFullNameInternal(config, implib, prefix, base, suffix);
+  return prefix+base+suffix;
+}
+
+//----------------------------------------------------------------------------
+void cmTarget::GetFullNameInternal(const char* config,
+                                   bool implib,
+                                   std::string& outPrefix,
+                                   std::string& outBase,
+                                   std::string& outSuffix) const
+{
+  // Use just the target name for non-main target types.
+  if(this->GetType() != cmTarget::STATIC_LIBRARY &&
+     this->GetType() != cmTarget::SHARED_LIBRARY &&
+     this->GetType() != cmTarget::MODULE_LIBRARY &&
+     this->GetType() != cmTarget::EXECUTABLE)
+    {
+    outPrefix = "";
+    outBase = this->GetName();
+    outSuffix = "";
+    return;
+    }
+
+  // Return an empty name for the import library if this platform
+  // does not support import libraries.
+  if(implib &&
+     !this->Makefile->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX"))
+    {
+    outPrefix = "";
+    outBase = "";
+    outSuffix = "";
+    return;
+    }
+
+  // The implib option is only allowed for shared libraries, module
+  // libraries, and executables.
+  if(this->GetType() != cmTarget::SHARED_LIBRARY &&
+     this->GetType() != cmTarget::MODULE_LIBRARY &&
+     this->GetType() != cmTarget::EXECUTABLE)
+    {
+    implib = false;
+    }
+
+  // Compute the full name for main target types.
+  const char* targetPrefix = (implib
+                              ? this->GetProperty("IMPORT_PREFIX")
+                              : this->GetProperty("PREFIX"));
+  const char* targetSuffix = (implib
+                              ? this->GetProperty("IMPORT_SUFFIX")
+                              : this->GetProperty("SUFFIX"));
+  const char* configPostfix = 0;
+  if(config && *config)
+    {
+    std::string configProp = cmSystemTools::UpperCase(config);
+    configProp += "_POSTFIX";
+    configPostfix = this->GetProperty(configProp.c_str());
+    // Mac application bundles and frameworks have no postfix.
+    if(configPostfix &&
+       (this->IsAppBundleOnApple() || this->IsFrameworkOnApple()))
+      {
+      configPostfix = 0;
+      }
+    }
+  const char* prefixVar = this->GetPrefixVariableInternal(implib);
+  const char* suffixVar = this->GetSuffixVariableInternal(implib);
+
+  // Check for language-specific default prefix and suffix.
+  if(const char* ll = this->GetLinkerLanguage(config, this))
+    {
+    if(!targetSuffix && suffixVar && *suffixVar)
+      {
+      std::string langSuff = suffixVar + std::string("_") + ll;
+      targetSuffix = this->Makefile->GetDefinition(langSuff.c_str());
+      }
+    if(!targetPrefix && prefixVar && *prefixVar)
+      {
+      std::string langPrefix = prefixVar + std::string("_") + ll;
+      targetPrefix = this->Makefile->GetDefinition(langPrefix.c_str());
+      }
+    }
+
+  // if there is no prefix on the target use the cmake definition
+  if(!targetPrefix && prefixVar)
+    {
+    targetPrefix = this->Makefile->GetSafeDefinition(prefixVar);
+    }
+  // if there is no suffix on the target use the cmake definition
+  if(!targetSuffix && suffixVar)
+    {
+    targetSuffix = this->Makefile->GetSafeDefinition(suffixVar);
+    }
+
+  // frameworks have directory prefix but no suffix
+  std::string fw_prefix;
+  if(this->IsFrameworkOnApple())
+    {
+    fw_prefix = this->GetOutputName(config, false);
+    fw_prefix += ".framework/";
+    targetPrefix = fw_prefix.c_str();
+    targetSuffix = 0;
+    }
+
+  if(this->IsCFBundleOnApple())
+    {
+    fw_prefix = this->GetOutputName(config, false);
+    fw_prefix += ".";
+    const char *ext = this->GetProperty("BUNDLE_EXTENSION");
+    if (!ext)
+      {
+      ext = "bundle";
+      }
+    fw_prefix += ext;
+    fw_prefix += "/Contents/MacOS/";
+    targetPrefix = fw_prefix.c_str();
+    targetSuffix = 0;
+    }
+
+  // Begin the final name with the prefix.
+  outPrefix = targetPrefix?targetPrefix:"";
+
+  // Append the target name or property-specified name.
+  outBase += this->GetOutputName(config, implib);
+
+  // Append the per-configuration postfix.
+  outBase += configPostfix?configPostfix:"";
+
+  // Name shared libraries with their version number on some platforms.
+  if(const char* soversion = this->GetProperty("SOVERSION"))
+    {
+    if(this->GetType() == cmTarget::SHARED_LIBRARY && !implib &&
+       this->Makefile->IsOn("CMAKE_SHARED_LIBRARY_NAME_WITH_VERSION"))
+      {
+      outBase += "-";
+      outBase += soversion;
+      }
+    }
+
+  // Append the suffix.
+  outSuffix = targetSuffix?targetSuffix:"";
+}
+
+//----------------------------------------------------------------------------
+void cmTarget::GetLibraryNames(std::string& name,
+                               std::string& soName,
+                               std::string& realName,
+                               std::string& impName,
+                               std::string& pdbName,
+                               const char* config) const
+{
+  // This should not be called for imported targets.
+  // TODO: Split cmTarget into a class hierarchy to get compile-time
+  // enforcement of the limited imported target API.
+  if(this->IsImported())
+    {
+    std::string msg =  "GetLibraryNames called on imported target: ";
+    msg += this->GetName();
+    this->Makefile->IssueMessage(cmake::INTERNAL_ERROR,
+                                 msg.c_str());
+    return;
+    }
+
+  assert(this->GetType() != INTERFACE_LIBRARY);
+
+  // Check for library version properties.
+  const char* version = this->GetProperty("VERSION");
+  const char* soversion = this->GetProperty("SOVERSION");
+  if(!this->HasSOName(config) ||
+     this->IsFrameworkOnApple())
+    {
+    // Versioning is supported only for shared libraries and modules,
+    // and then only when the platform supports an soname flag.
+    version = 0;
+    soversion = 0;
+    }
+  if(version && !soversion)
+    {
+    // The soversion must be set if the library version is set.  Use
+    // the library version as the soversion.
+    soversion = version;
+    }
+  if(!version && soversion)
+    {
+    // Use the soversion as the library version.
+    version = soversion;
+    }
+
+  // Get the components of the library name.
+  std::string prefix;
+  std::string base;
+  std::string suffix;
+  this->GetFullNameInternal(config, false, prefix, base, suffix);
+
+  // The library name.
+  name = prefix+base+suffix;
+
+  if(this->IsFrameworkOnApple())
+    {
+    realName = prefix;
+    realName += "Versions/";
+    realName += this->GetFrameworkVersion();
+    realName += "/";
+    realName += base;
+    soName = realName;
+    }
+  else
+    {
+    // The library's soname.
+    this->ComputeVersionedName(soName, prefix, base, suffix,
+                               name, soversion);
+    // The library's real name on disk.
+    this->ComputeVersionedName(realName, prefix, base, suffix,
+                               name, version);
+    }
+
+  // The import library name.
+  if(this->GetType() == cmTarget::SHARED_LIBRARY ||
+     this->GetType() == cmTarget::MODULE_LIBRARY)
+    {
+    impName = this->GetFullNameInternal(config, true);
+    }
+  else
+    {
+    impName = "";
+    }
+
+  // The program database file name.
+  pdbName = this->GetPDBName(config);
+}
+
+//----------------------------------------------------------------------------
+void cmTarget::ComputeVersionedName(std::string& vName,
+                                    std::string const& prefix,
+                                    std::string const& base,
+                                    std::string const& suffix,
+                                    std::string const& name,
+                                    const char* version) const
+{
+  vName = this->IsApple? (prefix+base) : name;
+  if(version)
+    {
+    vName += ".";
+    vName += version;
+    }
+  vName += this->IsApple? suffix : std::string();
+}
+
+//----------------------------------------------------------------------------
+void cmTarget::GetExecutableNames(std::string& name,
+                                  std::string& realName,
+                                  std::string& impName,
+                                  std::string& pdbName,
+                                  const char* config) const
+{
+  // This should not be called for imported targets.
+  // TODO: Split cmTarget into a class hierarchy to get compile-time
+  // enforcement of the limited imported target API.
+  if(this->IsImported())
+    {
+    std::string msg =
+      "GetExecutableNames called on imported target: ";
+    msg += this->GetName();
+    this->GetMakefile()->IssueMessage(cmake::INTERNAL_ERROR, msg.c_str());
+    }
+
+  // This versioning is supported only for executables and then only
+  // when the platform supports symbolic links.
+#if defined(_WIN32) && !defined(__CYGWIN__)
+  const char* version = 0;
+#else
+  // Check for executable version properties.
+  const char* version = this->GetProperty("VERSION");
+  if(this->GetType() != cmTarget::EXECUTABLE || this->Makefile->IsOn("XCODE"))
+    {
+    version = 0;
+    }
+#endif
+
+  // Get the components of the executable name.
+  std::string prefix;
+  std::string base;
+  std::string suffix;
+  this->GetFullNameInternal(config, false, prefix, base, suffix);
+
+  // The executable name.
+  name = prefix+base+suffix;
+
+  // The executable's real name on disk.
+#if defined(__CYGWIN__)
+  realName = prefix+base;
+#else
+  realName = name;
+#endif
+  if(version)
+    {
+    realName += "-";
+    realName += version;
+    }
+#if defined(__CYGWIN__)
+  realName += suffix;
+#endif
+
+  // The import library name.
+  impName = this->GetFullNameInternal(config, true);
+
+  // The program database file name.
+  pdbName = this->GetPDBName(config);
+}
+
+//----------------------------------------------------------------------------
 bool cmTarget::HasImplibGNUtoMS() const
 {
   return this->HasImportLibrary() && this->GetPropertyAsBool("GNUtoMS");
@@ -2158,6 +3735,155 @@ void cmTarget::SetPropertyDefault(const char* property,
 }
 
 //----------------------------------------------------------------------------
+bool cmTarget::HaveBuildTreeRPATH(const char *config) const
+{
+  if (this->GetPropertyAsBool("SKIP_BUILD_RPATH"))
+    {
+    return false;
+    }
+  std::vector<std::string> libs;
+  this->GetDirectLinkLibraries(config, libs, this);
+  return !libs.empty();
+}
+
+//----------------------------------------------------------------------------
+bool cmTarget::HaveInstallTreeRPATH() const
+{
+  const char* install_rpath = this->GetProperty("INSTALL_RPATH");
+  return (install_rpath && *install_rpath) &&
+          !this->Makefile->IsOn("CMAKE_SKIP_INSTALL_RPATH");
+}
+
+//----------------------------------------------------------------------------
+bool cmTarget::NeedRelinkBeforeInstall(const char* config) const
+{
+  // Only executables and shared libraries can have an rpath and may
+  // need relinking.
+  if(this->TargetTypeValue != cmTarget::EXECUTABLE &&
+     this->TargetTypeValue != cmTarget::SHARED_LIBRARY &&
+     this->TargetTypeValue != cmTarget::MODULE_LIBRARY)
+    {
+    return false;
+    }
+
+  // If there is no install location this target will not be installed
+  // and therefore does not need relinking.
+  if(!this->GetHaveInstallRule())
+    {
+    return false;
+    }
+
+  // If skipping all rpaths completely then no relinking is needed.
+  if(this->Makefile->IsOn("CMAKE_SKIP_RPATH"))
+    {
+    return false;
+    }
+
+  // If building with the install-tree rpath no relinking is needed.
+  if(this->GetPropertyAsBool("BUILD_WITH_INSTALL_RPATH"))
+    {
+    return false;
+    }
+
+  // If chrpath is going to be used no relinking is needed.
+  if(this->IsChrpathUsed(config))
+    {
+    return false;
+    }
+
+  // Check for rpath support on this platform.
+  if(const char* ll = this->GetLinkerLanguage(config, this))
+    {
+    std::string flagVar = "CMAKE_SHARED_LIBRARY_RUNTIME_";
+    flagVar += ll;
+    flagVar += "_FLAG";
+    if(!this->Makefile->IsSet(flagVar.c_str()))
+      {
+      // There is no rpath support on this platform so nothing needs
+      // relinking.
+      return false;
+      }
+    }
+  else
+    {
+    // No linker language is known.  This error will be reported by
+    // other code.
+    return false;
+    }
+
+  // If either a build or install tree rpath is set then the rpath
+  // will likely change between the build tree and install tree and
+  // this target must be relinked.
+  return this->HaveBuildTreeRPATH(config) || this->HaveInstallTreeRPATH();
+}
+
+//----------------------------------------------------------------------------
+std::string cmTarget::GetInstallNameDirForBuildTree(const char* config) const
+{
+  // If building directly for installation then the build tree install_name
+  // is the same as the install tree.
+  if(this->GetPropertyAsBool("BUILD_WITH_INSTALL_RPATH"))
+    {
+    return GetInstallNameDirForInstallTree();
+    }
+
+  // Use the build tree directory for the target.
+  if(this->Makefile->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME") &&
+     !this->Makefile->IsOn("CMAKE_SKIP_RPATH") &&
+     !this->GetPropertyAsBool("SKIP_BUILD_RPATH"))
+    {
+    std::string dir;
+    bool macosx_rpath = this->MacOSXRpathInstallNameDirDefault();
+    if(macosx_rpath)
+      {
+      dir = "@rpath";
+      }
+    else
+      {
+      dir = this->GetDirectory(config);
+      }
+    dir += "/";
+    return dir;
+    }
+  else
+    {
+    return "";
+    }
+}
+
+//----------------------------------------------------------------------------
+std::string cmTarget::GetInstallNameDirForInstallTree() const
+{
+  if(this->Makefile->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME"))
+    {
+    std::string dir;
+    const char* install_name_dir = this->GetProperty("INSTALL_NAME_DIR");
+
+    if(!this->Makefile->IsOn("CMAKE_SKIP_RPATH") &&
+       !this->Makefile->IsOn("CMAKE_SKIP_INSTALL_RPATH"))
+      {
+      if(install_name_dir && *install_name_dir)
+        {
+        dir = install_name_dir;
+        dir += "/";
+        }
+      }
+    if(!install_name_dir)
+      {
+      if(this->MacOSXRpathInstallNameDirDefault())
+        {
+        dir = "@rpath/";
+        }
+      }
+    return dir;
+    }
+  else
+    {
+    return "";
+    }
+}
+
+//----------------------------------------------------------------------------
 const char* cmTarget::GetOutputTargetType(bool implib) const
 {
   switch(this->GetType())
@@ -2361,6 +4087,43 @@ bool cmTarget::UsesDefaultOutputDir(const char* config, bool implib) const
 }
 
 //----------------------------------------------------------------------------
+std::string cmTarget::GetOutputName(const char* config, bool implib) const
+{
+  std::vector<std::string> props;
+  std::string type = this->GetOutputTargetType(implib);
+  std::string configUpper = cmSystemTools::UpperCase(config? config : "");
+  if(!type.empty() && !configUpper.empty())
+    {
+    // <ARCHIVE|LIBRARY|RUNTIME>_OUTPUT_NAME_<CONFIG>
+    props.push_back(type + "_OUTPUT_NAME_" + configUpper);
+    }
+  if(!type.empty())
+    {
+    // <ARCHIVE|LIBRARY|RUNTIME>_OUTPUT_NAME
+    props.push_back(type + "_OUTPUT_NAME");
+    }
+  if(!configUpper.empty())
+    {
+    // OUTPUT_NAME_<CONFIG>
+    props.push_back("OUTPUT_NAME_" + configUpper);
+    // <CONFIG>_OUTPUT_NAME
+    props.push_back(configUpper + "_OUTPUT_NAME");
+    }
+  // OUTPUT_NAME
+  props.push_back("OUTPUT_NAME");
+
+  for(std::vector<std::string>::const_iterator i = props.begin();
+      i != props.end(); ++i)
+    {
+    if(const char* outName = this->GetProperty(i->c_str()))
+      {
+      return outName;
+      }
+    }
+  return this->GetName();
+}
+
+//----------------------------------------------------------------------------
 std::string cmTarget::GetFrameworkVersion() const
 {
   assert(this->GetType() != INTERFACE_LIBRARY);
@@ -2413,6 +4176,581 @@ bool cmTarget::IsNullImpliedByLinkLibraries(const std::string &p) const
 }
 
 //----------------------------------------------------------------------------
+template<typename PropertyType>
+PropertyType getTypedProperty(cmTarget const* tgt, const char *prop,
+                              PropertyType *);
+
+//----------------------------------------------------------------------------
+template<>
+bool getTypedProperty<bool>(cmTarget const* tgt, const char *prop, bool *)
+{
+  return tgt->GetPropertyAsBool(prop);
+}
+
+//----------------------------------------------------------------------------
+template<>
+const char *getTypedProperty<const char *>(cmTarget const* tgt,
+                                           const char *prop,
+                                           const char **)
+{
+  return tgt->GetProperty(prop);
+}
+
+enum CompatibleType
+{
+  BoolType,
+  StringType,
+  NumberMinType,
+  NumberMaxType
+};
+
+//----------------------------------------------------------------------------
+template<typename PropertyType>
+std::pair<bool, PropertyType> consistentProperty(PropertyType lhs,
+                                                 PropertyType rhs,
+                                                 CompatibleType t);
+
+//----------------------------------------------------------------------------
+template<>
+std::pair<bool, bool> consistentProperty(bool lhs, bool rhs, CompatibleType)
+{
+  return std::make_pair(lhs == rhs, lhs);
+}
+
+//----------------------------------------------------------------------------
+std::pair<bool, const char*> consistentStringProperty(const char *lhs,
+                                                      const char *rhs)
+{
+  const bool b = strcmp(lhs, rhs) == 0;
+  return std::make_pair(b, b ? lhs : 0);
+}
+
+#if defined(_MSC_VER) && _MSC_VER <= 1200
+template<typename T> const T&
+cmMaximum(const T& l, const T& r) {return l > r ? l : r;}
+template<typename T> const T&
+cmMinimum(const T& l, const T& r) {return l < r ? l : r;}
+#else
+#define cmMinimum std::min
+#define cmMaximum std::max
+#endif
+
+//----------------------------------------------------------------------------
+std::pair<bool, const char*> consistentNumberProperty(const char *lhs,
+                                                      const char *rhs,
+                                                      CompatibleType t)
+{
+  char *pEnd;
+
+#if defined(_MSC_VER)
+  static const char* const null_ptr = 0;
+#else
+# define null_ptr 0
+#endif
+
+  long lnum = strtol(lhs, &pEnd, 0);
+  if (pEnd == lhs || *pEnd != '\0' || errno == ERANGE)
+    {
+    return std::pair<bool, const char*>(false, null_ptr);
+    }
+
+  long rnum = strtol(rhs, &pEnd, 0);
+  if (pEnd == rhs || *pEnd != '\0' || errno == ERANGE)
+    {
+    return std::pair<bool, const char*>(false, null_ptr);
+    }
+
+#if !defined(_MSC_VER)
+#undef null_ptr
+#endif
+
+  if (t == NumberMaxType)
+    {
+    return std::make_pair(true, cmMaximum(lnum, rnum) == lnum ? lhs : rhs);
+    }
+  else
+    {
+    return std::make_pair(true, cmMinimum(lnum, rnum) == lnum ? lhs : rhs);
+    }
+}
+
+//----------------------------------------------------------------------------
+template<>
+std::pair<bool, const char*> consistentProperty(const char *lhs,
+                                                const char *rhs,
+                                                CompatibleType t)
+{
+  if (!lhs && !rhs)
+    {
+    return std::make_pair(true, lhs);
+    }
+  if (!lhs)
+    {
+    return std::make_pair(true, rhs);
+    }
+  if (!rhs)
+    {
+    return std::make_pair(true, lhs);
+    }
+
+#if defined(_MSC_VER)
+  static const char* const null_ptr = 0;
+#else
+# define null_ptr 0
+#endif
+
+  switch(t)
+  {
+  case BoolType:
+    assert(!"consistentProperty for strings called with BoolType");
+    return std::pair<bool, const char*>(false, null_ptr);
+  case StringType:
+    return consistentStringProperty(lhs, rhs);
+  case NumberMinType:
+  case NumberMaxType:
+    return consistentNumberProperty(lhs, rhs, t);
+  }
+  assert(!"Unreachable!");
+  return std::pair<bool, const char*>(false, null_ptr);
+
+#if !defined(_MSC_VER)
+#undef null_ptr
+#endif
+
+}
+
+template<typename PropertyType>
+PropertyType impliedValue(PropertyType);
+template<>
+bool impliedValue<bool>(bool)
+{
+  return false;
+}
+template<>
+const char* impliedValue<const char*>(const char*)
+{
+  return "";
+}
+
+
+template<typename PropertyType>
+std::string valueAsString(PropertyType);
+template<>
+std::string valueAsString<bool>(bool value)
+{
+  return value ? "TRUE" : "FALSE";
+}
+template<>
+std::string valueAsString<const char*>(const char* value)
+{
+  return value ? value : "(unset)";
+}
+
+//----------------------------------------------------------------------------
+void
+cmTarget::ReportPropertyOrigin(const std::string &p,
+                               const std::string &result,
+                               const std::string &report,
+                               const std::string &compatibilityType) const
+{
+  std::vector<std::string> debugProperties;
+  const char *debugProp =
+          this->Makefile->GetDefinition("CMAKE_DEBUG_TARGET_PROPERTIES");
+  if (debugProp)
+    {
+    cmSystemTools::ExpandListArgument(debugProp, debugProperties);
+    }
+
+  bool debugOrigin = !this->DebugCompatiblePropertiesDone[p]
+                    && std::find(debugProperties.begin(),
+                                 debugProperties.end(),
+                                 p)
+                        != debugProperties.end();
+
+  if (this->Makefile->IsGeneratingBuildSystem())
+    {
+    this->DebugCompatiblePropertiesDone[p] = true;
+    }
+  if (!debugOrigin)
+    {
+    return;
+    }
+
+  std::string areport = compatibilityType;
+  areport += std::string(" of property \"") + p + "\" for target \"";
+  areport += std::string(this->GetName());
+  areport += "\" (result: \"";
+  areport += result;
+  areport += "\"):\n" + report;
+
+  cmListFileBacktrace lfbt;
+  this->Makefile->GetCMakeInstance()->IssueMessage(cmake::LOG, areport, lfbt);
+}
+
+//----------------------------------------------------------------------------
+std::string compatibilityType(CompatibleType t)
+{
+  switch(t)
+    {
+    case BoolType:
+      return "Boolean compatibility";
+    case StringType:
+      return "String compatibility";
+    case NumberMaxType:
+      return "Numeric maximum compatibility";
+    case NumberMinType:
+      return "Numeric minimum compatibility";
+    }
+  assert(!"Unreachable!");
+  return "";
+}
+
+//----------------------------------------------------------------------------
+std::string compatibilityAgree(CompatibleType t, bool dominant)
+{
+  switch(t)
+    {
+    case BoolType:
+    case StringType:
+      return dominant ? "(Disagree)\n" : "(Agree)\n";
+    case NumberMaxType:
+    case NumberMinType:
+      return dominant ? "(Dominant)\n" : "(Ignored)\n";
+    }
+  assert(!"Unreachable!");
+  return "";
+}
+
+//----------------------------------------------------------------------------
+template<typename PropertyType>
+PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
+                                          const std::string &p,
+                                          const char *config,
+                                          const char *defaultValue,
+                                          CompatibleType t,
+                                          PropertyType *)
+{
+  PropertyType propContent = getTypedProperty<PropertyType>(tgt, p.c_str(),
+                                                            0);
+  const bool explicitlySet = tgt->GetProperties()
+                                  .find(p.c_str())
+                                  != tgt->GetProperties().end();
+  const bool impliedByUse =
+          tgt->IsNullImpliedByLinkLibraries(p);
+  assert((impliedByUse ^ explicitlySet)
+      || (!impliedByUse && !explicitlySet));
+
+  cmComputeLinkInformation *info = tgt->GetLinkInformation(config);
+  if(!info)
+    {
+    return propContent;
+    }
+  const cmComputeLinkInformation::ItemVector &deps = info->GetItems();
+  bool propInitialized = explicitlySet;
+
+  std::string report = " * Target \"";
+  report += tgt->GetName();
+  if (explicitlySet)
+    {
+    report += "\" has property content \"";
+    report += valueAsString<PropertyType>(propContent);
+    report += "\"\n";
+    }
+  else if (impliedByUse)
+    {
+    report += "\" property is implied by use.\n";
+    }
+  else
+    {
+    report += "\" property not set.\n";
+    }
+
+  for(cmComputeLinkInformation::ItemVector::const_iterator li =
+      deps.begin();
+      li != deps.end(); ++li)
+    {
+    // An error should be reported if one dependency
+    // has INTERFACE_POSITION_INDEPENDENT_CODE ON and the other
+    // has INTERFACE_POSITION_INDEPENDENT_CODE OFF, or if the
+    // target itself has a POSITION_INDEPENDENT_CODE which disagrees
+    // with a dependency.
+
+    if (!li->Target)
+      {
+      continue;
+      }
+
+    const bool ifaceIsSet = li->Target->GetProperties()
+                            .find("INTERFACE_" + p)
+                            != li->Target->GetProperties().end();
+    PropertyType ifacePropContent =
+                    getTypedProperty<PropertyType>(li->Target,
+                              ("INTERFACE_" + p).c_str(), 0);
+
+    std::string reportEntry;
+    if (ifaceIsSet)
+      {
+      reportEntry += " * Target \"";
+      reportEntry += li->Target->GetName();
+      reportEntry += "\" property value \"";
+      reportEntry += valueAsString<PropertyType>(ifacePropContent);
+      reportEntry += "\" ";
+      }
+
+    if (explicitlySet)
+      {
+      if (ifaceIsSet)
+        {
+        std::pair<bool, PropertyType> consistent =
+                                  consistentProperty(propContent,
+                                                     ifacePropContent, t);
+        report += reportEntry;
+        report += compatibilityAgree(t, propContent != consistent.second);
+        if (!consistent.first)
+          {
+          cmOStringStream e;
+          e << "Property " << p << " on target \""
+            << tgt->GetName() << "\" does\nnot match the "
+            "INTERFACE_" << p << " property requirement\nof "
+            "dependency \"" << li->Target->GetName() << "\".\n";
+          cmSystemTools::Error(e.str().c_str());
+          break;
+          }
+        else
+          {
+          propContent = consistent.second;
+          continue;
+          }
+        }
+      else
+        {
+        // Explicitly set on target and not set in iface. Can't disagree.
+        continue;
+        }
+      }
+    else if (impliedByUse)
+      {
+      propContent = impliedValue<PropertyType>(propContent);
+
+      if (ifaceIsSet)
+        {
+        std::pair<bool, PropertyType> consistent =
+                                  consistentProperty(propContent,
+                                                     ifacePropContent, t);
+        report += reportEntry;
+        report += compatibilityAgree(t, propContent != consistent.second);
+        if (!consistent.first)
+          {
+          cmOStringStream e;
+          e << "Property " << p << " on target \""
+            << tgt->GetName() << "\" is\nimplied to be " << defaultValue
+            << " because it was used to determine the link libraries\n"
+               "already. The INTERFACE_" << p << " property on\ndependency \""
+            << li->Target->GetName() << "\" is in conflict.\n";
+          cmSystemTools::Error(e.str().c_str());
+          break;
+          }
+        else
+          {
+          propContent = consistent.second;
+          continue;
+          }
+        }
+      else
+        {
+        // Implicitly set on target and not set in iface. Can't disagree.
+        continue;
+        }
+      }
+    else
+      {
+      if (ifaceIsSet)
+        {
+        if (propInitialized)
+          {
+          std::pair<bool, PropertyType> consistent =
+                                    consistentProperty(propContent,
+                                                       ifacePropContent, t);
+          report += reportEntry;
+          report += compatibilityAgree(t, propContent != consistent.second);
+          if (!consistent.first)
+            {
+            cmOStringStream e;
+            e << "The INTERFACE_" << p << " property of \""
+              << li->Target->GetName() << "\" does\nnot agree with the value "
+                "of " << p << " already determined\nfor \""
+              << tgt->GetName() << "\".\n";
+            cmSystemTools::Error(e.str().c_str());
+            break;
+            }
+          else
+            {
+            propContent = consistent.second;
+            continue;
+            }
+          }
+        else
+          {
+          report += reportEntry + "(Interface set)\n";
+          propContent = ifacePropContent;
+          propInitialized = true;
+          }
+        }
+      else
+        {
+        // Not set. Nothing to agree on.
+        continue;
+        }
+      }
+    }
+
+  tgt->ReportPropertyOrigin(p, valueAsString<PropertyType>(propContent),
+                            report, compatibilityType(t));
+  return propContent;
+}
+
+//----------------------------------------------------------------------------
+bool cmTarget::GetLinkInterfaceDependentBoolProperty(const std::string &p,
+                                                     const char *config) const
+{
+  return checkInterfacePropertyCompatibility<bool>(this, p, config, "FALSE",
+                                                   BoolType, 0);
+}
+
+//----------------------------------------------------------------------------
+const char * cmTarget::GetLinkInterfaceDependentStringProperty(
+                                                      const std::string &p,
+                                                      const char *config) const
+{
+  return checkInterfacePropertyCompatibility<const char *>(this,
+                                                           p,
+                                                           config,
+                                                           "empty",
+                                                           StringType, 0);
+}
+
+//----------------------------------------------------------------------------
+const char * cmTarget::GetLinkInterfaceDependentNumberMinProperty(
+                                                      const std::string &p,
+                                                      const char *config) const
+{
+  return checkInterfacePropertyCompatibility<const char *>(this,
+                                                           p,
+                                                           config,
+                                                           "empty",
+                                                           NumberMinType, 0);
+}
+
+//----------------------------------------------------------------------------
+const char * cmTarget::GetLinkInterfaceDependentNumberMaxProperty(
+                                                      const std::string &p,
+                                                      const char *config) const
+{
+  return checkInterfacePropertyCompatibility<const char *>(this,
+                                                           p,
+                                                           config,
+                                                           "empty",
+                                                           NumberMaxType, 0);
+}
+
+//----------------------------------------------------------------------------
+bool isLinkDependentProperty(cmTarget const* tgt, const std::string &p,
+                             const char *interfaceProperty,
+                             const char *config)
+{
+  cmComputeLinkInformation *info = tgt->GetLinkInformation(config);
+  if(!info)
+    {
+    return false;
+    }
+
+  const cmComputeLinkInformation::ItemVector &deps = info->GetItems();
+
+  for(cmComputeLinkInformation::ItemVector::const_iterator li =
+      deps.begin();
+      li != deps.end(); ++li)
+    {
+    if (!li->Target)
+      {
+      continue;
+      }
+    const char *prop = li->Target->GetProperty(interfaceProperty);
+    if (!prop)
+      {
+      continue;
+      }
+
+    std::vector<std::string> props;
+    cmSystemTools::ExpandListArgument(prop, props);
+
+    for(std::vector<std::string>::iterator pi = props.begin();
+        pi != props.end(); ++pi)
+      {
+      if (*pi == p)
+        {
+        return true;
+        }
+      }
+    }
+
+  return false;
+}
+
+//----------------------------------------------------------------------------
+bool cmTarget::IsLinkInterfaceDependentBoolProperty(const std::string &p,
+                                           const char *config) const
+{
+  if (this->TargetTypeValue == OBJECT_LIBRARY
+      || this->TargetTypeValue == INTERFACE_LIBRARY)
+    {
+    return false;
+    }
+  return (p == "POSITION_INDEPENDENT_CODE") ||
+    isLinkDependentProperty(this, p, "COMPATIBLE_INTERFACE_BOOL",
+                                 config);
+}
+
+//----------------------------------------------------------------------------
+bool cmTarget::IsLinkInterfaceDependentStringProperty(const std::string &p,
+                                    const char *config) const
+{
+  if (this->TargetTypeValue == OBJECT_LIBRARY
+      || this->TargetTypeValue == INTERFACE_LIBRARY)
+    {
+    return false;
+    }
+  return (p == "AUTOUIC_OPTIONS") ||
+    isLinkDependentProperty(this, p, "COMPATIBLE_INTERFACE_STRING",
+                                 config);
+}
+
+//----------------------------------------------------------------------------
+bool cmTarget::IsLinkInterfaceDependentNumberMinProperty(const std::string &p,
+                                    const char *config) const
+{
+  if (this->TargetTypeValue == OBJECT_LIBRARY
+      || this->TargetTypeValue == INTERFACE_LIBRARY)
+    {
+    return false;
+    }
+  return isLinkDependentProperty(this, p, "COMPATIBLE_INTERFACE_NUMBER_MIN",
+                                 config);
+}
+
+//----------------------------------------------------------------------------
+bool cmTarget::IsLinkInterfaceDependentNumberMaxProperty(const std::string &p,
+                                    const char *config) const
+{
+  if (this->TargetTypeValue == OBJECT_LIBRARY
+      || this->TargetTypeValue == INTERFACE_LIBRARY)
+    {
+    return false;
+    }
+  return isLinkDependentProperty(this, p, "COMPATIBLE_INTERFACE_NUMBER_MAX",
+                                 config);
+}
+
+//----------------------------------------------------------------------------
 void cmTarget::GetLanguages(std::set<cmStdString>& languages) const
 {
   for(std::vector<cmSourceFile*>::const_iterator
@@ -2426,6 +4764,72 @@ void cmTarget::GetLanguages(std::set<cmStdString>& languages) const
 }
 
 //----------------------------------------------------------------------------
+bool cmTarget::IsChrpathUsed(const char* config) const
+{
+  // Only certain target types have an rpath.
+  if(!(this->GetType() == cmTarget::SHARED_LIBRARY ||
+       this->GetType() == cmTarget::MODULE_LIBRARY ||
+       this->GetType() == cmTarget::EXECUTABLE))
+    {
+    return false;
+    }
+
+  // If the target will not be installed we do not need to change its
+  // rpath.
+  if(!this->GetHaveInstallRule())
+    {
+    return false;
+    }
+
+  // Skip chrpath if skipping rpath altogether.
+  if(this->Makefile->IsOn("CMAKE_SKIP_RPATH"))
+    {
+    return false;
+    }
+
+  // Skip chrpath if it does not need to be changed at install time.
+  if(this->GetPropertyAsBool("BUILD_WITH_INSTALL_RPATH"))
+    {
+    return false;
+    }
+
+  // Allow the user to disable builtin chrpath explicitly.
+  if(this->Makefile->IsOn("CMAKE_NO_BUILTIN_CHRPATH"))
+    {
+    return false;
+    }
+
+  if(this->Makefile->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME"))
+    {
+    return true;
+    }
+
+#if defined(CMAKE_USE_ELF_PARSER)
+  // Enable if the rpath flag uses a separator and the target uses ELF
+  // binaries.
+  if(const char* ll = this->GetLinkerLanguage(config, this))
+    {
+    std::string sepVar = "CMAKE_SHARED_LIBRARY_RUNTIME_";
+    sepVar += ll;
+    sepVar += "_FLAG_SEP";
+    const char* sep = this->Makefile->GetDefinition(sepVar.c_str());
+    if(sep && *sep)
+      {
+      // TODO: Add ELF check to ABI detection and get rid of
+      // CMAKE_EXECUTABLE_FORMAT.
+      if(const char* fmt =
+         this->Makefile->GetDefinition("CMAKE_EXECUTABLE_FORMAT"))
+        {
+        return strcmp(fmt, "ELF") == 0;
+        }
+      }
+    }
+#endif
+  static_cast<void>(config);
+  return false;
+}
+
+//----------------------------------------------------------------------------
 cmTarget::ImportInfo const*
 cmTarget::GetImportInfo(const char* config, cmTarget const* headTarget) const
 {
@@ -2792,6 +5196,502 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config,
 }
 
 //----------------------------------------------------------------------------
+cmTarget::LinkInterface const* cmTarget::GetLinkInterface(const char* config,
+                                                  cmTarget const* head) const
+{
+  // Imported targets have their own link interface.
+  if(this->IsImported())
+    {
+    if(cmTarget::ImportInfo const* info = this->GetImportInfo(config, head))
+      {
+      return &info->LinkInterface;
+      }
+    return 0;
+    }
+
+  // Link interfaces are not supported for executables that do not
+  // export symbols.
+  if(this->GetType() == cmTarget::EXECUTABLE &&
+     !this->IsExecutableWithExports())
+    {
+    return 0;
+    }
+
+  // Lookup any existing link interface for this configuration.
+  TargetConfigPair key(head, cmSystemTools::UpperCase(config? config : ""));
+
+  cmTargetInternals::LinkInterfaceMapType::iterator
+    i = this->Internal->LinkInterfaceMap.find(key);
+  if(i == this->Internal->LinkInterfaceMap.end())
+    {
+    // Compute the link interface for this configuration.
+    cmTargetInternals::OptionalLinkInterface iface;
+    iface.Exists = this->ComputeLinkInterface(config, iface, head);
+
+    // Store the information for this configuration.
+    cmTargetInternals::LinkInterfaceMapType::value_type entry(key, iface);
+    i = this->Internal->LinkInterfaceMap.insert(entry).first;
+    }
+
+  return i->second.Exists? &i->second : 0;
+}
+
+//----------------------------------------------------------------------------
+void cmTarget::GetTransitivePropertyLinkLibraries(
+                                      const char* config,
+                                      cmTarget const* headTarget,
+                                      std::vector<std::string> &libs) const
+{
+  cmTarget::LinkInterface const* iface = this->GetLinkInterface(config,
+                                                                headTarget);
+  if (!iface)
+    {
+    return;
+    }
+  if(this->GetType() != STATIC_LIBRARY
+      || this->GetPolicyStatusCMP0022() == cmPolicies::WARN
+      || this->GetPolicyStatusCMP0022() == cmPolicies::OLD)
+    {
+    libs = iface->Libraries;
+    return;
+    }
+
+  const char* linkIfaceProp = "INTERFACE_LINK_LIBRARIES";
+  const char* interfaceLibs = this->GetProperty(linkIfaceProp);
+
+  if (!interfaceLibs)
+    {
+    return;
+    }
+
+  // The interface libraries have been explicitly set.
+  cmListFileBacktrace lfbt;
+  cmGeneratorExpression ge(lfbt);
+  cmGeneratorExpressionDAGChecker dagChecker(lfbt, this->GetName(),
+                                              linkIfaceProp, 0, 0);
+  dagChecker.SetTransitivePropertiesOnly();
+  cmSystemTools::ExpandListArgument(ge.Parse(interfaceLibs)->Evaluate(
+                                      this->Makefile,
+                                      config,
+                                      false,
+                                      headTarget,
+                                      this, &dagChecker), libs);
+}
+
+//----------------------------------------------------------------------------
+bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface,
+                                    cmTarget const* headTarget) const
+{
+  // Construct the property name suffix for this configuration.
+  std::string suffix = "_";
+  if(config && *config)
+    {
+    suffix += cmSystemTools::UpperCase(config);
+    }
+  else
+    {
+    suffix += "NOCONFIG";
+    }
+
+  // An explicit list of interface libraries may be set for shared
+  // libraries and executables that export symbols.
+  const char* explicitLibraries = 0;
+  std::string linkIfaceProp;
+  if(this->PolicyStatusCMP0022 != cmPolicies::OLD &&
+     this->PolicyStatusCMP0022 != cmPolicies::WARN)
+    {
+    // CMP0022 NEW behavior is to use INTERFACE_LINK_LIBRARIES.
+    linkIfaceProp = "INTERFACE_LINK_LIBRARIES";
+    explicitLibraries = this->GetProperty(linkIfaceProp.c_str());
+    }
+  else if(this->GetType() == cmTarget::SHARED_LIBRARY ||
+          this->IsExecutableWithExports())
+    {
+    // CMP0022 OLD behavior is to use LINK_INTERFACE_LIBRARIES if set on a
+    // shared lib or executable.
+
+    // Lookup the per-configuration property.
+    linkIfaceProp = "LINK_INTERFACE_LIBRARIES";
+    linkIfaceProp += suffix;
+    explicitLibraries = this->GetProperty(linkIfaceProp.c_str());
+
+    // If not set, try the generic property.
+    if(!explicitLibraries)
+      {
+      linkIfaceProp = "LINK_INTERFACE_LIBRARIES";
+      explicitLibraries = this->GetProperty(linkIfaceProp.c_str());
+      }
+    }
+
+  if(explicitLibraries && this->PolicyStatusCMP0022 == cmPolicies::WARN &&
+     !this->Internal->PolicyWarnedCMP0022)
+    {
+    // Compare the explicitly set old link interface properties to the
+    // preferred new link interface property one and warn if different.
+    const char* newExplicitLibraries =
+      this->GetProperty("INTERFACE_LINK_LIBRARIES");
+    if (newExplicitLibraries
+        && strcmp(newExplicitLibraries, explicitLibraries) != 0)
+      {
+      cmOStringStream w;
+      w <<
+        (this->Makefile->GetPolicies()
+         ->GetPolicyWarning(cmPolicies::CMP0022)) << "\n"
+        "Target \"" << this->GetName() << "\" has an "
+        "INTERFACE_LINK_LIBRARIES property which differs from its " <<
+        linkIfaceProp << " properties."
+        "\n"
+        "INTERFACE_LINK_LIBRARIES:\n"
+        "  " << newExplicitLibraries << "\n" <<
+        linkIfaceProp << ":\n"
+        "  " << (explicitLibraries ? explicitLibraries : "(empty)") << "\n";
+      this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+      this->Internal->PolicyWarnedCMP0022 = true;
+      }
+    }
+
+  // There is no implicit link interface for executables or modules
+  // so if none was explicitly set then there is no link interface.
+  if(!explicitLibraries &&
+     (this->GetType() == cmTarget::EXECUTABLE ||
+      (this->GetType() == cmTarget::MODULE_LIBRARY)))
+    {
+    return false;
+    }
+
+  if(explicitLibraries)
+    {
+    // The interface libraries have been explicitly set.
+    cmListFileBacktrace lfbt;
+    cmGeneratorExpression ge(lfbt);
+    cmGeneratorExpressionDAGChecker dagChecker(lfbt, this->GetName(),
+                                               linkIfaceProp, 0, 0);
+    cmSystemTools::ExpandListArgument(ge.Parse(explicitLibraries)->Evaluate(
+                                        this->Makefile,
+                                        config,
+                                        false,
+                                        headTarget,
+                                        this, &dagChecker), iface.Libraries);
+
+    if(this->GetType() == cmTarget::SHARED_LIBRARY
+        || this->GetType() == cmTarget::STATIC_LIBRARY
+        || this->GetType() == cmTarget::INTERFACE_LIBRARY)
+      {
+      // Shared libraries may have runtime implementation dependencies
+      // on other shared libraries that are not in the interface.
+      std::set<cmStdString> emitted;
+      for(std::vector<std::string>::const_iterator
+            li = iface.Libraries.begin(); li != iface.Libraries.end(); ++li)
+        {
+        emitted.insert(*li);
+        }
+      if (this->GetType() != cmTarget::INTERFACE_LIBRARY)
+        {
+        LinkImplementation const* impl = this->GetLinkImplementation(config,
+                                                                  headTarget);
+        for(std::vector<std::string>::const_iterator
+              li = impl->Libraries.begin(); li != impl->Libraries.end(); ++li)
+          {
+          if(emitted.insert(*li).second)
+            {
+            if(cmTarget* tgt = this->Makefile->FindTargetToUse(li->c_str()))
+              {
+              // This is a runtime dependency on another shared library.
+              if(tgt->GetType() == cmTarget::SHARED_LIBRARY)
+                {
+                iface.SharedDeps.push_back(*li);
+                }
+              }
+            else
+              {
+              // TODO: Recognize shared library file names.  Perhaps this
+              // should be moved to cmComputeLinkInformation, but that creates
+              // a chicken-and-egg problem since this list is needed for its
+              // construction.
+              }
+            }
+          }
+        if(this->LinkLanguagePropagatesToDependents())
+          {
+          // Targets using this archive need its language runtime libraries.
+          iface.Languages = impl->Languages;
+          }
+        }
+      }
+    }
+  else if (this->PolicyStatusCMP0022 == cmPolicies::WARN
+        || this->PolicyStatusCMP0022 == cmPolicies::OLD)
+    // If CMP0022 is NEW then the plain tll signature sets the
+    // INTERFACE_LINK_LIBRARIES, so if we get here then the project
+    // cleared the property explicitly and we should not fall back
+    // to the link implementation.
+    {
+    // The link implementation is the default link interface.
+    LinkImplementation const* impl = this->GetLinkImplementation(config,
+                                                              headTarget);
+    iface.ImplementationIsInterface = true;
+    iface.Libraries = impl->Libraries;
+    iface.WrongConfigLibraries = impl->WrongConfigLibraries;
+    if(this->LinkLanguagePropagatesToDependents())
+      {
+      // Targets using this archive need its language runtime libraries.
+      iface.Languages = impl->Languages;
+      }
+
+    if(this->PolicyStatusCMP0022 == cmPolicies::WARN &&
+       !this->Internal->PolicyWarnedCMP0022)
+      {
+      // Compare the link implementation fallback link interface to the
+      // preferred new link interface property and warn if different.
+      cmListFileBacktrace lfbt;
+      cmGeneratorExpression ge(lfbt);
+      cmGeneratorExpressionDAGChecker dagChecker(lfbt, this->GetName(),
+                                      "INTERFACE_LINK_LIBRARIES", 0, 0);
+      std::vector<std::string> ifaceLibs;
+      const char* newExplicitLibraries =
+        this->GetProperty("INTERFACE_LINK_LIBRARIES");
+      cmSystemTools::ExpandListArgument(
+        ge.Parse(newExplicitLibraries)->Evaluate(this->Makefile,
+                                                 config,
+                                                 false,
+                                                 headTarget,
+                                                 this, &dagChecker),
+        ifaceLibs);
+      if (ifaceLibs != impl->Libraries)
+        {
+        std::string oldLibraries;
+        std::string newLibraries;
+        const char *sep = "";
+        for(std::vector<std::string>::const_iterator it
+              = impl->Libraries.begin(); it != impl->Libraries.end(); ++it)
+          {
+          oldLibraries += sep;
+          oldLibraries += *it;
+          sep = ";";
+          }
+        sep = "";
+        for(std::vector<std::string>::const_iterator it
+              = ifaceLibs.begin(); it != ifaceLibs.end(); ++it)
+          {
+          newLibraries += sep;
+          newLibraries += *it;
+          sep = ";";
+          }
+        if(oldLibraries.empty())
+          { oldLibraries = "(empty)"; }
+        if(newLibraries.empty())
+          { newLibraries = "(empty)"; }
+
+        cmOStringStream w;
+        w <<
+          (this->Makefile->GetPolicies()
+           ->GetPolicyWarning(cmPolicies::CMP0022)) << "\n"
+          "Target \"" << this->GetName() << "\" has an "
+          "INTERFACE_LINK_LIBRARIES property.  "
+          "This should be preferred as the source of the link interface "
+          "for this library but because CMP0022 is not set CMake is "
+          "ignoring the property and using the link implementation "
+          "as the link interface instead."
+          "\n"
+          "INTERFACE_LINK_LIBRARIES:\n"
+          "  " << newLibraries << "\n"
+          "Link implementation:\n"
+          "  " << oldLibraries << "\n";
+        this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+        this->Internal->PolicyWarnedCMP0022 = true;
+        }
+      }
+    }
+
+  if(this->GetType() == cmTarget::STATIC_LIBRARY)
+    {
+    // How many repetitions are needed if this library has cyclic
+    // dependencies?
+    std::string propName = "LINK_INTERFACE_MULTIPLICITY";
+    propName += suffix;
+    if(const char* config_reps = this->GetProperty(propName.c_str()))
+      {
+      sscanf(config_reps, "%u", &iface.Multiplicity);
+      }
+    else if(const char* reps =
+            this->GetProperty("LINK_INTERFACE_MULTIPLICITY"))
+      {
+      sscanf(reps, "%u", &iface.Multiplicity);
+      }
+    }
+
+  return true;
+}
+
+//----------------------------------------------------------------------------
+cmTarget::LinkImplementation const*
+cmTarget::GetLinkImplementation(const char* config, cmTarget const* head) const
+{
+  // There is no link implementation for imported targets.
+  if(this->IsImported())
+    {
+    return 0;
+    }
+
+  // Lookup any existing link implementation for this configuration.
+  TargetConfigPair key(head, cmSystemTools::UpperCase(config? config : ""));
+
+  cmTargetInternals::LinkImplMapType::iterator
+    i = this->Internal->LinkImplMap.find(key);
+  if(i == this->Internal->LinkImplMap.end())
+    {
+    // Compute the link implementation for this configuration.
+    LinkImplementation impl;
+    this->ComputeLinkImplementation(config, impl, head);
+
+    // Store the information for this configuration.
+    cmTargetInternals::LinkImplMapType::value_type entry(key, impl);
+    i = this->Internal->LinkImplMap.insert(entry).first;
+    }
+
+  return &i->second;
+}
+
+//----------------------------------------------------------------------------
+void cmTarget::ComputeLinkImplementation(const char* config,
+                                         LinkImplementation& impl,
+                                         cmTarget const* head) const
+{
+  // Collect libraries directly linked in this configuration.
+  std::vector<std::string> llibs;
+  this->GetDirectLinkLibraries(config, llibs, head);
+  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 item = this->CheckCMP0004(*li);
+    if(item == this->GetName() || item.empty())
+      {
+      if(item == this->GetName())
+        {
+        bool noMessage = false;
+        cmake::MessageType messageType = cmake::FATAL_ERROR;
+        cmOStringStream e;
+        switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0038))
+          {
+          case cmPolicies::WARN:
+            {
+            e << (this->Makefile->GetPolicies()
+                  ->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;
+      }
+    cmTarget *tgt = this->Makefile->FindTargetToUse(li->c_str());
+
+    if(!tgt && std::string(item).find("::") != std::string::npos)
+      {
+      bool noMessage = false;
+      cmake::MessageType messageType = cmake::FATAL_ERROR;
+      cmOStringStream e;
+      switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0028))
+        {
+        case cmPolicies::WARN:
+          {
+          e << (this->Makefile->GetPolicies()
+                ->GetPolicyWarning(cmPolicies::CMP0028)) << "\n";
+          messageType = cmake::AUTHOR_WARNING;
+          }
+          break;
+        case cmPolicies::OLD:
+          noMessage = true;
+        case cmPolicies::REQUIRED_IF_USED:
+        case cmPolicies::REQUIRED_ALWAYS:
+        case cmPolicies::NEW:
+          // Issue the fatal message.
+          break;
+        }
+
+      if(!noMessage)
+        {
+        e << "Target \"" << this->GetName() << "\" links to target \"" << item
+          << "\" but the target was not found.  Perhaps a find_package() "
+          "call is missing for an IMPORTED target, or an ALIAS target is "
+          "missing?";
+        this->Makefile->GetCMakeInstance()->IssueMessage(messageType,
+                                                      e.str(),
+                                                      this->GetBacktrace());
+        if (messageType == cmake::FATAL_ERROR)
+          {
+          return;
+          }
+        }
+      }
+
+    // The entry is meant for this configuration.
+    impl.Libraries.push_back(item);
+    }
+
+  cmTarget::LinkLibraryType linkType = this->ComputeLinkType(config);
+  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 item = this->CheckCMP0004(li->first);
+      if(item == this->GetName() || item.empty())
+        {
+        continue;
+        }
+      // Support OLD behavior for CMP0003.
+      impl.WrongConfigLibraries.push_back(item);
+      }
+    }
+
+  // This target needs runtime libraries for its source languages.
+  std::set<cmStdString> languages;
+  // Get languages used in our source files.
+  this->GetLanguages(languages);
+  // Get languages used in object library sources.
+  for(std::vector<std::string>::const_iterator
+      i = this->ObjectLibraries.begin();
+      i != this->ObjectLibraries.end(); ++i)
+    {
+    if(cmTarget* objLib = this->Makefile->FindTargetToUse(i->c_str()))
+      {
+      if(objLib->GetType() == cmTarget::OBJECT_LIBRARY)
+        {
+        objLib->GetLanguages(languages);
+        }
+      }
+    }
+  // Copy the set of langauges to the link implementation.
+  for(std::set<cmStdString>::iterator li = languages.begin();
+      li != languages.end(); ++li)
+    {
+    impl.Languages.push_back(*li);
+    }
+}
+
+//----------------------------------------------------------------------------
 std::string cmTarget::CheckCMP0004(std::string const& item) const
 {
   // Strip whitespace off the library names because we used to do this
@@ -2850,6 +5750,382 @@ std::string cmTarget::CheckCMP0004(std::string const& item) const
   return lib;
 }
 
+template<typename PropertyType>
+PropertyType getLinkInterfaceDependentProperty(cmTarget const* tgt,
+                                               const std::string prop,
+                                               const char *config,
+                                               CompatibleType,
+                                               PropertyType *);
+
+template<>
+bool getLinkInterfaceDependentProperty(cmTarget const* tgt,
+                                       const std::string prop,
+                                       const char *config,
+                                       CompatibleType, bool *)
+{
+  return tgt->GetLinkInterfaceDependentBoolProperty(prop, config);
+}
+
+template<>
+const char * getLinkInterfaceDependentProperty(cmTarget const* tgt,
+                                               const std::string prop,
+                                               const char *config,
+                                               CompatibleType t,
+                                               const char **)
+{
+  switch(t)
+  {
+  case BoolType:
+    assert(!"String compatibility check function called for boolean");
+    return 0;
+  case StringType:
+    return tgt->GetLinkInterfaceDependentStringProperty(prop, config);
+  case NumberMinType:
+    return tgt->GetLinkInterfaceDependentNumberMinProperty(prop, config);
+  case NumberMaxType:
+    return tgt->GetLinkInterfaceDependentNumberMaxProperty(prop, config);
+  }
+  assert(!"Unreachable!");
+  return 0;
+}
+
+//----------------------------------------------------------------------------
+template<typename PropertyType>
+void checkPropertyConsistency(cmTarget const* depender,
+                              cmTarget const* dependee,
+                              const char *propName,
+                              std::set<cmStdString> &emitted,
+                              const char *config,
+                              CompatibleType t,
+                              PropertyType *)
+{
+  const char *prop = dependee->GetProperty(propName);
+  if (!prop)
+    {
+    return;
+    }
+
+  std::vector<std::string> props;
+  cmSystemTools::ExpandListArgument(prop, props);
+  std::string pdir =
+    dependee->GetMakefile()->GetRequiredDefinition("CMAKE_ROOT");
+  pdir += "/Help/prop_tgt/";
+
+  for(std::vector<std::string>::iterator pi = props.begin();
+      pi != props.end(); ++pi)
+    {
+    std::string pname = cmSystemTools::HelpFileName(*pi);
+    std::string pfile = pdir + pname + ".rst";
+    if(cmSystemTools::FileExists(pfile.c_str(), true))
+      {
+      cmOStringStream e;
+      e << "Target \"" << dependee->GetName() << "\" has property \""
+        << *pi << "\" listed in its " << propName << " property.  "
+          "This is not allowed.  Only user-defined properties may appear "
+          "listed in the " << propName << " property.";
+      depender->GetMakefile()->IssueMessage(cmake::FATAL_ERROR, e.str());
+      return;
+      }
+    if(emitted.insert(*pi).second)
+      {
+      getLinkInterfaceDependentProperty<PropertyType>(depender, *pi, config,
+                                                      t, 0);
+      if (cmSystemTools::GetErrorOccuredFlag())
+        {
+        return;
+        }
+      }
+    }
+}
+
+static cmStdString intersect(const std::set<cmStdString> &s1,
+                             const std::set<cmStdString> &s2)
+{
+  std::set<cmStdString> intersect;
+  std::set_intersection(s1.begin(),s1.end(),
+                        s2.begin(),s2.end(),
+                      std::inserter(intersect,intersect.begin()));
+  if (!intersect.empty())
+    {
+    return *intersect.begin();
+    }
+  return "";
+}
+static cmStdString intersect(const std::set<cmStdString> &s1,
+                       const std::set<cmStdString> &s2,
+                       const std::set<cmStdString> &s3)
+{
+  cmStdString result;
+  result = intersect(s1, s2);
+  if (!result.empty())
+    return result;
+  result = intersect(s1, s3);
+  if (!result.empty())
+    return result;
+  return intersect(s2, s3);
+}
+static cmStdString intersect(const std::set<cmStdString> &s1,
+                       const std::set<cmStdString> &s2,
+                       const std::set<cmStdString> &s3,
+                       const std::set<cmStdString> &s4)
+{
+  cmStdString result;
+  result = intersect(s1, s2);
+  if (!result.empty())
+    return result;
+  result = intersect(s1, s3);
+  if (!result.empty())
+    return result;
+  result = intersect(s1, s4);
+  if (!result.empty())
+    return result;
+  return intersect(s2, s3, s4);
+}
+
+//----------------------------------------------------------------------------
+void cmTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info,
+                                          const char* config) const
+{
+  const cmComputeLinkInformation::ItemVector &deps = info->GetItems();
+
+  std::set<cmStdString> emittedBools;
+  std::set<cmStdString> emittedStrings;
+  std::set<cmStdString> emittedMinNumbers;
+  std::set<cmStdString> emittedMaxNumbers;
+
+  for(cmComputeLinkInformation::ItemVector::const_iterator li =
+      deps.begin();
+      li != deps.end(); ++li)
+    {
+    if (!li->Target)
+      {
+      continue;
+      }
+
+    checkPropertyConsistency<bool>(this, li->Target,
+                                   "COMPATIBLE_INTERFACE_BOOL",
+                                   emittedBools, config, BoolType, 0);
+    if (cmSystemTools::GetErrorOccuredFlag())
+      {
+      return;
+      }
+    checkPropertyConsistency<const char *>(this, li->Target,
+                                           "COMPATIBLE_INTERFACE_STRING",
+                                           emittedStrings, config,
+                                           StringType, 0);
+    if (cmSystemTools::GetErrorOccuredFlag())
+      {
+      return;
+      }
+    checkPropertyConsistency<const char *>(this, li->Target,
+                                           "COMPATIBLE_INTERFACE_NUMBER_MIN",
+                                           emittedMinNumbers, config,
+                                           NumberMinType, 0);
+    if (cmSystemTools::GetErrorOccuredFlag())
+      {
+      return;
+      }
+    checkPropertyConsistency<const char *>(this, li->Target,
+                                           "COMPATIBLE_INTERFACE_NUMBER_MAX",
+                                           emittedMaxNumbers, config,
+                                           NumberMaxType, 0);
+    if (cmSystemTools::GetErrorOccuredFlag())
+      {
+      return;
+      }
+    }
+
+  std::string prop = intersect(emittedBools,
+                               emittedStrings,
+                               emittedMinNumbers,
+                               emittedMaxNumbers);
+
+  if (!prop.empty())
+    {
+    std::set<std::string> props;
+    std::set<cmStdString>::const_iterator i = emittedBools.find(prop);
+    if (i != emittedBools.end())
+      {
+      props.insert("COMPATIBLE_INTERFACE_BOOL");
+      }
+    i = emittedStrings.find(prop);
+    if (i != emittedStrings.end())
+      {
+      props.insert("COMPATIBLE_INTERFACE_STRING");
+      }
+    i = emittedMinNumbers.find(prop);
+    if (i != emittedMinNumbers.end())
+      {
+      props.insert("COMPATIBLE_INTERFACE_NUMBER_MIN");
+      }
+    i = emittedMaxNumbers.find(prop);
+    if (i != emittedMaxNumbers.end())
+      {
+      props.insert("COMPATIBLE_INTERFACE_NUMBER_MAX");
+      }
+
+    std::string propsString = *props.begin();
+    props.erase(props.begin());
+    while (props.size() > 1)
+      {
+      propsString += ", " + *props.begin();
+      props.erase(props.begin());
+      }
+   if (props.size() == 1)
+     {
+     propsString += " and the " + *props.begin();
+     }
+    cmOStringStream e;
+    e << "Property \"" << prop << "\" appears in both the "
+      << propsString <<
+    " property in the dependencies of target \"" << this->GetName() <<
+    "\".  This is not allowed. A property may only require compatibility "
+    "in a boolean interpretation, a numeric minimum, a numeric maximum or a "
+    "string interpretation, but not a mixture.";
+    this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+    }
+}
+
+//----------------------------------------------------------------------------
+cmComputeLinkInformation*
+cmTarget::GetLinkInformation(const char* config, cmTarget const* head) const
+{
+  cmTarget const* headTarget = head ? head : this;
+  // Lookup any existing information for this configuration.
+  TargetConfigPair key(headTarget,
+                                  cmSystemTools::UpperCase(config?config:""));
+  cmTargetLinkInformationMap::iterator
+    i = this->LinkInformation.find(key);
+  if(i == this->LinkInformation.end())
+    {
+    // Compute information for this configuration.
+    cmComputeLinkInformation* info =
+      new cmComputeLinkInformation(this, config, headTarget);
+    if(!info || !info->Compute())
+      {
+      delete info;
+      info = 0;
+      }
+
+    // Store the information for this configuration.
+    cmTargetLinkInformationMap::value_type entry(key, info);
+    i = this->LinkInformation.insert(entry).first;
+
+    if (info)
+      {
+      this->CheckPropertyCompatibility(info, config);
+      }
+    }
+  return i->second;
+}
+
+//----------------------------------------------------------------------------
+std::string cmTarget::GetFrameworkDirectory(const char* config,
+                                            bool rootDir) const
+{
+  std::string fpath;
+  fpath += this->GetOutputName(config, false);
+  fpath += ".framework";
+  if(!rootDir)
+    {
+    fpath += "/Versions/";
+    fpath += this->GetFrameworkVersion();
+    }
+  return fpath;
+}
+
+//----------------------------------------------------------------------------
+std::string cmTarget::GetCFBundleDirectory(const char* config,
+                                           bool contentOnly) const
+{
+  std::string fpath;
+  fpath += this->GetOutputName(config, false);
+  fpath += ".";
+  const char *ext = this->GetProperty("BUNDLE_EXTENSION");
+  if (!ext)
+    {
+    ext = "bundle";
+    }
+  fpath += ext;
+  fpath += "/Contents";
+  if(!contentOnly)
+    fpath += "/MacOS";
+  return fpath;
+}
+
+//----------------------------------------------------------------------------
+std::string cmTarget::GetAppBundleDirectory(const char* config,
+                                            bool contentOnly) const
+{
+  std::string fpath = this->GetFullName(config, false);
+  fpath += ".app/Contents";
+  if(!contentOnly)
+    fpath += "/MacOS";
+  return fpath;
+}
+
+//----------------------------------------------------------------------------
+std::string cmTarget::BuildMacContentDirectory(const std::string& base,
+                                               const char* config,
+                                               bool contentOnly) const
+{
+  std::string fpath = base;
+  if(this->IsAppBundleOnApple())
+    {
+    fpath += this->GetAppBundleDirectory(config, contentOnly);
+    }
+  if(this->IsFrameworkOnApple())
+    {
+    fpath += this->GetFrameworkDirectory(config, contentOnly);
+    }
+  if(this->IsCFBundleOnApple())
+    {
+    fpath += this->GetCFBundleDirectory(config, contentOnly);
+    }
+  return fpath;
+}
+
+//----------------------------------------------------------------------------
+std::string cmTarget::GetMacContentDirectory(const char* config,
+                                             bool implib) const
+{
+  // Start with the output directory for the target.
+  std::string fpath = this->GetDirectory(config, implib);
+  fpath += "/";
+  bool contentOnly = true;
+  if(this->IsFrameworkOnApple())
+    {
+    // additional files with a framework go into the version specific
+    // directory
+    contentOnly = false;
+    }
+  fpath = this->BuildMacContentDirectory(fpath, config, contentOnly);
+  return fpath;
+}
+
+//----------------------------------------------------------------------------
+cmTargetLinkInformationMap
+::cmTargetLinkInformationMap(cmTargetLinkInformationMap const& r): derived()
+{
+  // Ideally cmTarget instances should never be copied.  However until
+  // we can make a sweep to remove that, this copy constructor avoids
+  // allowing the resources (LinkInformation) from getting copied.  In
+  // the worst case this will lead to extra cmComputeLinkInformation
+  // instances.  We also enforce in debug mode that the map be emptied
+  // when copied.
+  static_cast<void>(r);
+  assert(r.empty());
+}
+
+//----------------------------------------------------------------------------
+cmTargetLinkInformationMap::~cmTargetLinkInformationMap()
+{
+  for(derived::iterator i = this->begin(); i != this->end(); ++i)
+    {
+    delete i->second;
+    }
+}
+
 //----------------------------------------------------------------------------
 cmTargetInternalPointer::cmTargetInternalPointer()
 {
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 2d95949..26d391f 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -16,7 +16,6 @@
 #include "cmPropertyMap.h"
 #include "cmPolicies.h"
 #include "cmListFileCache.h"
-#include "cmGeneratorTarget.h"
 
 #include <cmsys/auto_ptr.hxx>
 
@@ -34,11 +33,23 @@ class cmake;
 class cmMakefile;
 class cmSourceFile;
 class cmGlobalGenerator;
+class cmComputeLinkInformation;
 class cmListFileBacktrace;
 class cmTarget;
 class cmGeneratorTarget;
 class cmTargetTraceDependencies;
 
+struct cmTargetLinkInformationMap:
+  public std::map<std::pair<cmTarget const* , std::string>,
+                  cmComputeLinkInformation*>
+{
+  typedef std::map<std::pair<cmTarget const* , std::string>,
+                   cmComputeLinkInformation*> derived;
+  cmTargetLinkInformationMap() {}
+  cmTargetLinkInformationMap(cmTargetLinkInformationMap const& r);
+  ~cmTargetLinkInformationMap();
+};
+
 class cmTargetInternals;
 class cmTargetInternalPointer
 {
@@ -168,13 +179,29 @@ public:
   typedef std::pair<cmStdString, LinkLibraryType> LibraryID;
 
   typedef std::vector<LibraryID > LinkLibraryVectorType;
+  const LinkLibraryVectorType &GetLinkLibraries() const {
+  return this->LinkLibraries;}
+  const LinkLibraryVectorType &GetOriginalLinkLibraries() const
+    {return this->OriginalLinkLibraries;}
+  void GetDirectLinkLibraries(const char *config,
+                              std::vector<std::string> &,
+                              cmTarget const* head) const;
+  void GetInterfaceLinkLibraries(const char *config,
+                              std::vector<std::string> &,
+                              cmTarget const* head) const;
 
   /** Compute the link type to use for the given configuration.  */
   LinkLibraryType ComputeLinkType(const char* config) const;
 
+  /**
+   * Clear the dependency information recorded for this target, if any.
+   */
+  void ClearDependencyInformation(cmMakefile& mf, const char* target);
+
   // Check to see if a library is a framework and treat it different on Mac
   bool NameResolvesToFramework(const std::string& libname) const;
-  void AddLinkLibrary(const char *target, const char* lib,
+  void AddLinkLibrary(cmMakefile& mf,
+                      const char *target, const char* lib,
                       LinkLibraryType llt);
   enum TLLSignature {
     KeywordTLLSignature,
@@ -183,7 +210,7 @@ public:
   bool PushTLLCommandTrace(TLLSignature signature);
   void GetTllSignatureTraces(cmOStringStream &s, TLLSignature sig) const;
 
-  void MergeLinkLibraries( const char* selfname,
+  void MergeLinkLibraries( cmMakefile& mf, const char* selfname,
                            const LinkLibraryVectorType& libs );
 
   const std::vector<std::string>& GetLinkDirectories() const;
@@ -234,6 +261,70 @@ public:
 
   bool IsImported() const {return this->IsImportedTarget;}
 
+  /** The link interface specifies transitive library dependencies and
+      other information needed by targets that link to this target.  */
+  struct LinkInterface
+  {
+    // Languages whose runtime libraries must be linked.
+    std::vector<std::string> Languages;
+
+    // Libraries listed in the interface.
+    std::vector<std::string> Libraries;
+
+    // Shared library dependencies needed for linking on some platforms.
+    std::vector<std::string> SharedDeps;
+
+    // Number of repetitions of a strongly connected component of two
+    // or more static libraries.
+    int Multiplicity;
+
+    // Libraries listed for other configurations.
+    // Needed only for OLD behavior of CMP0003.
+    std::vector<std::string> WrongConfigLibraries;
+
+    bool ImplementationIsInterface;
+
+    LinkInterface(): Multiplicity(0), ImplementationIsInterface(false) {}
+  };
+
+  /** Get the link interface for the given configuration.  Returns 0
+      if the target cannot be linked.  */
+  LinkInterface const* GetLinkInterface(const char* config,
+                                        cmTarget const* headTarget) const;
+  void GetTransitivePropertyLinkLibraries(const char* config,
+                                        cmTarget const* headTarget,
+                                        std::vector<std::string> &libs) const;
+
+  /** The link implementation specifies the direct library
+      dependencies needed by the object files of the target.  */
+  struct LinkImplementation
+  {
+    // Languages whose runtime libraries must be linked.
+    std::vector<std::string> Languages;
+
+    // Libraries linked directly in this configuration.
+    std::vector<std::string> Libraries;
+
+    // Libraries linked directly in other configurations.
+    // Needed only for OLD behavior of CMP0003.
+    std::vector<std::string> WrongConfigLibraries;
+  };
+  LinkImplementation const* GetLinkImplementation(const char* config,
+                                                  cmTarget const* head) const;
+
+  /** Link information from the transitive closure of the link
+      implementation and the interfaces of its dependencies.  */
+  struct LinkClosure
+  {
+    // The preferred linker language.
+    std::string LinkerLanguage;
+
+    // Languages whose runtime libraries must be linked.
+    std::vector<std::string> Languages;
+  };
+  LinkClosure const* GetLinkClosure(const char* config,
+                                    cmTarget const* head) const;
+
   /** Strip off leading and trailing whitespace from an item named in
       the link dependencies of this target.  */
   std::string CheckCMP0004(std::string const& item) const;
@@ -250,7 +341,10 @@ public:
       pdb output directory is given.  */
   std::string GetPDBDirectory(const char* config = 0) const;
 
-  const char* ImportedGetLocation(const char* config) const;
+  /** Get the location of the target in the build tree for the given
+      configuration.  This location is suitable for use as the LOCATION
+      target property.  */
+  const char* GetLocation(const char* config) const;
 
   /** Get the target major and minor version numbers interpreted from
       the VERSION property.  Version 0 is returned if the property is
@@ -268,10 +362,55 @@ public:
    */
   bool FindSourceFiles();
 
+  ///! Return the preferred linker language for this target
+  const char* GetLinkerLanguage(const char* config = 0,
+                                cmTarget const* head = 0) const;
+
+  /** Get the full name of the target according to the settings in its
+      makefile.  */
+  std::string GetFullName(const char* config=0, bool implib = false) const;
+  void GetFullNameComponents(std::string& prefix,
+                             std::string& base, std::string& suffix,
+                             const char* config=0, bool implib = false) const;
+
+  /** Get the name of the pdb file for the target.  */
+  std::string GetPDBName(const char* config=0) const;
+
+  /** Whether this library has soname enabled and platform supports it.  */
+  bool HasSOName(const char* config) const;
+
+  /** Get the soname of the target.  Allowed only for a shared library.  */
+  std::string GetSOName(const char* config) const;
+
+  /** Whether this library has \@rpath and platform supports it.  */
+  bool HasMacOSXRpathInstallNameDir(const char* 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 char* config) const;
 
+  /** Get the full path to the target according to the settings in its
+      makefile and the configuration type.  */
+  std::string GetFullPath(const char* config=0, bool implib = false,
+                          bool realname = false) const;
+
+  /** Get the names of the library needed to generate a build rule
+      that takes into account shared library version numbers.  This
+      should be called only on a library target.  */
+  void GetLibraryNames(std::string& name, std::string& soName,
+                       std::string& realName, std::string& impName,
+                       std::string& pdbName, const char* config) const;
+
+  /** Get the names of the executable needed to generate a build rule
+      that takes into account executable version numbers.  This should
+      be called only on an executable target.  */
+  void GetExecutableNames(std::string& name, std::string& realName,
+                          std::string& impName,
+                          std::string& pdbName, const char* config) const;
+
   /** Does this target have a GNU implib to convert to MS format?  */
   bool HasImplibGNUtoMS() const;
 
@@ -280,6 +419,29 @@ public:
   bool GetImplibGNUtoMS(std::string const& gnuName, std::string& out,
                         const char* newExt = 0) const;
 
+  /**
+   * Compute whether this target must be relinked before installing.
+   */
+  bool NeedRelinkBeforeInstall(const char* config) const;
+
+  bool HaveBuildTreeRPATH(const char *config) const;
+  bool HaveInstallTreeRPATH() const;
+
+  /** Return true if builtin chrpath will work for this target */
+  bool IsChrpathUsed(const char* config) const;
+
+  /** Return the install name directory for the target in the
+    * build tree.  For example: "\@rpath/", "\@loader_path/",
+    * or "/full/path/to/library".  */
+  std::string GetInstallNameDirForBuildTree(const char* config) const;
+
+  /** Return the install name directory for the target in the
+    * install tree.  For example: "\@rpath/" or "\@loader_path/". */
+  std::string GetInstallNameDirForInstallTree() const;
+
+  cmComputeLinkInformation* GetLinkInformation(const char* config,
+                                               cmTarget const* head = 0) const;
+
   // Get the properties
   cmPropertyMap &GetProperties() const { return this->Properties; };
 
@@ -346,9 +508,23 @@ public:
       directory.  */
   bool UsesDefaultOutputDir(const char* config, bool implib) const;
 
+  /** @return the mac content directory for this target. */
+  std::string GetMacContentDirectory(const char* config,
+                                     bool implib) const;
+
   /** @return whether this target have a well defined output file name. */
   bool HaveWellDefinedOutputFiles() const;
 
+  /** @return the Mac framework directory without the base. */
+  std::string GetFrameworkDirectory(const char* config, bool rootDir) const;
+
+  /** @return the Mac CFBundle directory without the base */
+  std::string GetCFBundleDirectory(const char* config, bool contentOnly) const;
+
+  /** @return the Mac App directory without the base */
+  std::string GetAppBundleDirectory(const char* config,
+                                    bool contentOnly) const;
+
   std::vector<std::string> GetIncludeDirectories(const char *config) const;
   void InsertInclude(const cmValueWithOrigin &entry,
                      bool before = false);
@@ -361,8 +537,28 @@ public:
 
   void GetCompileOptions(std::vector<std::string> &result,
                          const char *config) const;
+  void GetAutoUicOptions(std::vector<std::string> &result,
+                         const char *config) const;
 
   bool IsNullImpliedByLinkLibraries(const std::string &p) const;
+  bool IsLinkInterfaceDependentBoolProperty(const std::string &p,
+                                            const char *config) const;
+  bool IsLinkInterfaceDependentStringProperty(const std::string &p,
+                                              const char *config) const;
+  bool IsLinkInterfaceDependentNumberMinProperty(const std::string &p,
+                                                 const char *config) const;
+  bool IsLinkInterfaceDependentNumberMaxProperty(const std::string &p,
+                                                 const char *config) const;
+
+  bool GetLinkInterfaceDependentBoolProperty(const std::string &p,
+                                             const char *config) const;
+
+  const char *GetLinkInterfaceDependentStringProperty(const std::string &p,
+                                                    const char *config) const;
+  const char *GetLinkInterfaceDependentNumberMinProperty(const std::string &p,
+                                                    const char *config) const;
+  const char *GetLinkInterfaceDependentNumberMaxProperty(const std::string &p,
+                                                    const char *config) const;
 
   std::string GetDebugGeneratorExpressions(const std::string &value,
                                   cmTarget::LinkLibraryType llt) const;
@@ -375,10 +571,10 @@ public:
   bool LinkLanguagePropagatesToDependents() const
   { return this->TargetTypeValue == STATIC_LIBRARY; }
 
-  const std::vector<cmValueWithOrigin>& GetLinkImplementationPropertyEntries();
-  const std::vector<cmGeneratorTarget::TargetPropertyEntry*>&
-                                           GetIncludeDirectoriesEntries();
-
+  void ReportPropertyOrigin(const std::string &p,
+                            const std::string &result,
+                            const std::string &report,
+                            const std::string &compatibilityType) const;
 
 private:
   bool HandleLocationPropertyPolicy() const;
@@ -430,8 +626,22 @@ private:
              std::set<LibraryID>& visited,
              DependencyList& link_line);
 
+  /**
+   * Finds the dependencies for \a lib and inserts them into \a
+   * dep_map.
+   */
+  void GatherDependencies( const cmMakefile& mf,
+                           const LibraryID& lib,
+                           DependencyMap& dep_map);
+
+  void AnalyzeLibDependencies( const cmMakefile& mf );
+
   const char* GetSuffixVariableInternal(bool implib) const;
   const char* GetPrefixVariableInternal(bool implib) const;
+  std::string GetFullNameInternal(const char* config, bool implib) const;
+  void GetFullNameInternal(const char* config, bool implib,
+                           std::string& outPrefix, std::string& outBase,
+                           std::string& outSuffix) const;
 
   // Use a makefile variable to set a default for the given property.
   // If the variable is not defined use the given default instead.
@@ -440,10 +650,28 @@ private:
   // Returns ARCHIVE, LIBRARY, or RUNTIME based on platform and type.
   const char* GetOutputTargetType(bool implib) const;
 
+  // Get the target base name.
+  std::string GetOutputName(const char* config, bool implib) const;
+
+  const char* ImportedGetLocation(const char* config) const;
+  const char* NormalGetLocation(const char* config) const;
+
   std::string GetFullNameImported(const char* config, bool implib) const;
 
   std::string ImportedGetFullPath(const char* config, bool implib) const;
+  std::string NormalGetFullPath(const char* config, bool implib,
+                                bool realname) const;
+
+  /** Get the real name of the target.  Allowed only for non-imported
+      targets.  When a library or executable file is versioned this is
+      the full versioned name.  If the target is not versioned this is
+      the same as GetFullName.  */
+  std::string NormalGetRealName(const char* config) const;
 
+  /** Append to @a base the mac content directory and return it. */
+  std::string BuildMacContentDirectory(const std::string& base,
+                                       const char* config,
+                                       bool contentOnly) const;
 
 private:
   std::string Name;
@@ -453,7 +681,9 @@ private:
   TargetType TargetTypeValue;
   std::vector<cmSourceFile*> SourceFiles;
   std::vector<std::string> ObjectLibraries;
+  LinkLibraryVectorType LinkLibraries;
   LinkLibraryVectorType PrevLinkedLibraries;
+  bool LinkLibrariesAnalyzed;
   std::vector<std::string> LinkDirectories;
   std::set<cmStdString> LinkDirectoriesEmmitted;
   bool HaveInstallRule;
@@ -463,9 +693,12 @@ private:
   std::set<cmStdString> Utilities;
   bool RecordDependencies;
   mutable cmPropertyMap Properties;
+  LinkLibraryVectorType OriginalLinkLibraries;
   bool DLLPlatform;
   bool IsApple;
   bool IsImportedTarget;
+  mutable bool DebugIncludesDone;
+  mutable std::map<std::string, bool> DebugCompatiblePropertiesDone;
   mutable bool DebugCompileOptionsDone;
   mutable bool DebugCompileDefinitionsDone;
   mutable std::set<std::string> LinkImplicitNullProperties;
@@ -479,18 +712,25 @@ private:
   bool ComputePDBOutputDir(const char* config, std::string& out) const;
 
   // Cache import information from properties for each configuration.
-  struct ImportInfo{
-    bool NoSOName;
-    std::string Location;
-    std::string SOName;
-    std::string ImportLibrary;
-    cmGeneratorTarget::LinkInterface LinkInterface;
-  };
+  struct ImportInfo;
   ImportInfo const* GetImportInfo(const char* config,
                                         cmTarget const* workingTarget) const;
   void ComputeImportInfo(std::string const& desired_config, ImportInfo& info,
                                         cmTarget const* head) const;
 
+  mutable cmTargetLinkInformationMap LinkInformation;
+  void CheckPropertyCompatibility(cmComputeLinkInformation *info,
+                                  const char* config) const;
+
+  bool ComputeLinkInterface(const char* config, LinkInterface& iface,
+                                        cmTarget const* head) const;
+
+  void ComputeLinkImplementation(const char* config,
+                                 LinkImplementation& impl,
+                                 cmTarget const* head) const;
+  void ComputeLinkClosure(const char* config, LinkClosure& lc,
+                          cmTarget const* head) const;
+
   void ClearLinkMaps();
 
   void MaybeInvalidatePropertyCache(const char* prop);
@@ -516,6 +756,12 @@ private:
   cmTargetInternalPointer Internal;
 
   void ConstructSourceFileFlags() const;
+  void ComputeVersionedName(std::string& vName,
+                            std::string const& prefix,
+                            std::string const& base,
+                            std::string const& suffix,
+                            std::string const& name,
+                            const char* version) const;
 };
 
 typedef std::map<cmStdString,cmTarget> cmTargets;
diff --git a/Source/cmTargetDepend.h b/Source/cmTargetDepend.h
index ccfd95a..1feb072 100644
--- a/Source/cmTargetDepend.h
+++ b/Source/cmTargetDepend.h
@@ -14,7 +14,7 @@
 
 #include "cmStandardIncludes.h"
 
-#include "cmGeneratorTarget.h"
+class cmTarget;
 
 /** One edge in the global target dependency graph.
     It may be marked as a 'link' or 'util' edge or both.  */
@@ -27,8 +27,6 @@ class cmTargetDepend
   mutable bool Link;
   mutable bool Util;
 public:
-  cmTargetDepend(cmGeneratorTarget const* t)
-    : Target(t->Target), Link(false), Util(false) {}
   cmTargetDepend(cmTarget const* t): Target(t), Link(false), Util(false) {}
   operator cmTarget const*() const { return this->Target; }
   cmTarget const* operator->() const { return this->Target; }
diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx
index 2d110d1..d962fb2 100644
--- a/Source/cmTestGenerator.cxx
+++ b/Source/cmTestGenerator.cxx
@@ -82,7 +82,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
   // be translated.
   std::string exe = command[0];
   cmMakefile* mf = this->Test->GetMakefile();
-  cmGeneratorTarget* target = mf->FindGeneratorTargetToUse(exe.c_str());
+  cmTarget* target = mf->FindTargetToUse(exe.c_str());
   if(target && target->GetType() == cmTarget::EXECUTABLE)
     {
     // Use the target file on disk.
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 62fea2d..eee7c14 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1112,7 +1112,7 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
     this->GlobalGenerator->GetLanguageFromExtension
     (sf.GetExtension().c_str());
   const char* sourceLang = this->LocalGenerator->GetSourceFileLanguage(sf);
-  const char* linkLanguage = this->GeneratorTarget->GetLinkerLanguage();
+  const char* linkLanguage = this->Target->GetLinkerLanguage();
   bool needForceLang = false;
   // source file does not match its extension language
   if(lang && sourceLang && strcmp(lang, sourceLang) != 0)
@@ -1233,7 +1233,7 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions()
       else
         {
         outDir = this->Target->GetDirectory(config->c_str()) + "/";
-        targetNameFull = this->GeneratorTarget->GetFullName(config->c_str());
+        targetNameFull = this->Target->GetFullName(config->c_str());
         }
       this->ConvertToWindowsSlash(intermediateDir);
       this->ConvertToWindowsSlash(outDir);
@@ -1342,7 +1342,7 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
   if(this->Target->GetType() < cmTarget::UTILITY)
     {
     const char* linkLanguage =
-      this->GeneratorTarget->GetLinkerLanguage(configName.c_str());
+      this->Target->GetLinkerLanguage(configName.c_str());
     if(!linkLanguage)
       {
       cmSystemTools::Error
@@ -1515,7 +1515,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
   Options& linkOptions = *pOptions;
 
   const char* linkLanguage =
-    this->GeneratorTarget->GetLinkerLanguage(config.c_str());
+    this->Target->GetLinkerLanguage(config.c_str());
   if(!linkLanguage)
     {
     cmSystemTools::Error
@@ -1597,7 +1597,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
   // Replace spaces in libs with ;
   cmSystemTools::ReplaceString(libs, " ", ";");
   cmComputeLinkInformation* pcli =
-    this->GeneratorTarget->GetLinkInformation(config.c_str());
+    this->Target->GetLinkInformation(config.c_str());
   if(!pcli)
     {
     cmSystemTools::Error
@@ -1645,14 +1645,13 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
   std::string targetNamePDB;
   if(this->Target->GetType() == cmTarget::EXECUTABLE)
     {
-    this->GeneratorTarget->GetExecutableNames(targetName, targetNameFull,
+    this->Target->GetExecutableNames(targetName, targetNameFull,
                                      targetNameImport, targetNamePDB,
                                      config.c_str());
     }
   else
     {
-    this->GeneratorTarget->GetLibraryNames(targetName, targetNameSO,
-                                  targetNameFull,
+    this->Target->GetLibraryNames(targetName, targetNameSO, targetNameFull,
                                   targetNameImport, targetNamePDB,
                                   config.c_str());
     }
diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt
index 2824ebc..fcde44d 100644
--- a/Tests/Complex/CMakeLists.txt
+++ b/Tests/Complex/CMakeLists.txt
@@ -398,3 +398,6 @@ endif()
 #
 add_subdirectory(Library)
 add_subdirectory(Executable)
+subdir_depends(Executable Library)
+export_library_dependencies(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake)
+include(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake OPTIONAL)
diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt
index 0f9a71d..a4a0e0e 100644
--- a/Tests/ComplexOneConfig/CMakeLists.txt
+++ b/Tests/ComplexOneConfig/CMakeLists.txt
@@ -368,3 +368,6 @@ endif()
 #
 add_subdirectory(Library)
 add_subdirectory(Executable)
+subdir_depends(Executable Library)
+export_library_dependencies(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake)
+include(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake OPTIONAL)
diff --git a/Tests/RunCMake/CMP0026/CMP0026-WARN-result.txt b/Tests/RunCMake/CMP0026/CMP0026-WARN-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CMP0026/CMP0026-WARN-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CMP0026/CMP0026-WARN-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-WARN-stderr.txt
new file mode 100644
index 0000000..9b88194
--- /dev/null
+++ b/Tests/RunCMake/CMP0026/CMP0026-WARN-stderr.txt
@@ -0,0 +1,12 @@
+CMake Warning \(dev\) at CMP0026-WARN.cmake:5 \(get_target_property\):
+  Policy CMP0026 is not set: Disallow use of the LOCATION target property.
+  Run "cmake --help-policy CMP0026" for policy details.  Use the cmake_policy
+  command to set the policy and suppress this warning.
+
+  The LOCATION property should not be read from target "somelib".  Use the
+  target name directly with add_custom_command, or use the generator
+  expression \$<TARGET_FILE>, as appropriate.
+
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
+This warning is for project developers.  Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0026/CMP0026-WARN.cmake b/Tests/RunCMake/CMP0026/CMP0026-WARN.cmake
new file mode 100644
index 0000000..89c5a8a
--- /dev/null
+++ b/Tests/RunCMake/CMP0026/CMP0026-WARN.cmake
@@ -0,0 +1,5 @@
+
+enable_language(CXX)
+
+add_library(somelib empty.cpp)
+get_target_property(_loc somelib LOCATION)
diff --git a/Tests/RunCMake/CMP0026/RunCMakeTest.cmake b/Tests/RunCMake/CMP0026/RunCMakeTest.cmake
index 72a2e3f..68000a6 100644
--- a/Tests/RunCMake/CMP0026/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMP0026/RunCMakeTest.cmake
@@ -1,4 +1,5 @@
 include(RunCMake)
 
+run_cmake(CMP0026-WARN)
 run_cmake(CMP0026-NEW)
 run_cmake(CMP0026-IMPORTED)
diff --git a/TempMerge b/Tests/RunCMake/DisallowedCommands/CMP0033-NEW-result.txt
similarity index 100%
copy from TempMerge
copy to Tests/RunCMake/DisallowedCommands/CMP0033-NEW-result.txt
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0033-NEW-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0033-NEW-stderr.txt
new file mode 100644
index 0000000..8d210aa
--- /dev/null
+++ b/Tests/RunCMake/DisallowedCommands/CMP0033-NEW-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at CMP0033-NEW.cmake:2 \(export_library_dependencies\):
+  The export_library_dependencies command should not be called; see CMP0033.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0033-NEW.cmake b/Tests/RunCMake/DisallowedCommands/CMP0033-NEW.cmake
new file mode 100644
index 0000000..6f90f29
--- /dev/null
+++ b/Tests/RunCMake/DisallowedCommands/CMP0033-NEW.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0033 NEW)
+export_library_dependencies()
diff --git a/TempMerge b/Tests/RunCMake/DisallowedCommands/CMP0033-OLD-result.txt
similarity index 100%
copy from TempMerge
copy to Tests/RunCMake/DisallowedCommands/CMP0033-OLD-result.txt
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0033-OLD-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0033-OLD-stderr.txt
new file mode 100644
index 0000000..e5dd2dd
--- /dev/null
+++ b/Tests/RunCMake/DisallowedCommands/CMP0033-OLD-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at CMP0033-OLD.cmake:2 \(export_library_dependencies\):
+  export_library_dependencies called with incorrect number of arguments
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0033-OLD.cmake b/Tests/RunCMake/DisallowedCommands/CMP0033-OLD.cmake
new file mode 100644
index 0000000..a3504b6
--- /dev/null
+++ b/Tests/RunCMake/DisallowedCommands/CMP0033-OLD.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0033 OLD)
+export_library_dependencies()
diff --git a/TempMerge b/Tests/RunCMake/DisallowedCommands/CMP0033-WARN-result.txt
similarity index 100%
rename from TempMerge
rename to Tests/RunCMake/DisallowedCommands/CMP0033-WARN-result.txt
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0033-WARN-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0033-WARN-stderr.txt
new file mode 100644
index 0000000..e561dac
--- /dev/null
+++ b/Tests/RunCMake/DisallowedCommands/CMP0033-WARN-stderr.txt
@@ -0,0 +1,12 @@
+CMake Warning \(dev\) at CMP0033-WARN.cmake:1 \(export_library_dependencies\):
+  Policy CMP0033 is not set: The export_library_dependencies command should
+  not be called.  Run "cmake --help-policy CMP0033" for policy details.  Use
+  the cmake_policy command to set the policy and suppress this warning.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
+This warning is for project developers.  Use -Wno-dev to suppress it.
+
+CMake Error at CMP0033-WARN.cmake:1 \(export_library_dependencies\):
+  export_library_dependencies called with incorrect number of arguments
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0033-WARN.cmake b/Tests/RunCMake/DisallowedCommands/CMP0033-WARN.cmake
new file mode 100644
index 0000000..f897ddd
--- /dev/null
+++ b/Tests/RunCMake/DisallowedCommands/CMP0033-WARN.cmake
@@ -0,0 +1 @@
+export_library_dependencies()
diff --git a/Tests/RunCMake/DisallowedCommands/RunCMakeTest.cmake b/Tests/RunCMake/DisallowedCommands/RunCMakeTest.cmake
index af348f8..208ea20 100644
--- a/Tests/RunCMake/DisallowedCommands/RunCMakeTest.cmake
+++ b/Tests/RunCMake/DisallowedCommands/RunCMakeTest.cmake
@@ -5,6 +5,7 @@ foreach(p
     CMP0030
     CMP0031
     CMP0032
+    CMP0033
     CMP0034
     CMP0035
     CMP0036
diff --git a/Tests/RunCMake/include/CMP0024-WARN-result.txt b/Tests/RunCMake/include/CMP0024-WARN-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/include/CMP0024-WARN-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/include/CMP0024-WARN-stderr.txt b/Tests/RunCMake/include/CMP0024-WARN-stderr.txt
new file mode 100644
index 0000000..9c79007
--- /dev/null
+++ b/Tests/RunCMake/include/CMP0024-WARN-stderr.txt
@@ -0,0 +1,14 @@
+CMake Warning \(dev\) at subdir2/CMakeLists.txt:2 \(include\):
+  Policy CMP0024 is not set: Disallow include export result.  Run "cmake
+  --help-policy CMP0024" for policy details.  Use the cmake_policy command to
+  set the policy and suppress this warning.
+
+  The file
+
+    .*/Tests/RunCMake/include/CMP0024-WARN-build/subdir1/theTargets.cmake
+
+  was generated by the export\(\) command.  It should not be used as the
+  argument to the include\(\) command.  Use ALIAS targets instead to refer to
+  targets by alternative names.
+
+This warning is for project developers.  Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/include/CMP0024-WARN.cmake b/Tests/RunCMake/include/CMP0024-WARN.cmake
new file mode 100644
index 0000000..783cf78
--- /dev/null
+++ b/Tests/RunCMake/include/CMP0024-WARN.cmake
@@ -0,0 +1,7 @@
+
+enable_language(CXX)
+
+add_library(foo SHARED empty.cpp)
+
+add_subdirectory(subdir1)
+add_subdirectory(subdir2)
diff --git a/Tests/RunCMake/include/RunCMakeTest.cmake b/Tests/RunCMake/include/RunCMakeTest.cmake
index 0f1d39d..bea7d5c 100644
--- a/Tests/RunCMake/include/RunCMakeTest.cmake
+++ b/Tests/RunCMake/include/RunCMakeTest.cmake
@@ -2,5 +2,6 @@ include(RunCMake)
 
 run_cmake(EmptyString)
 run_cmake(EmptyStringOptional)
+run_cmake(CMP0024-WARN)
 run_cmake(CMP0024-NEW)
 run_cmake(ExportExportInclude)

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

Summary of changes:
 Source/cmCommands.cxx                              |    2 +
 Source/cmComputeLinkDepends.cxx                    |  185 +-
 Source/cmComputeLinkDepends.h                      |   22 +-
 Source/cmComputeLinkInformation.cxx                |  293 ++-
 Source/cmComputeLinkInformation.h                  |   17 +-
 Source/cmComputeTargetDepends.cxx                  |   78 +-
 Source/cmComputeTargetDepends.h                    |   16 +-
 Source/cmCustomCommandGenerator.cxx                |    3 +-
 Source/cmExportBuildFileGenerator.cxx              |   41 +-
 Source/cmExportBuildFileGenerator.h                |    7 +-
 Source/cmExportFileGenerator.cxx                   |   52 +-
 Source/cmExportFileGenerator.h                     |   11 +-
 Source/cmExportInstallFileGenerator.cxx            |   14 +-
 Source/cmExportInstallFileGenerator.h              |    3 +-
 Source/cmExportLibraryDependencies.cxx             |  208 ++
 Source/cmExportLibraryDependencies.h               |   37 +
 Source/cmExportTryCompileFileGenerator.cxx         |    2 +-
 Source/cmExportTryCompileFileGenerator.h           |    2 +-
 Source/cmExtraCodeBlocksGenerator.cxx              |    4 +-
 Source/cmGeneratorExpressionEvaluator.cxx          |   67 +-
 Source/cmGeneratorTarget.cxx                       | 3009 +------------------
 Source/cmGeneratorTarget.h                         |  266 +--
 Source/cmGlobalGenerator.cxx                       |  105 +-
 Source/cmGlobalGenerator.h                         |   14 +-
 Source/cmGlobalKdevelopGenerator.cxx               |   13 +-
 Source/cmGlobalNinjaGenerator.cxx                  |   14 +-
 Source/cmGlobalUnixMakefileGenerator3.cxx          |   23 +-
 Source/cmGlobalXCodeGenerator.cxx                  |   35 +-
 Source/cmGraphVizWriter.cxx                        |   98 +-
 Source/cmIncludeCommand.cxx                        |   40 +-
 Source/cmInstallTargetGenerator.cxx                |   71 +-
 Source/cmInstallTargetGenerator.h                  |    5 +-
 Source/cmLocalGenerator.cxx                        |   19 +-
 Source/cmLocalUnixMakefileGenerator3.cxx           |    3 +-
 Source/cmLocalVisualStudio6Generator.cxx           |   33 +-
 Source/cmLocalVisualStudio7Generator.cxx           |   25 +-
 Source/cmMakefile.cxx                              |    8 +-
 Source/cmMakefileExecutableTargetGenerator.cxx     |    8 +-
 Source/cmMakefileLibraryTargetGenerator.cxx        |   22 +-
 Source/cmMakefileTargetGenerator.cxx               |   18 +-
 Source/cmNinjaNormalTargetGenerator.cxx            |   19 +-
 Source/cmNinjaTargetGenerator.cxx                  |    4 +-
 Source/cmOSXBundleGenerator.cxx                    |   16 +-
 Source/cmOSXBundleGenerator.h                      |    2 -
 Source/cmQtAutoGenerators.cxx                      |   19 +-
 Source/cmTarget.cxx                                | 3338 +++++++++++++++++++-
 Source/cmTarget.h                                  |  276 ++-
 Source/cmTargetDepend.h                            |    4 +-
 Source/cmTestGenerator.cxx                         |    2 +-
 Source/cmVisualStudio10TargetGenerator.cxx         |   15 +-
 Tests/Complex/CMakeLists.txt                       |    3 +
 Tests/ComplexOneConfig/CMakeLists.txt              |    3 +
 .../CMP0026-WARN-result.txt}                       |    0
 Tests/RunCMake/CMP0026/CMP0026-WARN-stderr.txt     |   12 +
 Tests/RunCMake/CMP0026/CMP0026-WARN.cmake          |    5 +
 Tests/RunCMake/CMP0026/RunCMakeTest.cmake          |    1 +
 .../DisallowedCommands/CMP0033-NEW-result.txt      |    0
 .../DisallowedCommands/CMP0033-NEW-stderr.txt      |    4 +
 .../RunCMake/DisallowedCommands/CMP0033-NEW.cmake  |    2 +
 .../DisallowedCommands/CMP0033-OLD-result.txt      |    0
 .../DisallowedCommands/CMP0033-OLD-stderr.txt      |    4 +
 .../RunCMake/DisallowedCommands/CMP0033-OLD.cmake  |    2 +
 .../DisallowedCommands/CMP0033-WARN-result.txt     |    0
 .../DisallowedCommands/CMP0033-WARN-stderr.txt     |   12 +
 .../RunCMake/DisallowedCommands/CMP0033-WARN.cmake |    1 +
 .../RunCMake/DisallowedCommands/RunCMakeTest.cmake |    1 +
 .../CMP0024-WARN-result.txt}                       |    0
 Tests/RunCMake/include/CMP0024-WARN-stderr.txt     |   14 +
 Tests/RunCMake/include/CMP0024-WARN.cmake          |    7 +
 Tests/RunCMake/include/RunCMakeTest.cmake          |    1 +
 70 files changed, 4788 insertions(+), 3872 deletions(-)
 create mode 100644 Source/cmExportLibraryDependencies.cxx
 create mode 100644 Source/cmExportLibraryDependencies.h
 copy Tests/RunCMake/{CMP0022/CMP0022-WARN-empty-old-result.txt => CMP0026/CMP0026-WARN-result.txt} (100%)
 create mode 100644 Tests/RunCMake/CMP0026/CMP0026-WARN-stderr.txt
 create mode 100644 Tests/RunCMake/CMP0026/CMP0026-WARN.cmake
 copy TempMerge => Tests/RunCMake/DisallowedCommands/CMP0033-NEW-result.txt (100%)
 create mode 100644 Tests/RunCMake/DisallowedCommands/CMP0033-NEW-stderr.txt
 create mode 100644 Tests/RunCMake/DisallowedCommands/CMP0033-NEW.cmake
 copy TempMerge => Tests/RunCMake/DisallowedCommands/CMP0033-OLD-result.txt (100%)
 create mode 100644 Tests/RunCMake/DisallowedCommands/CMP0033-OLD-stderr.txt
 create mode 100644 Tests/RunCMake/DisallowedCommands/CMP0033-OLD.cmake
 rename TempMerge => Tests/RunCMake/DisallowedCommands/CMP0033-WARN-result.txt (100%)
 create mode 100644 Tests/RunCMake/DisallowedCommands/CMP0033-WARN-stderr.txt
 create mode 100644 Tests/RunCMake/DisallowedCommands/CMP0033-WARN.cmake
 copy Tests/RunCMake/{CMP0022/CMP0022-WARN-empty-old-result.txt => include/CMP0024-WARN-result.txt} (100%)
 create mode 100644 Tests/RunCMake/include/CMP0024-WARN-stderr.txt
 create mode 100644 Tests/RunCMake/include/CMP0024-WARN.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list