[Cmake-commits] CMake branch, next, updated. v3.4.0-rc2-899-gf271764

Stephen Kelly steveire at gmail.com
Thu Oct 22 17:12:34 EDT 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  f271764c40abbc481d9920e907b7a547ffe313fa (commit)
       via  940375c6202eaac97b0967204964163b5b683e9d (commit)
      from  29164eaa8289efb4891dfc8c46f75d87c5a481d7 (commit)

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

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f271764c40abbc481d9920e907b7a547ffe313fa
commit f271764c40abbc481d9920e907b7a547ffe313fa
Merge: 29164ea 940375c
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Oct 22 17:12:33 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Oct 22 17:12:33 2015 -0400

    Merge topic 'use-generator-target' into next
    
    940375c6 Partial revert.


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

    Partial revert.

diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index e568704..161b532 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -331,7 +331,7 @@ void cmGlobalVisualStudio10Generator::Generate()
   this->cmGlobalVisualStudio8Generator::Generate();
   if(this->LongestSource.Length > 0)
     {
-    cmLocalGenerator* lg = this->LongestSource.Target->GetLocalGenerator();
+    cmMakefile* mf = this->LongestSource.Target->GetMakefile();
     std::ostringstream e;
     e <<
       "The binary and/or source directory paths may be too long to generate "
@@ -346,13 +346,13 @@ void cmGlobalVisualStudio10Generator::Generate()
       "  " << this->LongestSource.SourceFile->GetFullPath() << "\n"
       "This is because some Visual Studio tools would append the relative "
       "path to the end of the referencing directory path, as in:\n"
-      "  " << lg->GetCurrentBinaryDirectory() << "/"
+      "  " << mf->GetCurrentBinaryDirectory() << "/"
       << this->LongestSource.SourceRel << "\n"
       "and then incorrectly complain that the file does not exist because "
       "the path length is too long for some internal buffer or API.  "
       "To avoid this problem CMake must use a full path for this file "
       "which then triggers the VS 10 property dialog bug.";
-    lg->IssueMessage(cmake::WARNING, e.str().c_str());
+    mf->IssueMessage(cmake::WARNING, e.str().c_str());
     }
 }
 
@@ -591,11 +591,9 @@ cmGlobalVisualStudio10Generator
 
 //----------------------------------------------------------------------------
 void cmGlobalVisualStudio10Generator::PathTooLong(
-        cmGeneratorTarget *target, cmSourceFile const* sf,
-        std::string const& sfRel)
+  cmTarget* target, cmSourceFile const* sf, std::string const& sfRel)
 {
-  size_t len =
-      (strlen(target->GetLocalGenerator()->GetCurrentBinaryDirectory()) +
+  size_t len = (strlen(target->GetMakefile()->GetCurrentBinaryDirectory()) +
                 1 + sfRel.length());
   if(len > this->LongestSource.Length)
     {
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index 6bf4740..7600a0d 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -95,7 +95,7 @@ public:
   /** Generate an <output>.rule file path for a given command output.  */
   virtual std::string GenerateRuleFile(std::string const& output) const;
 
-  void PathTooLong(cmGeneratorTarget* target, cmSourceFile const* sf,
+  void PathTooLong(cmTarget* target, cmSourceFile const* sf,
                    std::string const& sfRel);
 
   virtual const char* GetToolsVersion() { return "4.0"; }
@@ -139,7 +139,7 @@ private:
   {
     LongestSourcePath(): Length(0), Target(0), SourceFile(0) {}
     size_t Length;
-    cmGeneratorTarget* Target;
+    cmTarget* Target;
     cmSourceFile const* SourceFile;
     std::string SourceRel;
   };
diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx
index 48c07a8..9e411c9 100644
--- a/Source/cmGlobalVisualStudio6Generator.cxx
+++ b/Source/cmGlobalVisualStudio6Generator.cxx
@@ -299,7 +299,7 @@ void cmGlobalVisualStudio6Generator::WriteProject(std::ostream& fout,
   fout << "Package=<5>\n{{{\n}}}\n\n";
   fout << "Package=<4>\n";
   fout << "{{{\n";
-  VSDependSet const& depends = this->VSTargetDepends[target];
+  VSDependSet const& depends = this->VSTargetDepends[target->Target];
   for(VSDependSet::const_iterator di = depends.begin();
       di != depends.end(); ++di)
     {
@@ -310,7 +310,7 @@ void cmGlobalVisualStudio6Generator::WriteProject(std::ostream& fout,
     }
   fout << "}}}\n\n";
 
-  UtilityDependsMap::iterator ui = this->UtilityDepends.find(target);
+  UtilityDependsMap::iterator ui = this->UtilityDepends.find(target->Target);
   if(ui != this->UtilityDepends.end())
     {
     const char* uname = ui->second.c_str();
@@ -383,13 +383,12 @@ void cmGlobalVisualStudio6Generator::WriteDSWHeader(std::ostream& fout)
 
 //----------------------------------------------------------------------------
 std::string
-cmGlobalVisualStudio6Generator::WriteUtilityDepend(
-    const cmGeneratorTarget *target)
+cmGlobalVisualStudio6Generator::WriteUtilityDepend(const cmTarget *target)
 {
   std::string pname = target->GetName();
   pname += "_UTILITY";
   pname = GetVS6TargetName(pname.c_str());
-  std::string fname = target->GetLocalGenerator()->GetCurrentBinaryDirectory();
+  std::string fname = target->GetMakefile()->GetCurrentBinaryDirectory();
   fname += "/";
   fname += pname;
   fname += ".dsp";
diff --git a/Source/cmGlobalVisualStudio6Generator.h b/Source/cmGlobalVisualStudio6Generator.h
index 22ad8a9..edf637f 100644
--- a/Source/cmGlobalVisualStudio6Generator.h
+++ b/Source/cmGlobalVisualStudio6Generator.h
@@ -97,7 +97,7 @@ private:
                             const std::string& name, const char* path,
                             const std::set<std::string>& dependencies);
   void WriteDSWFooter(std::ostream& fout);
-  virtual std::string WriteUtilityDepend(cmGeneratorTarget const* target);
+  virtual std::string WriteUtilityDepend(cmTarget const* target);
   std::string MSDevCommand;
   bool MSDevCommandInitialized;
   std::string const& GetMSDevCommand();
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx
index 8227b82..9bb37ce 100644
--- a/Source/cmGlobalVisualStudio71Generator.cxx
+++ b/Source/cmGlobalVisualStudio71Generator.cxx
@@ -152,7 +152,7 @@ void
 cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout,
                                               const std::string& dspname,
                                               const char* dir,
-                                              cmGeneratorTarget const* t)
+                                              cmTarget const& t)
 {
   // check to see if this is a fortran build
   const char* ext = ".vcproj";
@@ -163,7 +163,7 @@ cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout,
     ext = ".vfproj";
     project = "Project(\"{6989167D-11E4-40FE-8C1A-2192A86A7E90}\") = \"";
     }
-  const char* targetExt = t->GetProperty("GENERATOR_FILE_NAME_EXT");
+  const char* targetExt = t.GetProperty("GENERATOR_FILE_NAME_EXT");
   if(targetExt)
     {
     ext = targetExt;
@@ -180,7 +180,7 @@ cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout,
 
   fout <<"EndProject\n";
 
-  UtilityDependsMap::iterator ui = this->UtilityDepends.find(t);
+  UtilityDependsMap::iterator ui = this->UtilityDepends.find(&t);
   if(ui != this->UtilityDepends.end())
     {
     const char* uname = ui->second.c_str();
@@ -204,9 +204,9 @@ void
 cmGlobalVisualStudio71Generator
 ::WriteProjectDepends(std::ostream& fout,
                       const std::string&,
-                      const char*, cmGeneratorTarget const* target)
+                      const char*, cmTarget const& target)
 {
-  VSDependSet const& depends = this->VSTargetDepends[target];
+  VSDependSet const& depends = this->VSTargetDepends[&target];
   for(VSDependSet::const_iterator di = depends.begin();
       di != depends.end(); ++di)
     {
@@ -215,7 +215,7 @@ cmGlobalVisualStudio71Generator
     if(guid.empty())
       {
       std::string m = "Target: ";
-      m += target->GetName();
+      m += target.GetName();
       m += " depends on unknown target: ";
       m += name;
       cmSystemTools::Error(m.c_str());
diff --git a/Source/cmGlobalVisualStudio71Generator.h b/Source/cmGlobalVisualStudio71Generator.h
index 5035fda..7f88e34 100644
--- a/Source/cmGlobalVisualStudio71Generator.h
+++ b/Source/cmGlobalVisualStudio71Generator.h
@@ -59,10 +59,10 @@ protected:
     std::ostream& fout, std::vector<std::string> const& configs);
   virtual void WriteProject(std::ostream& fout,
                             const std::string& name, const char* path,
-                            const cmGeneratorTarget *t);
+                            cmTarget const& t);
   virtual void WriteProjectDepends(std::ostream& fout,
                            const std::string& name, const char* path,
-                           cmGeneratorTarget const* t);
+                           cmTarget const& t);
   virtual void WriteProjectConfigurations(
     std::ostream& fout, const std::string& name, cmState::TargetType type,
     std::vector<std::string> const& configs,
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 89b21ed..1909f21 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -441,7 +441,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
   for(OrderedTargetDependSet::const_iterator tt =
         projectTargets.begin(); tt != projectTargets.end(); ++tt)
     {
-    cmGeneratorTarget const* target = *tt;
+    cmTarget const* target = (*tt)->Target;
     if(target->GetType() == cmState::INTERFACE_LIBRARY)
       {
       continue;
@@ -459,7 +459,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
                                  project.c_str(),
                                  location.c_str(),
                                  target->GetProperty("VS_PROJECT_TYPE"),
-                                 target->Target->GetUtilities());
+                                 target->GetUtilities());
       written = true;
       }
     else
@@ -468,7 +468,9 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
         target->GetProperty("GENERATOR_FILE_NAME");
       if(vcprojName)
         {
-        cmLocalGenerator* lg = target->GetLocalGenerator();
+        cmLocalGenerator* lg =
+            root->GetGlobalGenerator()->GetGeneratorTarget(target)
+            ->GetLocalGenerator();
         std::string dir = lg->GetCurrentBinaryDirectory();
         dir = root->Convert(dir.c_str(),
                             cmLocalGenerator::START_OUTPUT);
@@ -477,7 +479,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
           dir = ""; // msbuild cannot handle ".\" prefix
           }
         this->WriteProject(fout, vcprojName, dir.c_str(),
-                           target);
+                           *target);
         written = true;
         }
       }
@@ -533,19 +535,19 @@ void cmGlobalVisualStudio7Generator::WriteTargetDepends(
   for(OrderedTargetDependSet::const_iterator tt =
         projectTargets.begin(); tt != projectTargets.end(); ++tt)
     {
-    cmGeneratorTarget const* target = *tt;
+    cmTarget const* target = (*tt)->Target;
     if(target->GetType() == cmState::INTERFACE_LIBRARY)
       {
       continue;
       }
-    cmLocalGenerator* lg = target->GetLocalGenerator();
+    cmMakefile* mf = target->GetMakefile();
     const char *vcprojName =
       target->GetProperty("GENERATOR_FILE_NAME");
     if (vcprojName)
       {
-      std::string dir = lg->GetCurrentSourceDirectory();
+      std::string dir = mf->GetCurrentSourceDirectory();
       this->WriteProjectDepends(fout, vcprojName,
-                                dir.c_str(), target);
+                                dir.c_str(), *target);
       }
     }
 }
@@ -685,8 +687,7 @@ cmGlobalVisualStudio7Generator::ConvertToSolutionPath(const char* path)
 // the libraries it uses are also done here
 void cmGlobalVisualStudio7Generator::WriteProject(std::ostream& fout,
                                const std::string& dspname,
-                               const char* dir,
-                               const cmGeneratorTarget *target)
+                               const char* dir, cmTarget const& target)
 {
    // check to see if this is a fortran build
   const char* ext = ".vcproj";
@@ -704,7 +705,7 @@ void cmGlobalVisualStudio7Generator::WriteProject(std::ostream& fout,
        << dspname << ext << "\", \"{"
        << this->GetGUID(dspname) << "}\"\nEndProject\n";
 
-  UtilityDependsMap::iterator ui = this->UtilityDepends.find(target);
+  UtilityDependsMap::iterator ui = this->UtilityDepends.find(&target);
   if(ui != this->UtilityDepends.end())
     {
     const char* uname = ui->second.c_str();
@@ -726,11 +727,11 @@ void
 cmGlobalVisualStudio7Generator
 ::WriteProjectDepends(std::ostream& fout,
                       const std::string& dspname,
-                      const char*, cmGeneratorTarget const* target)
+                      const char*, cmTarget const& target)
 {
   int depcount = 0;
   std::string dspguid = this->GetGUID(dspname);
-  VSDependSet const& depends = this->VSTargetDepends[target];
+  VSDependSet const& depends = this->VSTargetDepends[&target];
   for(VSDependSet::const_iterator di = depends.begin();
       di != depends.end(); ++di)
     {
@@ -739,7 +740,7 @@ cmGlobalVisualStudio7Generator
     if(guid.empty())
       {
       std::string m = "Target: ";
-      m += target->GetName();
+      m += target.GetName();
       m += " depends on unknown target: ";
       m += name;
       cmSystemTools::Error(m.c_str());
@@ -748,7 +749,7 @@ cmGlobalVisualStudio7Generator
     depcount++;
     }
 
-  UtilityDependsMap::iterator ui = this->UtilityDepends.find(target);
+  UtilityDependsMap::iterator ui = this->UtilityDepends.find(&target);
   if(ui != this->UtilityDepends.end())
     {
     const char* uname = ui->second.c_str();
@@ -888,14 +889,13 @@ void cmGlobalVisualStudio7Generator::WriteSLNHeader(std::ostream& fout)
 
 //----------------------------------------------------------------------------
 std::string
-cmGlobalVisualStudio7Generator::WriteUtilityDepend(
-        cmGeneratorTarget const* target)
+cmGlobalVisualStudio7Generator::WriteUtilityDepend(cmTarget const* target)
 {
   std::vector<std::string> configs;
-  target->Target->GetMakefile()->GetConfigurations(configs);
+  target->GetMakefile()->GetConfigurations(configs);
   std::string pname = target->GetName();
   pname += "_UTILITY";
-  std::string fname = target->GetLocalGenerator()->GetCurrentBinaryDirectory();
+  std::string fname = target->GetMakefile()->GetCurrentBinaryDirectory();
   fname += "/";
   fname += pname;
   fname += ".vcproj";
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index b6caf5b..4ef0990 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -94,8 +94,7 @@ public:
 
   /** Return true if the target project file should have the option
       LinkLibraryDependencies and link to .sln dependencies. */
-  virtual bool NeedLinkLibraryDependencies(cmGeneratorTarget*)
-  { return false; }
+  virtual bool NeedLinkLibraryDependencies(cmTarget&) { return false; }
 
   const char* GetIntelProjectVersion();
 
@@ -124,10 +123,10 @@ protected:
                             std::vector<cmLocalGenerator*>& generators);
   virtual void WriteProject(std::ostream& fout,
                             const std::string& name, const char* path,
-                            cmGeneratorTarget const* t);
+                            cmTarget const& t);
   virtual void WriteProjectDepends(std::ostream& fout,
                            const std::string& name, const char* path,
-                           cmGeneratorTarget const* t);
+                           cmTarget const&t);
   virtual void WriteProjectConfigurations(
     std::ostream& fout, const std::string& name, cmState::TargetType type,
     std::vector<std::string> const& configs,
@@ -137,7 +136,7 @@ protected:
                                       cmLocalGenerator* root);
   virtual void WriteSLNFooter(std::ostream& fout);
   virtual void WriteSLNHeader(std::ostream& fout);
-  virtual std::string WriteUtilityDepend(cmGeneratorTarget const* target);
+  virtual std::string WriteUtilityDepend(cmTarget const* target);
 
   virtual void WriteTargetsToSolution(
     std::ostream& fout,
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index 00ca21a..a22315c 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -441,9 +441,9 @@ bool cmGlobalVisualStudio8Generator::ComputeTargetDepends()
 
 //----------------------------------------------------------------------------
 void cmGlobalVisualStudio8Generator::WriteProjectDepends(
-        std::ostream& fout, const std::string&, const char*,
-        const cmGeneratorTarget *gt)
+  std::ostream& fout, const std::string&, const char*, cmTarget const& t)
 {
+  cmGeneratorTarget* gt = this->GetGeneratorTarget(&t);
   TargetDependSet const& unordered = this->GetTargetDirectDepends(gt);
   OrderedTargetDependSet depends(unordered, std::string());
   for(OrderedTargetDependSet::const_iterator i = depends.begin();
@@ -460,16 +460,14 @@ void cmGlobalVisualStudio8Generator::WriteProjectDepends(
 
 //----------------------------------------------------------------------------
 bool cmGlobalVisualStudio8Generator::NeedLinkLibraryDependencies(
-        cmGeneratorTarget *target)
+  cmTarget& target)
 {
   // Look for utility dependencies that magically link.
   for(std::set<std::string>::const_iterator ui =
-        target->Target->GetUtilities().begin();
-      ui != target->Target->GetUtilities().end(); ++ui)
+        target.GetUtilities().begin();
+      ui != target.GetUtilities().end(); ++ui)
     {
-      cmGeneratorTarget* depTarget = 0;
-//    if(cmGeneratorTarget* depTarget =
-  //          this->FindGeneratorTarget(ui->c_str()))
+    if(cmTarget* depTarget = this->FindTarget(ui->c_str()))
       {
       if(depTarget->GetType() != cmState::INTERFACE_LIBRARY
           && depTarget->GetProperty("EXTERNAL_MSPROJECT"))
diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h
index 54dc545..60c63d1 100644
--- a/Source/cmGlobalVisualStudio8Generator.h
+++ b/Source/cmGlobalVisualStudio8Generator.h
@@ -60,7 +60,7 @@ public:
 
   /** Return true if the target project file should have the option
       LinkLibraryDependencies and link to .sln dependencies. */
-  virtual bool NeedLinkLibraryDependencies(cmGeneratorTarget* target);
+  virtual bool NeedLinkLibraryDependencies(cmTarget& target);
 
   /** Return true if building for Windows CE */
   virtual bool TargetsWindowsCE() const {
@@ -91,8 +91,7 @@ protected:
   virtual bool ComputeTargetDepends();
   virtual void WriteProjectDepends(std::ostream& fout,
                                    const std::string& name,
-                                   const char* path,
-                                   cmGeneratorTarget const* gt);
+                                   const char* path, cmTarget const& t);
 
   std::string Name;
   std::string WindowsCEVersion;
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index 31f6475..4d431f6 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -303,19 +303,19 @@ std::string cmGlobalVisualStudioGenerator::GetUserMacrosRegKeyBase()
 }
 
 //----------------------------------------------------------------------------
-void cmGlobalVisualStudioGenerator::FillLinkClosure(
-        cmGeneratorTarget const* target,
+void cmGlobalVisualStudioGenerator::FillLinkClosure(cmTarget const* target,
                                                     TargetSet& linked)
 {
   if(linked.insert(target).second)
     {
-    TargetDependSet const& depends = this->GetTargetDirectDepends(target);
+    cmGeneratorTarget* gt = this->GetGeneratorTarget(target);
+    TargetDependSet const& depends = this->GetTargetDirectDepends(gt);
     for(TargetDependSet::const_iterator di = depends.begin();
         di != depends.end(); ++di)
       {
       if(di->IsLink())
         {
-        this->FillLinkClosure(*di, linked);
+        this->FillLinkClosure((*di)->Target, linked);
         }
       }
     }
@@ -323,8 +323,7 @@ void cmGlobalVisualStudioGenerator::FillLinkClosure(
 
 //----------------------------------------------------------------------------
 cmGlobalVisualStudioGenerator::TargetSet const&
-cmGlobalVisualStudioGenerator::GetTargetLinkClosure(
-        cmGeneratorTarget *target)
+cmGlobalVisualStudioGenerator::GetTargetLinkClosure(cmTarget* target)
 {
   TargetSetMap::iterator i = this->TargetLinkClosure.find(target);
   if(i == this->TargetLinkClosure.end())
@@ -338,8 +337,7 @@ cmGlobalVisualStudioGenerator::GetTargetLinkClosure(
 
 //----------------------------------------------------------------------------
 void cmGlobalVisualStudioGenerator::FollowLinkDepends(
-        const cmGeneratorTarget *target,
-        std::set<const cmGeneratorTarget *> &linked)
+  cmTarget const* target, std::set<cmTarget const*>& linked)
 {
   if(target->GetType() == cmState::INTERFACE_LIBRARY)
     {
@@ -350,13 +348,14 @@ void cmGlobalVisualStudioGenerator::FollowLinkDepends(
     {
     // Static library targets do not list their link dependencies so
     // we must follow them transitively now.
-    TargetDependSet const& depends = this->GetTargetDirectDepends(target);
+    cmGeneratorTarget* gt = this->GetGeneratorTarget(target);
+    TargetDependSet const& depends = this->GetTargetDirectDepends(gt);
     for(TargetDependSet::const_iterator di = depends.begin();
         di != depends.end(); ++di)
       {
       if(di->IsLink())
         {
-        this->FollowLinkDepends(*di, linked);
+        this->FollowLinkDepends((*di)->Target, linked);
         }
       }
     }
@@ -380,7 +379,7 @@ bool cmGlobalVisualStudioGenerator::ComputeTargetDepends()
       for(std::vector<cmGeneratorTarget*>::iterator ti = targets.begin();
           ti != targets.end(); ++ti)
         {
-        this->ComputeVSTargetDepends(*ti);
+        this->ComputeVSTargetDepends(*(*ti)->Target);
         }
       }
     }
@@ -394,14 +393,13 @@ static bool VSLinkable(cmGeneratorTarget const* t)
 }
 
 //----------------------------------------------------------------------------
-void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends(
-    cmGeneratorTarget* target)
+void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends(cmTarget& target)
 {
-  if(this->VSTargetDepends.find(target) != this->VSTargetDepends.end())
+  if(this->VSTargetDepends.find(&target) != this->VSTargetDepends.end())
     {
     return;
     }
-  VSDependSet& vsTargetDepend = this->VSTargetDepends[target];
+  VSDependSet& vsTargetDepend = this->VSTargetDepends[&target];
   // VS <= 7.1 has two behaviors that affect solution dependencies.
   //
   // (1) Solution-level dependencies between a linkable target and a
@@ -421,18 +419,19 @@ void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends(
   // leaving them out for the static library itself but following them
   // transitively for other targets.
 
-  bool allowLinkable = (target->GetType() != cmState::STATIC_LIBRARY &&
-                        target->GetType() != cmState::SHARED_LIBRARY &&
-                        target->GetType() != cmState::MODULE_LIBRARY &&
-                        target->GetType() != cmState::EXECUTABLE);
+  bool allowLinkable = (target.GetType() != cmState::STATIC_LIBRARY &&
+                        target.GetType() != cmState::SHARED_LIBRARY &&
+                        target.GetType() != cmState::MODULE_LIBRARY &&
+                        target.GetType() != cmState::EXECUTABLE);
 
-  TargetDependSet const& depends = this->GetTargetDirectDepends(target);
+  cmGeneratorTarget* gt = this->GetGeneratorTarget(&target);
+  TargetDependSet const& depends = this->GetTargetDirectDepends(gt);
 
   // Collect implicit link dependencies (target_link_libraries).
   // Static libraries cannot depend on their link implementation
   // due to behavior (2), but they do not really need to.
-  std::set<cmGeneratorTarget const*> linkDepends;
-  if(target->GetType() != cmState::STATIC_LIBRARY)
+  std::set<cmTarget const*> linkDepends;
+  if(target.GetType() != cmState::STATIC_LIBRARY)
     {
     for(TargetDependSet::const_iterator di = depends.begin();
         di != depends.end(); ++di)
@@ -440,54 +439,55 @@ void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends(
       cmTargetDepend dep = *di;
       if(dep.IsLink())
         {
-        this->FollowLinkDepends(*di, linkDepends);
+        this->FollowLinkDepends(dep->Target, linkDepends);
         }
       }
     }
 
   // Collect explicit util dependencies (add_dependencies).
-  std::set<cmGeneratorTarget const*> utilDepends;
+  std::set<cmTarget const*> utilDepends;
   for(TargetDependSet::const_iterator di = depends.begin();
       di != depends.end(); ++di)
     {
     cmTargetDepend dep = *di;
     if(dep.IsUtil())
       {
-      this->FollowLinkDepends(*di, utilDepends);
+      this->FollowLinkDepends(dep->Target, utilDepends);
       }
     }
 
   // Collect all targets linked by this target so we can avoid
   // intermediate targets below.
   TargetSet linked;
-  if(target->GetType() != cmState::STATIC_LIBRARY)
+  if(target.GetType() != cmState::STATIC_LIBRARY)
     {
-    linked = this->GetTargetLinkClosure(target);
+    linked = this->GetTargetLinkClosure(&target);
     }
 
   // Emit link dependencies.
-  for(std::set<cmGeneratorTarget const*>::iterator di = linkDepends.begin();
+  for(std::set<cmTarget const*>::iterator di = linkDepends.begin();
       di != linkDepends.end(); ++di)
     {
-    cmGeneratorTarget const* dep = *di;
+    cmTarget const* dep = *di;
     vsTargetDepend.insert(dep->GetName());
     }
 
   // Emit util dependencies.  Possibly use intermediate targets.
-  for(std::set<cmGeneratorTarget const*>::iterator di = utilDepends.begin();
+  for(std::set<cmTarget const*>::iterator di = utilDepends.begin();
       di != utilDepends.end(); ++di)
     {
-    cmGeneratorTarget const* dgt = *di;
-    if(allowLinkable || !VSLinkable(dgt) || linked.count(dgt))
+    cmTarget const* dep = *di;
+    cmGeneratorTarget* dgt = this->GetGeneratorTarget(dep);
+    if(allowLinkable || !VSLinkable(dgt) || linked.count(dep))
       {
       // Direct dependency allowed.
-      vsTargetDepend.insert(dgt->GetName());
+      vsTargetDepend.insert(dep->GetName());
       }
     else
       {
       // Direct dependency on linkable target not allowed.
       // Use an intermediate utility target.
-      vsTargetDepend.insert(this->GetUtilityDepend(dgt));
+      vsTargetDepend.insert(this->GetUtilityDepend(dep));
       }
     }
 }
@@ -507,8 +507,7 @@ void cmGlobalVisualStudioGenerator::FindMakeProgram(cmMakefile* mf)
 
 //----------------------------------------------------------------------------
 std::string
-cmGlobalVisualStudioGenerator::GetUtilityDepend(
-    cmGeneratorTarget const* target)
+cmGlobalVisualStudioGenerator::GetUtilityDepend(cmTarget const* target)
 {
   UtilityDependsMap::iterator i = this->UtilityDepends.find(target);
   if(i == this->UtilityDepends.end())
@@ -831,20 +830,21 @@ void RegisterVisualStudioMacros(const std::string& macrosFile,
     }
 }
 bool
-cmGlobalVisualStudioGenerator::TargetIsFortranOnly(
-        const cmGeneratorTarget* target)
+cmGlobalVisualStudioGenerator::TargetIsFortranOnly(cmTarget const& target)
 {
+  cmGeneratorTarget* gt = this->GetGeneratorTarget(&target);
+
   // check to see if this is a fortran build
   std::set<std::string> languages;
   {
   // Issue diagnostic if the source files depend on the config.
   std::vector<cmSourceFile*> sources;
-  if (!target->GetConfigCommonSourceFiles(sources))
+  if (!gt->GetConfigCommonSourceFiles(sources))
     {
     return false;
     }
   }
-  target->GetLanguages(languages, "");
+  gt->GetLanguages(languages, "");
   if(languages.size() == 1)
     {
     if(*languages.begin() == "Fortran")
@@ -892,7 +892,9 @@ cmGlobalVisualStudioGenerator::OrderedTargetDependSet
   for (TargetSet::const_iterator it = targets.begin();
        it != targets.end(); ++it)
     {
-    this->insert(*it);
+    cmGeneratorTarget* gt =
+        (*it)->GetMakefile()->GetGlobalGenerator()->GetGeneratorTarget(*it);
+    this->insert(gt);
     }
 }
 
diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h
index d529e2f..41d0b88 100644
--- a/Source/cmGlobalVisualStudioGenerator.h
+++ b/Source/cmGlobalVisualStudioGenerator.h
@@ -73,7 +73,7 @@ public:
                              const char* vsSolutionFile = 0);
 
   // return true if target is fortran only
-  bool TargetIsFortranOnly(const cmGeneratorTarget *t);
+  bool TargetIsFortranOnly(cmTarget const& t);
 
   /** Get the top-level registry key for this VS version.  */
   std::string GetRegistryBase();
@@ -88,7 +88,7 @@ public:
   /** Return true if building for Windows CE */
   virtual bool TargetsWindowsCE() const { return false; }
 
-  class TargetSet: public std::set<cmGeneratorTarget const*> {};
+  class TargetSet: public std::set<cmTarget const*> {};
   class TargetCompare
   {
     std::string First;
@@ -122,16 +122,15 @@ protected:
 
   virtual bool ComputeTargetDepends();
   class VSDependSet: public std::set<std::string> {};
-  class VSDependMap: public std::map<cmGeneratorTarget const*, VSDependSet> {};
+  class VSDependMap: public std::map<cmTarget const*, VSDependSet> {};
   VSDependMap VSTargetDepends;
-  void ComputeVSTargetDepends(cmGeneratorTarget *);
-
-  bool CheckTargetLinks(cmGeneratorTarget& target, const std::string& name);
-  std::string GetUtilityForTarget(cmGeneratorTarget& target,
-                                  const std::string&);
-  virtual std::string WriteUtilityDepend(cmGeneratorTarget const*) = 0;
-  std::string GetUtilityDepend(cmGeneratorTarget const* target);
-  typedef std::map<cmGeneratorTarget const*, std::string> UtilityDependsMap;
+  void ComputeVSTargetDepends(cmTarget&);
+
+  bool CheckTargetLinks(cmTarget& target, const std::string& name);
+  std::string GetUtilityForTarget(cmTarget& target, const std::string&);
+  virtual std::string WriteUtilityDepend(cmTarget const*) = 0;
+  std::string GetUtilityDepend(cmTarget const* target);
+  typedef std::map<cmTarget const*, std::string> UtilityDependsMap;
   UtilityDependsMap UtilityDepends;
 
 protected:
@@ -142,14 +141,13 @@ private:
   void PrintCompilerAdvice(std::ostream&, std::string const&,
                            const char*) const {}
 
-  void FollowLinkDepends(cmGeneratorTarget const* target,
-                         std::set<cmGeneratorTarget const*>& linked);
+  void FollowLinkDepends(cmTarget const* target,
+                         std::set<cmTarget const*>& linked);
 
-  class TargetSetMap: public std::map<cmGeneratorTarget*, TargetSet> {};
+  class TargetSetMap: public std::map<cmTarget*, TargetSet> {};
   TargetSetMap TargetLinkClosure;
-  void FillLinkClosure(const cmGeneratorTarget *target,
-                       TargetSet& linked);
-  TargetSet const& GetTargetLinkClosure(cmGeneratorTarget* target);
+  void FillLinkClosure(cmTarget const* target, TargetSet& linked);
+  TargetSet const& GetTargetLinkClosure(cmTarget* target);
 };
 
 class cmGlobalVisualStudioGenerator::OrderedTargetDependSet:
diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx
index d59fdc6..c9d53fe 100644
--- a/Source/cmLocalVisualStudio10Generator.cxx
+++ b/Source/cmLocalVisualStudio10Generator.cxx
@@ -83,14 +83,14 @@ void cmLocalVisualStudio10Generator::Generate()
       continue;
       }
     if(static_cast<cmGlobalVisualStudioGenerator*>(this->GlobalGenerator)
-       ->TargetIsFortranOnly(*l))
+       ->TargetIsFortranOnly(*(*l)->Target))
       {
-      this->CreateSingleVCProj((*l)->GetName().c_str(), *l);
+      this->CreateSingleVCProj((*l)->GetName().c_str(), *(*l)->Target);
       }
     else
       {
       cmVisualStudio10TargetGenerator tg(
-        *l, static_cast<cmGlobalVisualStudio10Generator*>(
+        (*l)->Target, static_cast<cmGlobalVisualStudio10Generator*>(
           this->GetGlobalGenerator()));
       tg.Generate();
       }
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index d5abf68..a7f0616 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -841,7 +841,7 @@ cmLocalVisualStudio6Generator::CreateTargetRules(cmGeneratorTarget *target,
   event.Write(target->Target->GetPreBuildCommands());
   event.Write(target->Target->GetPreLinkCommands());
   cmsys::auto_ptr<cmCustomCommand> pcc(
-    this->MaybeCreateImplibDir(target, configName, false));
+    this->MaybeCreateImplibDir(*target->Target, configName, false));
   if(pcc.get())
     {
     event.Write(*pcc);
@@ -1935,7 +1935,7 @@ cmLocalVisualStudio6Generator
 //----------------------------------------------------------------------------
 std::string
 cmLocalVisualStudio6Generator
-::ComputeLongestObjectDirectory(cmGeneratorTarget const*) const
+::ComputeLongestObjectDirectory(cmTarget&) const
 {
   // Compute the maximum length configuration name.
   std::string config_max;
diff --git a/Source/cmLocalVisualStudio6Generator.h b/Source/cmLocalVisualStudio6Generator.h
index d0c8239..4772d54 100644
--- a/Source/cmLocalVisualStudio6Generator.h
+++ b/Source/cmLocalVisualStudio6Generator.h
@@ -50,8 +50,7 @@ public:
 
   virtual
   std::string GetTargetDirectory(cmGeneratorTarget const* target) const;
-  virtual std::string ComputeLongestObjectDirectory(
-      cmGeneratorTarget const*) const;
+  virtual std::string ComputeLongestObjectDirectory(cmTarget&) const;
 private:
   std::string DSPHeaderTemplate;
   std::string DSPFooterTemplate;
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 139d7c3..4895698 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -34,8 +34,7 @@ public:
     LocalGenerator(e) {}
   typedef cmComputeLinkInformation::ItemVector ItemVector;
   void OutputLibraries(std::ostream& fout, ItemVector const& libs);
-  void OutputObjects(std::ostream& fout, cmGeneratorTarget* t,
-                     const char* isep = 0);
+  void OutputObjects(std::ostream& fout, cmTarget* t, const char* isep = 0);
 private:
   cmLocalVisualStudio7Generator* LocalGenerator;
 };
@@ -130,7 +129,8 @@ void cmLocalVisualStudio7Generator::FixGlobalTargets()
   for(std::vector<cmGeneratorTarget*>::iterator l = tgts.begin();
       l != tgts.end(); l++)
     {
-    if((*l)->GetType() == cmState::GLOBAL_TARGET)
+    cmTarget& tgt = *(*l)->Target;
+    if(tgt.GetType() == cmState::GLOBAL_TARGET)
       {
       std::vector<std::string> no_depends;
       cmCustomCommandLine force_command;
@@ -142,7 +142,7 @@ void cmLocalVisualStudio7Generator::FixGlobalTargets()
       std::string force = this->GetCurrentBinaryDirectory();
       force += cmake::GetCMakeFilesDirectory();
       force += "/";
-      force += (*l)->GetName();
+      force += tgt.GetName();
       force += "_force";
       if(cmSourceFile* file =
          this->Makefile->AddCustomCommandToOutput(
@@ -187,7 +187,7 @@ void cmLocalVisualStudio7Generator::WriteProjectFiles()
     // so don't build a projectfile for it
     if(!(*l)->GetProperty("EXTERNAL_MSPROJECT"))
       {
-      this->CreateSingleVCProj((*l)->GetName().c_str(), *l);
+      this->CreateSingleVCProj((*l)->GetName().c_str(), *(*l)->Target);
       }
     }
 }
@@ -225,7 +225,7 @@ void cmLocalVisualStudio7Generator::WriteStampFiles()
 
 //----------------------------------------------------------------------------
 void cmLocalVisualStudio7Generator
-::CreateSingleVCProj(const std::string& lname, cmGeneratorTarget *target)
+::CreateSingleVCProj(const std::string& lname, cmTarget &target)
 {
   cmGlobalVisualStudioGenerator* gg
       = static_cast<cmGlobalVisualStudioGenerator*>(this->GlobalGenerator);
@@ -241,7 +241,7 @@ void cmLocalVisualStudio7Generator
     }
 
   // add to the list of projects
-  target->Target->SetProperty("GENERATOR_FILE_NAME",lname.c_str());
+  target.SetProperty("GENERATOR_FILE_NAME",lname.c_str());
   // create the dsp.cmake file
   std::string fname;
   fname = this->GetCurrentBinaryDirectory();
@@ -324,9 +324,8 @@ cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule()
 }
 
 void cmLocalVisualStudio7Generator::WriteConfigurations(
-    std::ostream& fout,
-    std::vector<std::string> const& configs,
-  const std::string& libName, cmGeneratorTarget *target
+  std::ostream& fout, std::vector<std::string> const& configs,
+  const std::string& libName, cmTarget &target
   )
 {
   fout << "\t<Configurations>\n";
@@ -644,7 +643,7 @@ private:
 void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
                                                 const std::string& configName,
                                                 const std::string& libName,
-                                                cmGeneratorTarget *target)
+                                                cmTarget &target)
 {
   const char* mfcFlag = this->Makefile->GetDefinition("CMAKE_MFC_FLAG");
   if(!mfcFlag)
@@ -665,7 +664,10 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
   const char* projectType = 0;
   bool targetBuilds = true;
 
-  switch(target->GetType())
+  cmGeneratorTarget* gt =
+    this->GlobalGenerator->GetGeneratorTarget(&target);
+
+  switch(target.GetType())
     {
     case cmState::OBJECT_LIBRARY:
       targetBuilds = false; // no manifest tool for object library
@@ -697,12 +699,12 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
     {
     const std::string& linkLanguage = (this->FortranProject?
                                        std::string("Fortran"):
-                                target->GetLinkerLanguage(configName));
+                                gt->GetLinkerLanguage(configName));
     if(linkLanguage.empty())
       {
       cmSystemTools::Error
         ("CMake can not determine linker language for target: ",
-         target->GetName().c_str());
+         target.GetName().c_str());
       return;
       }
     if(linkLanguage == "C" || linkLanguage == "CXX"
@@ -728,12 +730,12 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
       }
 
     // Add the target-specific flags.
-    this->AddCompileOptions(flags, target, linkLanguage, configName);
+    this->AddCompileOptions(flags, gt, linkLanguage, configName);
     }
 
   if(this->FortranProject)
     {
-    switch(this->GetFortranFormat(target->GetProperty("Fortran_FORMAT")))
+    switch(this->GetFortranFormat(target.GetProperty("Fortran_FORMAT")))
       {
       case FortranFormatFixed: flags += " -fixed"; break;
       case FortranFormatFree: flags += " -free"; break;
@@ -760,7 +762,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
   targetOptions.Parse(defineFlags.c_str());
   targetOptions.ParseFinish();
   std::vector<std::string> targetDefines;
-  target->GetCompileDefinitions(targetDefines, configName, "CXX");
+  gt->GetCompileDefinitions(targetDefines, configName, "CXX");
   targetOptions.AddDefines(targetDefines);
   targetOptions.SetVerboseMakefile(
     this->Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE"));
@@ -772,22 +774,22 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
   targetOptions.AddDefine(configDefine);
 
   // Add the export symbol definition for shared library objects.
-  if(const char* exportMacro = target->GetExportMacro())
+  if(const char* exportMacro = gt->GetExportMacro())
     {
     targetOptions.AddDefine(exportMacro);
     }
 
   // The intermediate directory name consists of a directory for the
   // target and a subdirectory for the configuration name.
-  std::string intermediateDir = this->GetTargetDirectory(target);
+  std::string intermediateDir = this->GetTargetDirectory(gt);
   intermediateDir += "/";
   intermediateDir += configName;
 
-  if (target->Target->GetType() < cmState::UTILITY)
+  if (target.GetType() < cmState::UTILITY)
     {
     std::string const& outDir =
-      target->Target->GetType() == cmState::OBJECT_LIBRARY?
-      intermediateDir : target->GetDirectory(configName);
+      target.GetType() == cmState::OBJECT_LIBRARY?
+      intermediateDir : gt->GetDirectory(configName);
     fout << "\t\t\tOutputDirectory=\""
          << this->ConvertToXMLOutputPathSingle(outDir.c_str()) << "\"\n";
     }
@@ -802,7 +804,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
   if (this->FortranProject)
     {
     // Intel Fortran >= 15.0 uses TargetName property.
-    std::string targetNameFull = target->GetFullName(configName);
+    std::string targetNameFull = gt->GetFullName(configName);
     std::string targetName =
       cmSystemTools::GetFilenameWithoutLastExtension(targetNameFull);
     std::string targetExt =
@@ -837,7 +839,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
   if(this->FortranProject)
     {
     const char* target_mod_dir =
-      target->Target->GetProperty("Fortran_MODULE_DIRECTORY");
+      target.GetProperty("Fortran_MODULE_DIRECTORY");
     std::string modDir;
     if(target_mod_dir)
       {
@@ -856,7 +858,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
   targetOptions.OutputAdditionalOptions(fout, "\t\t\t\t", "\n");
   fout << "\t\t\t\tAdditionalIncludeDirectories=\"";
   std::vector<std::string> includes;
-  this->GetIncludeDirectories(includes, target, "C", configName);
+  this->GetIncludeDirectories(includes, gt, "C", configName);
   std::vector<std::string>::iterator i = includes.begin();
   for(;i != includes.end(); ++i)
     {
@@ -877,10 +879,10 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
   targetOptions.OutputFlagMap(fout, "\t\t\t\t");
   targetOptions.OutputPreprocessorDefinitions(fout, "\t\t\t\t", "\n", "CXX");
   fout << "\t\t\t\tObjectFile=\"$(IntDir)\\\"\n";
-  if(target->Target->GetType() <= cmState::OBJECT_LIBRARY)
+  if(target.GetType() <= cmState::OBJECT_LIBRARY)
     {
     // Specify the compiler program database file if configured.
-    std::string pdb = target->GetCompilePDBPath(configName);
+    std::string pdb = gt->GetCompilePDBPath(configName);
     if(!pdb.empty())
       {
       fout <<  "\t\t\t\tProgramDataBaseFileName=\""
@@ -984,7 +986,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
       "\t\t\t\tName=\"" << manifestTool << "\"";
 
     std::vector<cmSourceFile const*> manifest_srcs;
-    target->GetManifests(manifest_srcs, configName);
+    gt->GetManifests(manifest_srcs, configName);
     if (!manifest_srcs.empty())
       {
       fout << "\n\t\t\t\tAdditionalManifestFiles=\"";
@@ -999,7 +1001,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
 
     // Check if we need the FAT32 workaround.
     // Check the filesystem type where the target will be written.
-    if (cmLVS6G_IsFAT(target->GetDirectory(configName).c_str()))
+    if (cmLVS6G_IsFAT(gt->GetDirectory(configName).c_str()))
       {
       // Add a flag telling the manifest tool to use a workaround
       // for FAT32 file systems, which can cause an empty manifest
@@ -1033,28 +1035,28 @@ cmLocalVisualStudio7Generator
 }
 
 void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
-  const std::string& configName, cmGeneratorTarget* target,
+  const std::string& configName, cmTarget &target,
   const Options& targetOptions)
 {
   cmGlobalVisualStudio7Generator* gg =
     static_cast<cmGlobalVisualStudio7Generator*>(this->GlobalGenerator);
   std::string temp;
   std::string extraLinkOptions;
-  if(target->GetType() == cmState::EXECUTABLE)
+  if(target.GetType() == cmState::EXECUTABLE)
     {
     extraLinkOptions =
       this->Makefile->GetRequiredDefinition("CMAKE_EXE_LINKER_FLAGS")
       + std::string(" ")
       + GetBuildTypeLinkerFlags("CMAKE_EXE_LINKER_FLAGS", configName);
     }
-  if(target->GetType() == cmState::SHARED_LIBRARY)
+  if(target.GetType() == cmState::SHARED_LIBRARY)
     {
     extraLinkOptions =
       this->Makefile->GetRequiredDefinition("CMAKE_SHARED_LINKER_FLAGS")
       + std::string(" ")
       + GetBuildTypeLinkerFlags("CMAKE_SHARED_LINKER_FLAGS", configName);
     }
-  if(target->GetType() == cmState::MODULE_LIBRARY)
+  if(target.GetType() == cmState::MODULE_LIBRARY)
     {
     extraLinkOptions =
       this->Makefile->GetRequiredDefinition("CMAKE_MODULE_LINKER_FLAGS")
@@ -1062,7 +1064,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
       + GetBuildTypeLinkerFlags("CMAKE_MODULE_LINKER_FLAGS", configName);
     }
 
-  const char* targetLinkFlags = target->GetProperty("LINK_FLAGS");
+  const char* targetLinkFlags = target.GetProperty("LINK_FLAGS");
   if(targetLinkFlags)
     {
     extraLinkOptions += " ";
@@ -1071,7 +1073,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
   std::string configTypeUpper = cmSystemTools::UpperCase(configName);
   std::string linkFlagsConfig = "LINK_FLAGS_";
   linkFlagsConfig += configTypeUpper;
-  targetLinkFlags = target->GetProperty(linkFlagsConfig.c_str());
+  targetLinkFlags = target.GetProperty(linkFlagsConfig.c_str());
   if(targetLinkFlags)
     {
     extraLinkOptions += " ";
@@ -1091,26 +1093,28 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
       this->ConvertToOutputFormat(this->ModuleDefinitionFile, SHELL);
     linkOptions.AddFlag("ModuleDefinitionFile", defFile.c_str());
     }
+  cmGeneratorTarget* gt =
+    this->GlobalGenerator->GetGeneratorTarget(&target);
 
-  if (target->GetType() == cmState::SHARED_LIBRARY &&
+  if (target.GetType() == cmState::SHARED_LIBRARY &&
       this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS"))
     {
-    if (target->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
+    if (target.GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
       {
       linkOptions.AddFlag("ModuleDefinitionFile", "$(IntDir)/exportall.def");
       }
     }
-  switch(target->GetType())
+  switch(target.GetType())
     {
     case cmState::UNKNOWN_LIBRARY:
       break;
     case cmState::OBJECT_LIBRARY:
       {
-      std::string libpath = this->GetTargetDirectory(target);
+      std::string libpath = this->GetTargetDirectory(gt);
       libpath += "/";
       libpath += configName;
       libpath += "/";
-      libpath += target->GetName();
+      libpath += target.GetName();
       libpath += ".lib";
       const char* tool =
         this->FortranProject? "VFLibrarianTool":"VCLibrarianTool";
@@ -1122,8 +1126,8 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
       }
     case cmState::STATIC_LIBRARY:
     {
-    std::string targetNameFull = target->GetFullName(configName);
-    std::string libpath = target->GetDirectory(configName);
+    std::string targetNameFull = gt->GetFullName(configName);
+    std::string libpath = gt->GetDirectory(configName);
     libpath += "/";
     libpath += targetNameFull;
     const char* tool = "VCLibrarianTool";
@@ -1138,14 +1142,14 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
         || this->FortranProject)
       {
       std::ostringstream libdeps;
-      this->Internal->OutputObjects(libdeps, target);
+      this->Internal->OutputObjects(libdeps, &target);
       if(!libdeps.str().empty())
         {
         fout << "\t\t\t\tAdditionalDependencies=\"" << libdeps.str() << "\"\n";
         }
       }
     std::string libflags;
-    this->GetStaticLibraryFlags(libflags, configTypeUpper, target);
+    this->GetStaticLibraryFlags(libflags, configTypeUpper, gt);
     if(!libflags.empty())
       {
       fout << "\t\t\t\tAdditionalOptions=\"" << libflags << "\"\n";
@@ -1162,11 +1166,11 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
     std::string targetNameFull;
     std::string targetNameImport;
     std::string targetNamePDB;
-    target->GetLibraryNames(targetName, targetNameSO, targetNameFull,
+    gt->GetLibraryNames(targetName, targetNameSO, targetNameFull,
                            targetNameImport, targetNamePDB, configName);
 
     // Compute the link library and directory information.
-    cmComputeLinkInformation* pcli = target->GetLinkInformation(configName);
+    cmComputeLinkInformation* pcli = gt->GetLinkInformation(configName);
     if(!pcli)
       {
       return;
@@ -1198,22 +1202,22 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
     if(this->GetVersion() < cmGlobalVisualStudioGenerator::VS8
         || this->FortranProject)
       {
-      this->Internal->OutputObjects(fout, target, " ");
+      this->Internal->OutputObjects(fout, &target, " ");
       }
     fout << " ";
     this->Internal->OutputLibraries(fout, cli.GetItems());
     fout << "\"\n";
-    temp = target->GetDirectory(configName);
+    temp = gt->GetDirectory(configName);
     temp += "/";
     temp += targetNameFull;
     fout << "\t\t\t\tOutputFile=\""
          << this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"\n";
-    this->WriteTargetVersionAttribute(fout, target);
+    this->WriteTargetVersionAttribute(fout, gt);
     linkOptions.OutputFlagMap(fout, "\t\t\t\t");
     fout << "\t\t\t\tAdditionalLibraryDirectories=\"";
     this->OutputLibraryDirectories(fout, cli.GetDirectories());
     fout << "\"\n";
-    temp = target->GetPDBDirectory(configName);
+    temp = gt->GetPDBDirectory(configName);
     temp += "/";
     temp += targetNamePDB;
     fout << "\t\t\t\tProgramDatabaseFile=\"" <<
@@ -1241,7 +1245,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
       {
       fout << "\t\t\t\tStackReserveSize=\"" << stackVal  << "\"\n";
       }
-    temp = target->GetDirectory(configName, true);
+    temp = gt->GetDirectory(configName, true);
     temp += "/";
     temp += targetNameImport;
     fout << "\t\t\t\tImportLibrary=\""
@@ -1259,11 +1263,11 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
     std::string targetNameFull;
     std::string targetNameImport;
     std::string targetNamePDB;
-    target->GetExecutableNames(targetName, targetNameFull,
+    gt->GetExecutableNames(targetName, targetNameFull,
                               targetNameImport, targetNamePDB, configName);
 
     // Compute the link library and directory information.
-    cmComputeLinkInformation* pcli = target->GetLinkInformation(configName);
+    cmComputeLinkInformation* pcli = gt->GetLinkInformation(configName);
     if(!pcli)
       {
       return;
@@ -1271,7 +1275,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
     cmComputeLinkInformation& cli = *pcli;
     std::string linkLanguage = cli.GetLinkLanguage();
 
-    bool isWin32Executable = target->GetPropertyAsBool("WIN32_EXECUTABLE");
+    bool isWin32Executable = target.GetPropertyAsBool("WIN32_EXECUTABLE");
 
     // Compute the variable name to lookup standard libraries for this
     // language.
@@ -1297,23 +1301,23 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
     if(this->GetVersion() < cmGlobalVisualStudioGenerator::VS8
         || this->FortranProject)
       {
-      this->Internal->OutputObjects(fout, target, " ");
+      this->Internal->OutputObjects(fout, &target, " ");
       }
     fout << " ";
     this->Internal->OutputLibraries(fout, cli.GetItems());
     fout << "\"\n";
-    temp = target->GetDirectory(configName);
+    temp = gt->GetDirectory(configName);
     temp += "/";
     temp += targetNameFull;
     fout << "\t\t\t\tOutputFile=\""
          << this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"\n";
-    this->WriteTargetVersionAttribute(fout, target);
+    this->WriteTargetVersionAttribute(fout, gt);
     linkOptions.OutputFlagMap(fout, "\t\t\t\t");
     fout << "\t\t\t\tAdditionalLibraryDirectories=\"";
     this->OutputLibraryDirectories(fout, cli.GetDirectories());
     fout << "\"\n";
     std::string path = this->ConvertToXMLOutputPathSingle(
-      target->GetPDBDirectory(configName).c_str());
+      gt->GetPDBDirectory(configName).c_str());
     fout << "\t\t\t\tProgramDatabaseFile=\""
          << path << "/" << targetNamePDB
          << "\"\n";
@@ -1360,7 +1364,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
       {
       fout << "\t\t\t\tStackReserveSize=\"" << stackVal << "\"";
       }
-    temp = target->GetDirectory(configName, true);
+    temp = gt->GetDirectory(configName, true);
     temp += "/";
     temp += targetNameImport;
     fout << "\t\t\t\tImportLibrary=\""
@@ -1411,11 +1415,13 @@ cmLocalVisualStudio7GeneratorInternals
 //----------------------------------------------------------------------------
 void
 cmLocalVisualStudio7GeneratorInternals
-::OutputObjects(std::ostream& fout, cmGeneratorTarget* gt, const char* isep)
+::OutputObjects(std::ostream& fout, cmTarget* t, const char* isep)
 {
   // VS < 8 does not support per-config source locations so we
   // list object library content on the link line instead.
   cmLocalVisualStudio7Generator* lg = this->LocalGenerator;
+  cmGeneratorTarget* gt =
+    lg->GetGlobalGenerator()->GetGeneratorTarget(t);
   std::vector<std::string> objs;
   gt->UseObjectLibraries(objs, "");
   const char* sep = isep? isep : "";
@@ -1472,7 +1478,7 @@ cmLocalVisualStudio7Generator
 
 void cmLocalVisualStudio7Generator::WriteVCProjFile(std::ostream& fout,
                                                     const std::string& libName,
-                                                    cmGeneratorTarget* target)
+                                                    cmTarget &target)
 {
   std::vector<std::string> configs;
   this->Makefile->GetConfigurations(configs);
@@ -1480,10 +1486,13 @@ void cmLocalVisualStudio7Generator::WriteVCProjFile(std::ostream& fout,
   // We may be modifying the source groups temporarily, so make a copy.
   std::vector<cmSourceGroup> sourceGroups = this->Makefile->GetSourceGroups();
 
+  cmGeneratorTarget* gt =
+    this->GlobalGenerator->GetGeneratorTarget(&target);
+
   // get the classes from the source lists then add them to the groups
   this->ModuleDefinitionFile = "";
   std::vector<cmSourceFile*> classes;
-  if (!target->GetConfigCommonSourceFiles(classes))
+  if (!gt->GetConfigCommonSourceFiles(classes))
     {
     return;
     }
@@ -1526,7 +1535,7 @@ void cmLocalVisualStudio7Generator::WriteVCProjFile(std::ostream& fout,
     // VS >= 8 support per-config source locations so we
     // list object library content as external objects.
     std::vector<std::string> objs;
-    target->UseObjectLibraries(objs, "");
+    gt->UseObjectLibraries(objs, "");
     if(!objs.empty())
       {
       // TODO: Separate sub-filter for each object library used?
@@ -1561,7 +1570,7 @@ class cmLocalVisualStudio7GeneratorFCInfo
 {
 public:
   cmLocalVisualStudio7GeneratorFCInfo(cmLocalVisualStudio7Generator* lg,
-                                      cmGeneratorTarget* target,
+                                      cmTarget& target,
                                       cmSourceFile const& sf,
                                       std::vector<std::string> const& configs);
   std::map<std::string, cmLVS7GFileConfig> FileConfigMap;
@@ -1569,10 +1578,12 @@ public:
 
 cmLocalVisualStudio7GeneratorFCInfo
 ::cmLocalVisualStudio7GeneratorFCInfo(cmLocalVisualStudio7Generator* lg,
-                                      cmGeneratorTarget* gt,
+                                      cmTarget& target,
                                       cmSourceFile const& sf,
                                       std::vector<std::string> const& configs)
 {
+  cmGeneratorTarget* gt =
+    lg->GetGlobalGenerator()->GetGeneratorTarget(&target);
   std::string objectName;
   if(gt->HasExplicitObjectName(&sf))
     {
@@ -1689,10 +1700,10 @@ cmLocalVisualStudio7GeneratorFCInfo
 //----------------------------------------------------------------------------
 std::string
 cmLocalVisualStudio7Generator
-::ComputeLongestObjectDirectory(const cmGeneratorTarget *target) const
+::ComputeLongestObjectDirectory(cmTarget& target) const
 {
   std::vector<std::string> configs;
-  target->Target->GetMakefile()->GetConfigurations(configs);
+  target.GetMakefile()->GetConfigurations(configs);
 
   // Compute the maximum length configuration name.
   std::string config_max;
@@ -1711,7 +1722,9 @@ cmLocalVisualStudio7Generator
   std::string dir_max;
   dir_max += this->GetCurrentBinaryDirectory();
   dir_max += "/";
-  dir_max += this->GetTargetDirectory(target);
+  cmGeneratorTarget* gt =
+    this->GlobalGenerator->GetGeneratorTarget(&target);
+  dir_max += this->GetTargetDirectory(gt);
   dir_max += "/";
   dir_max += config_max;
   dir_max += "/";
@@ -1719,7 +1732,7 @@ cmLocalVisualStudio7Generator
 }
 
 bool cmLocalVisualStudio7Generator
-::WriteGroup(const cmSourceGroup *sg, cmGeneratorTarget* target,
+::WriteGroup(const cmSourceGroup *sg, cmTarget& target,
              std::ostream &fout, const std::string& libName,
              std::vector<std::string> const& configs)
 {
@@ -1754,14 +1767,15 @@ bool cmLocalVisualStudio7Generator
     }
 
   // Loop through each source in the source group.
+  std::string objectName;
   for(std::vector<const cmSourceFile *>::const_iterator sf =
         sourceFiles.begin(); sf != sourceFiles.end(); ++sf)
     {
     std::string source = (*sf)->GetFullPath();
     FCInfo fcinfo(this, target, *(*sf), configs);
 
-    if (source != libName || target->GetType() == cmState::UTILITY ||
-      target->GetType() == cmState::GLOBAL_TARGET )
+    if (source != libName || target.GetType() == cmState::UTILITY ||
+      target.GetType() == cmState::GLOBAL_TARGET )
       {
       fout << "\t\t\t<File\n";
       std::string d = this->ConvertToXMLOutputPathSingle(source.c_str());
@@ -2008,10 +2022,10 @@ void cmLocalVisualStudio7Generator::WriteVCProjEndGroup(std::ostream& fout)
 void cmLocalVisualStudio7Generator
 ::OutputTargetRules(std::ostream& fout,
                     const std::string& configName,
-                    cmGeneratorTarget *target,
+                    cmTarget &target,
                     const std::string& /*libName*/)
 {
-  if (target->GetType() > cmState::GLOBAL_TARGET)
+  if (target.GetType() > cmState::GLOBAL_TARGET)
     {
     return;
     }
@@ -2021,35 +2035,36 @@ void cmLocalVisualStudio7Generator
   const char* tool =
     this->FortranProject? "VFPreBuildEventTool":"VCPreBuildEventTool";
   event.Start(tool);
-  event.Write(target->Target->GetPreBuildCommands());
+  event.Write(target.GetPreBuildCommands());
   event.Finish();
 
   // Add pre-link event.
   tool = this->FortranProject? "VFPreLinkEventTool":"VCPreLinkEventTool";
   event.Start(tool);
   bool addedPrelink = false;
-  if (target->GetType() == cmState::SHARED_LIBRARY &&
+  if (target.GetType() == cmState::SHARED_LIBRARY &&
       this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS"))
     {
-    if (target->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
+    if (target.GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
       {
       addedPrelink = true;
       std::vector<cmCustomCommand> commands =
-        target->Target->GetPreLinkCommands();
+        target.GetPreLinkCommands();
       cmGlobalVisualStudioGenerator* gg
         = static_cast<cmGlobalVisualStudioGenerator*>(this->GlobalGenerator);
+      cmGeneratorTarget* gt =
+        this->GlobalGenerator->GetGeneratorTarget(&target);
       gg->AddSymbolExportCommand(
-        target, commands, configName);
+        gt, commands, configName);
       event.Write(commands);
       }
     }
   if (!addedPrelink)
     {
-    event.Write(target->Target->GetPreLinkCommands());
+    event.Write(target.GetPreLinkCommands());
     }
   cmsys::auto_ptr<cmCustomCommand> pcc(
-    this->MaybeCreateImplibDir(target,
-                               configName, this->FortranProject));
+    this->MaybeCreateImplibDir(target, configName, this->FortranProject));
   if(pcc.get())
     {
     event.Write(*pcc);
@@ -2059,18 +2074,18 @@ void cmLocalVisualStudio7Generator
   // Add post-build event.
   tool = this->FortranProject? "VFPostBuildEventTool":"VCPostBuildEventTool";
   event.Start(tool);
-  event.Write(target->Target->GetPostBuildCommands());
+  event.Write(target.GetPostBuildCommands());
   event.Finish();
 }
 
 void cmLocalVisualStudio7Generator::WriteProjectSCC(std::ostream& fout,
-                                                    cmGeneratorTarget* target)
+                                                    cmTarget& target)
 {
   // if we have all the required Source code control tags
   // then add that to the project
-  const char* vsProjectname = target->GetProperty("VS_SCC_PROJECTNAME");
-  const char* vsLocalpath = target->GetProperty("VS_SCC_LOCALPATH");
-  const char* vsProvider = target->GetProperty("VS_SCC_PROVIDER");
+  const char* vsProjectname = target.GetProperty("VS_SCC_PROJECTNAME");
+  const char* vsLocalpath = target.GetProperty("VS_SCC_LOCALPATH");
+  const char* vsProvider = target.GetProperty("VS_SCC_PROVIDER");
 
   if(vsProvider && vsLocalpath && vsProjectname)
     {
@@ -2078,7 +2093,7 @@ void cmLocalVisualStudio7Generator::WriteProjectSCC(std::ostream& fout,
          << "\tSccLocalPath=\"" << vsLocalpath << "\"\n"
          << "\tSccProvider=\"" << vsProvider << "\"\n";
 
-    const char* vsAuxPath = target->GetProperty("VS_SCC_AUXPATH");
+    const char* vsAuxPath = target.GetProperty("VS_SCC_AUXPATH");
     if(vsAuxPath)
       {
       fout << "\tSccAuxPath=\"" << vsAuxPath << "\"\n";
@@ -2090,7 +2105,7 @@ void
 cmLocalVisualStudio7Generator
 ::WriteProjectStartFortran(std::ostream& fout,
                            const std::string& libName,
-                           cmGeneratorTarget *target)
+                           cmTarget & target)
 {
 
   cmGlobalVisualStudio7Generator* gg =
@@ -2100,13 +2115,13 @@ cmLocalVisualStudio7Generator
        << "<VisualStudioProject\n"
        << "\tProjectCreator=\"Intel Fortran\"\n"
        << "\tVersion=\"" << gg->GetIntelProjectVersion() << "\"\n";
-  const char* keyword = target->GetProperty("VS_KEYWORD");
+  const char* keyword = target.GetProperty("VS_KEYWORD");
   if(!keyword)
     {
     keyword = "Console Application";
     }
   const char* projectType = 0;
-  switch(target->GetType())
+  switch(target.GetType())
     {
     case cmState::STATIC_LIBRARY:
       projectType = "typeStaticLibrary";
@@ -2151,7 +2166,7 @@ cmLocalVisualStudio7Generator
 void
 cmLocalVisualStudio7Generator::WriteProjectStart(std::ostream& fout,
                                                  const std::string& libName,
-                                                 cmGeneratorTarget *target,
+                                                 cmTarget & target,
                                                  std::vector<cmSourceGroup> &)
 {
   if(this->FortranProject)
@@ -2175,12 +2190,12 @@ cmLocalVisualStudio7Generator::WriteProjectStart(std::ostream& fout,
     {
     fout <<  "\tVersion=\"" << (gg->GetVersion()/10) << ".00\"\n";
     }
-  const char* projLabel = target->GetProperty("PROJECT_LABEL");
+  const char* projLabel = target.GetProperty("PROJECT_LABEL");
   if(!projLabel)
     {
     projLabel = libName.c_str();
     }
-  const char* keyword = target->GetProperty("VS_KEYWORD");
+  const char* keyword = target.GetProperty("VS_KEYWORD");
   if(!keyword)
     {
     keyword = "Win32Proj";
@@ -2192,7 +2207,7 @@ cmLocalVisualStudio7Generator::WriteProjectStart(std::ostream& fout,
     }
   this->WriteProjectSCC(fout, target);
   if(const char* targetFrameworkVersion =
-     target->GetProperty("VS_DOTNET_TARGET_FRAMEWORK_VERSION"))
+     target.GetProperty("VS_DOTNET_TARGET_FRAMEWORK_VERSION"))
     {
     fout << "\tTargetFrameworkVersion=\"" << targetFrameworkVersion << "\"\n";
     }
@@ -2213,13 +2228,12 @@ cmLocalVisualStudio7Generator::WriteProjectStart(std::ostream& fout,
 }
 
 
-void cmLocalVisualStudio7Generator::WriteVCProjFooter(
-    std::ostream& fout,
-    cmGeneratorTarget *target)
+void cmLocalVisualStudio7Generator::WriteVCProjFooter(std::ostream& fout,
+                                                      cmTarget &target)
 {
   fout << "\t<Globals>\n";
 
-  cmPropertyMap const& props = target->Target->GetProperties();
+  cmPropertyMap const& props = target.GetProperties();
   for(cmPropertyMap::const_iterator i = props.begin(); i != props.end(); ++i)
     {
     if(i->first.find("VS_GLOBAL_") == 0)
diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h
index b282098..16cf004 100644
--- a/Source/cmLocalVisualStudio7Generator.h
+++ b/Source/cmLocalVisualStudio7Generator.h
@@ -15,6 +15,7 @@
 #include "cmLocalVisualStudioGenerator.h"
 #include "cmVisualStudioGeneratorOptions.h"
 
+class cmTarget;
 class cmSourceFile;
 class cmCustomCommand;
 class cmSourceGroup;
@@ -56,15 +57,13 @@ public:
   std::string GetTargetDirectory(cmGeneratorTarget const* target) const;
   cmSourceFile* CreateVCProjBuildRule();
   void WriteStampFiles();
-  virtual std::string ComputeLongestObjectDirectory(
-      cmGeneratorTarget const*) const;
+  virtual std::string ComputeLongestObjectDirectory(cmTarget&) const;
 
   virtual void ReadAndStoreExternalGUID(const std::string& name,
                                         const char* path);
   virtual void AddCMakeListsRules();
 protected:
-  void CreateSingleVCProj(const std::string& lname,
-                          cmGeneratorTarget *tgt);
+  void CreateSingleVCProj(const std::string& lname, cmTarget &tgt);
 private:
   typedef cmVisualStudioGeneratorOptions Options;
   typedef cmLocalVisualStudio7GeneratorFCInfo FCInfo;
@@ -73,33 +72,30 @@ private:
   void FixGlobalTargets();
   void WriteProjectFiles();
   void WriteVCProjHeader(std::ostream& fout, const std::string& libName,
-                         cmGeneratorTarget* tgt,
-                         std::vector<cmSourceGroup> &sgs);
-  void WriteVCProjFooter(std::ostream& fout, cmGeneratorTarget* target);
+                         cmTarget &tgt, std::vector<cmSourceGroup> &sgs);
+  void WriteVCProjFooter(std::ostream& fout, cmTarget &target);
   void WriteVCProjFile(std::ostream& fout, const std::string& libName,
-                       cmGeneratorTarget* tgt);
+                       cmTarget &tgt);
   void WriteConfigurations(std::ostream& fout,
                            std::vector<std::string> const& configs,
-                           const std::string& libName, cmGeneratorTarget* tgt);
+                           const std::string& libName, cmTarget &tgt);
   void WriteConfiguration(std::ostream& fout,
                           const std::string& configName,
-                          const std::string& libName, cmGeneratorTarget* tgt);
+                          const std::string& libName, cmTarget &tgt);
   std::string EscapeForXML(const std::string& s);
   std::string ConvertToXMLOutputPath(const char* path);
   std::string ConvertToXMLOutputPathSingle(const char* path);
   void OutputTargetRules(std::ostream& fout, const std::string& configName,
-                         cmGeneratorTarget* target,
-                         const std::string& libName);
+                         cmTarget &target, const std::string& libName);
   void OutputBuildTool(std::ostream& fout, const std::string& configName,
-                       cmGeneratorTarget* t, const Options& targetOptions);
+                       cmTarget& t, const Options& targetOptions);
   void OutputLibraryDirectories(std::ostream& fout,
                                 std::vector<std::string> const& dirs);
-  void WriteProjectSCC(std::ostream& fout, cmGeneratorTarget *target);
+  void WriteProjectSCC(std::ostream& fout, cmTarget& target);
   void WriteProjectStart(std::ostream& fout, const std::string& libName,
-                         cmGeneratorTarget* tgt,
-                         std::vector<cmSourceGroup> &sgs);
+                         cmTarget &tgt, std::vector<cmSourceGroup> &sgs);
   void WriteProjectStartFortran(std::ostream& fout, const std::string& libName,
-                                cmGeneratorTarget* tgt);
+                                cmTarget &tgt);
   void WriteVCProjBeginGroup(std::ostream& fout,
                           const char* group,
                           const char* filter);
@@ -114,7 +110,7 @@ private:
                                    cmGeneratorTarget* gt);
 
   bool WriteGroup(const cmSourceGroup *sg,
-                  cmGeneratorTarget* target, std::ostream &fout,
+                  cmTarget& target, std::ostream &fout,
                   const std::string& libName,
                   std::vector<std::string> const& configs);
 
diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx
index f0be658..2f44fb7 100644
--- a/Source/cmLocalVisualStudioGenerator.cxx
+++ b/Source/cmLocalVisualStudioGenerator.cxx
@@ -43,7 +43,7 @@ void cmLocalVisualStudioGenerator::ComputeObjectFilenames(
                         std::map<cmSourceFile const*, std::string>& mapping,
                         cmGeneratorTarget const* gt)
 {
-  std::string dir_max = this->ComputeLongestObjectDirectory(gt);
+  std::string dir_max = this->ComputeLongestObjectDirectory(*gt->Target);
 
   // Count the number of object files with each name.  Note that
   // windows file names are not case sensitive.
@@ -80,7 +80,7 @@ void cmLocalVisualStudioGenerator::ComputeObjectFilenames(
 
 //----------------------------------------------------------------------------
 cmsys::auto_ptr<cmCustomCommand>
-cmLocalVisualStudioGenerator::MaybeCreateImplibDir(cmGeneratorTarget *target,
+cmLocalVisualStudioGenerator::MaybeCreateImplibDir(cmTarget& target,
                                                    const std::string& config,
                                                    bool isFortran)
 {
@@ -89,11 +89,13 @@ cmLocalVisualStudioGenerator::MaybeCreateImplibDir(cmGeneratorTarget *target,
   // If an executable exports symbols then VS wants to create an
   // import library but forgets to create the output directory.
   // The Intel Fortran plugin always forgets to the directory.
-  if(target->GetType() != cmState::EXECUTABLE &&
-     !(isFortran && target->GetType() == cmState::SHARED_LIBRARY))
+  if(target.GetType() != cmState::EXECUTABLE &&
+     !(isFortran && target.GetType() == cmState::SHARED_LIBRARY))
     { return pcc; }
-  std::string outDir = target->GetDirectory(config, false);
-  std::string impDir = target->GetDirectory(config, true);
+  cmGeneratorTarget* gt =
+      this->GetGlobalGenerator()->GetGeneratorTarget(&target);
+  std::string outDir = gt->GetDirectory(config, false);
+  std::string impDir = gt->GetDirectory(config, true);
   if(impDir == outDir) { return pcc; }
 
   // Add a pre-build event to create the directory.
diff --git a/Source/cmLocalVisualStudioGenerator.h b/Source/cmLocalVisualStudioGenerator.h
index 21071e6..071bfb3 100644
--- a/Source/cmLocalVisualStudioGenerator.h
+++ b/Source/cmLocalVisualStudioGenerator.h
@@ -44,8 +44,7 @@ public:
 
   cmGlobalVisualStudioGenerator::VSVersion GetVersion() const;
 
-  virtual std::string ComputeLongestObjectDirectory(
-      cmGeneratorTarget const*) const = 0;
+  virtual std::string ComputeLongestObjectDirectory(cmTarget&) const = 0;
 
   virtual void AddCMakeListsRules() = 0;
 
@@ -59,7 +58,7 @@ protected:
 
   /** Construct a custom command to make exe import lib dir.  */
   cmsys::auto_ptr<cmCustomCommand>
-  MaybeCreateImplibDir(cmGeneratorTarget* target, const std::string& config,
+  MaybeCreateImplibDir(cmTarget& target, const std::string& config,
                        bool isFortran);
 };
 
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 9c9f5ab..f4c632d 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -13,6 +13,7 @@
 #include "cmVisualStudio10TargetGenerator.h"
 #include "cmGlobalVisualStudio10Generator.h"
 #include "cmGeneratorTarget.h"
+#include "cmTarget.h"
 #include "cmComputeLinkInformation.h"
 #include "cmGeneratedFileStream.h"
 #include "cmMakefile.h"
@@ -166,12 +167,13 @@ static std::string cmVS10EscapeComment(std::string comment)
 }
 
 cmVisualStudio10TargetGenerator::
-cmVisualStudio10TargetGenerator(cmGeneratorTarget* target,
+cmVisualStudio10TargetGenerator(cmTarget* target,
                                 cmGlobalVisualStudio10Generator* gg)
 {
   this->GlobalGenerator = gg;
-  this->GeneratorTarget = target;
-  this->Makefile = target->Target->GetMakefile();
+  this->Target = target;
+  this->GeneratorTarget = gg->GetGeneratorTarget(target);
+  this->Makefile = target->GetMakefile();
   this->Makefile->GetConfigurations(this->Configurations);
   this->LocalGenerator =
     (cmLocalVisualStudio7Generator*)
@@ -273,9 +275,8 @@ void cmVisualStudio10TargetGenerator::Generate()
     return;
     }
   // Tell the global generator the name of the project file
-  this->GeneratorTarget->Target
-      ->SetProperty("GENERATOR_FILE_NAME",this->Name.c_str());
-  this->GeneratorTarget->Target->SetProperty("GENERATOR_FILE_NAME_EXT",
+  this->Target->SetProperty("GENERATOR_FILE_NAME",this->Name.c_str());
+  this->Target->SetProperty("GENERATOR_FILE_NAME_EXT",
                             ".vcxproj");
   if(this->GeneratorTarget->GetType() <= cmState::OBJECT_LIBRARY)
     {
@@ -731,8 +732,7 @@ void cmVisualStudio10TargetGenerator
   cmGlobalVisualStudio10Generator* gg =
     static_cast<cmGlobalVisualStudio10Generator*>(this->GlobalGenerator);
   const char* mfcFlag =
-    this->GeneratorTarget->
-      Target->GetMakefile()->GetDefinition("CMAKE_MFC_FLAG");
+    this->Target->GetMakefile()->GetDefinition("CMAKE_MFC_FLAG");
   std::string mfcFlagValue = mfcFlag ? mfcFlag : "0";
 
   std::string useOfMfcValue = "false";
@@ -1462,8 +1462,7 @@ void cmVisualStudio10TargetGenerator::WriteSource(
       }
     else
       {
-      this->GlobalGenerator->PathTooLong(this->GeneratorTarget,
-                                         sf, sourceRel);
+      this->GlobalGenerator->PathTooLong(this->Target, sf, sourceRel);
       }
     }
   this->ConvertToWindowsSlash(sourceFile);
@@ -1916,12 +1915,12 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
     std::string baseFlagVar = "CMAKE_";
     baseFlagVar += linkLanguage;
     baseFlagVar += "_FLAGS";
-    flags = this->GeneratorTarget->
+    flags = this->
       Target->GetMakefile()->GetRequiredDefinition(baseFlagVar.c_str());
     std::string flagVar = baseFlagVar + std::string("_") +
       cmSystemTools::UpperCase(configName);
     flags += " ";
-    flags += this->GeneratorTarget->
+    flags += this->
       Target->GetMakefile()->GetRequiredDefinition(flagVar.c_str());
     }
   // set the correct language
@@ -1937,8 +1936,7 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
                                           linkLanguage, configName.c_str());
 
   // Get preprocessor definitions for this directory.
-  std::string defineFlags =
-      this->GeneratorTarget->Target->GetMakefile()->GetDefineFlags();
+  std::string defineFlags = this->Target->GetMakefile()->GetDefineFlags();
   if(this->MSTools)
     {
     clOptions.FixExceptionHandlingDefault();
@@ -2442,11 +2440,11 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
   linkFlagVarBase += linkType;
   linkFlagVarBase += "_LINKER_FLAGS";
   flags += " ";
-  flags += this->GeneratorTarget->
+  flags += this->
     Target->GetMakefile()->GetRequiredDefinition(linkFlagVarBase.c_str());
   std::string linkFlagVar = linkFlagVarBase + "_" + CONFIG;
   flags += " ";
-  flags += this->GeneratorTarget->
+  flags += this->
     Target->GetMakefile()->GetRequiredDefinition(linkFlagVar.c_str());
   const char* targetLinkFlags =
       this->GeneratorTarget->GetProperty("LINK_FLAGS");
@@ -2676,8 +2674,7 @@ cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const& config)
   linkOptions.OutputFlagMap(*this->BuildFileStream, "      ");
 
   this->WriteString("</Link>\n", 2);
-  if(!this->GlobalGenerator->NeedLinkLibraryDependencies(
-              this->GeneratorTarget))
+  if(!this->GlobalGenerator->NeedLinkLibraryDependencies(*this->Target))
     {
     this->WriteString("<ProjectReference>\n", 2);
     this->WriteString(
@@ -2814,7 +2811,7 @@ cmVisualStudio10TargetGenerator::WriteEvents(std::string const& configName)
       {
       addedPrelink = true;
       std::vector<cmCustomCommand> commands =
-        this->GeneratorTarget->Target->GetPreLinkCommands();
+        this->Target->GetPreLinkCommands();
       this->GlobalGenerator->AddSymbolExportCommand(
         this->GeneratorTarget, commands, configName);
       this->WriteEvent("PreLinkEvent", commands, configName);
@@ -2823,12 +2820,12 @@ cmVisualStudio10TargetGenerator::WriteEvents(std::string const& configName)
   if (!addedPrelink)
     {
     this->WriteEvent("PreLinkEvent",
-        this->GeneratorTarget->Target->GetPreLinkCommands(), configName);
+                     this->Target->GetPreLinkCommands(), configName);
     }
   this->WriteEvent("PreBuildEvent",
-        this->GeneratorTarget->Target->GetPreBuildCommands(), configName);
+                   this->Target->GetPreBuildCommands(), configName);
   this->WriteEvent("PostBuildEvent",
-        this->GeneratorTarget->Target->GetPostBuildCommands(), configName);
+                   this->Target->GetPostBuildCommands(), configName);
 }
 
 void cmVisualStudio10TargetGenerator::WriteEvent(
@@ -2878,7 +2875,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences()
   for( OrderedTargetDependSet::const_iterator i = depends.begin();
        i != depends.end(); ++i)
     {
-    cmGeneratorTarget const* dt = *i;
+    cmTarget const* dt = (*i)->Target;
     if(dt->GetType() == cmState::INTERFACE_LIBRARY)
       {
       continue;
@@ -2886,12 +2883,12 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences()
     // skip fortran targets as they can not be processed by MSBuild
     // the only reference will be in the .sln file
     if(static_cast<cmGlobalVisualStudioGenerator*>(this->GlobalGenerator)
-       ->TargetIsFortranOnly(dt))
+       ->TargetIsFortranOnly(*dt))
       {
       continue;
       }
     this->WriteString("<ProjectReference Include=\"", 2);
-    cmLocalGenerator* lg = dt->GetLocalGenerator();
+    cmMakefile* mf = dt->GetMakefile();
     std::string name = dt->GetName();
     std::string path;
     const char* p = dt->GetProperty("EXTERNAL_MSPROJECT");
@@ -2901,7 +2898,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences()
       }
     else
       {
-      path =  lg->GetCurrentBinaryDirectory();
+      path =  mf->GetCurrentBinaryDirectory();
       path += "/";
       path += dt->GetName();
       path += ".vcxproj";
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 044e0dd..15ed9f2 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -13,6 +13,7 @@
 #define cmVisualStudioTargetGenerator_h
 #include "cmStandardIncludes.h"
 
+class cmTarget;
 class cmMakefile;
 class cmGeneratorTarget;
 class cmGeneratedFileStream;
@@ -28,7 +29,7 @@ struct cmIDEFlagTable;
 class cmVisualStudio10TargetGenerator
 {
 public:
-  cmVisualStudio10TargetGenerator(cmGeneratorTarget* target,
+  cmVisualStudio10TargetGenerator(cmTarget* target,
                                   cmGlobalVisualStudio10Generator* gg);
   ~cmVisualStudio10TargetGenerator();
   void Generate();
@@ -147,6 +148,7 @@ private:
   OptionsMap LinkOptions;
   std::string PathToVcxproj;
   std::vector<std::string> Configurations;
+  cmTarget* Target;
   cmGeneratorTarget* GeneratorTarget;
   cmMakefile* Makefile;
   std::string Platform;

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

Summary of changes:
 Source/cmGlobalVisualStudio10Generator.cxx |   12 +-
 Source/cmGlobalVisualStudio10Generator.h   |    4 +-
 Source/cmGlobalVisualStudio6Generator.cxx  |    9 +-
 Source/cmGlobalVisualStudio6Generator.h    |    2 +-
 Source/cmGlobalVisualStudio71Generator.cxx |   12 +-
 Source/cmGlobalVisualStudio71Generator.h   |    4 +-
 Source/cmGlobalVisualStudio7Generator.cxx  |   38 ++---
 Source/cmGlobalVisualStudio7Generator.h    |    9 +-
 Source/cmGlobalVisualStudio8Generator.cxx  |   14 +-
 Source/cmGlobalVisualStudio8Generator.h    |    5 +-
 Source/cmGlobalVisualStudioGenerator.cxx   |   84 +++++------
 Source/cmGlobalVisualStudioGenerator.h     |   32 ++---
 Source/cmLocalVisualStudio10Generator.cxx  |    6 +-
 Source/cmLocalVisualStudio6Generator.cxx   |    4 +-
 Source/cmLocalVisualStudio6Generator.h     |    3 +-
 Source/cmLocalVisualStudio7Generator.cxx   |  210 +++++++++++++++-------------
 Source/cmLocalVisualStudio7Generator.h     |   32 ++---
 Source/cmLocalVisualStudioGenerator.cxx    |   14 +-
 Source/cmLocalVisualStudioGenerator.h      |    5 +-
 Source/cmVisualStudio10TargetGenerator.cxx |   49 +++----
 Source/cmVisualStudio10TargetGenerator.h   |    4 +-
 21 files changed, 277 insertions(+), 275 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list