[Cmake-commits] CMake branch, next, updated. v3.4.0-rc1-614-g5783be8

Stephen Kelly steveire at gmail.com
Fri Oct 16 14:28:21 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  5783be81b2b18d82eb95b9b2a39b2acd83704634 (commit)
       via  68e446bf9b8e6471c947e6c464c910468ba7aa69 (commit)
       via  5b5b3c2c19e0d56ddab120c469aa416f41bf20fa (commit)
       via  29ec1367612e788f6750a51bfbe94b0766769daf (commit)
       via  d29f1acf72cb068ac05f4876c20e3559f232f4f1 (commit)
       via  f170c3b04e279ea0fa86869512e4b3f3d27cf620 (commit)
       via  ed09f3b292bee34e8b30204c93ef5596a3124d00 (commit)
       via  beff29f0d4bf1ffface0e6833f29f2f04ceccf0b (commit)
       via  12e4790a0b40d8176940f855f7f6c9cfe6c39f9f (commit)
       via  14272277205ac7927a4c13b628ce411538f7b17c (commit)
       via  8f363d6771dfa792d606978e1e406229637078f6 (commit)
       via  5794dbc301ace0041c5fc50096cc5331e8ba3c34 (commit)
       via  a892b285f8c621ba50f45f5c4218980c911fd1b6 (commit)
       via  cb8c728f17a61732064280ddb98203cb277e5a3c (commit)
       via  fb4fca0b5efabdf061bd256ed9d35edae6f42b9d (commit)
       via  50fb2ad6463c500fde44c000c777aa3ac1cffc7e (commit)
       via  d233030f5bcfe2509b82433f7df6383cd301e34e (commit)
       via  0ebe2bbf4ae7f19b10f8374313b2bbd6fcd6c3da (commit)
       via  60bd9f9c92faae368fab1c44cf81b489c6a875cb (commit)
       via  82a6eaf4d0381f0e3236dbd067fe853653bbe6b5 (commit)
       via  8aaed08696a7444b80b6319e2b5af320ee589658 (commit)
       via  393654bf49f2c8d86e9ec88fc3c8322497432aea (commit)
      from  4075372122dbdd3f6a22cf1d51628df0e92a2bbd (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=5783be81b2b18d82eb95b9b2a39b2acd83704634
commit 5783be81b2b18d82eb95b9b2a39b2acd83704634
Merge: 4075372 68e446b
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 16 14:28:18 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Oct 16 14:28:18 2015 -0400

    Merge topic 'use-generator-target' into next
    
    68e446bf cmLocalGenerator: Port PList handling to cmGeneratorTarget.
    5b5b3c2c cmLocalGenerator: Port policy handling to cmGeneratorTarget.
    29ec1367 cmLocalGenerator: Port some API to cmGeneratorTarget.
    d29f1acf Use cmGeneratorTarget for property access.
    f170c3b0 Use GetName from cmGeneratorTarget.
    ed09f3b2 Use IsImported from cmGeneratorTarget.
    beff29f0 cmGeneratorTarget: Move ComputeVersionedName from cmTarget.
    12e4790a cmGeneratorTarget: Move GetTargetVersion from cmTarget.
    14272277 cmGeneratorTarget: Move CheckCMP0004 from cmTarget.
    8f363d67 cmGeneratorTarget: Move ImportInfo from cmTarget.
    5794dbc3 cmTarget: Inline the essential part of imported target location.
    a892b285 cmGeneratorTarget: Move ImportedGetLocation from cmTarget.
    cb8c728f cmGeneratorTarget: Move GetFullNameImported from cmTarget.
    fb4fca0b cmGeneratorTarget: Access global state through LocalGenerator.
    50fb2ad6 cmGeneratorTarget: Port Utility items to cmGeneratorTarget.
    d233030f cmGeneratorTarget: Port implementation to cmGeneratorTarget.
    ...


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=68e446bf9b8e6471c947e6c464c910468ba7aa69
commit 68e446bf9b8e6471c947e6c464c910468ba7aa69
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 9 22:31:05 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Oct 16 20:24:45 2015 +0200

    cmLocalGenerator: Port PList handling to cmGeneratorTarget.

diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 60aff64..9d5dd8e 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -3012,7 +3012,7 @@ bool cmLocalGenerator::CheckDefinition(std::string const& define) const
 }
 
 //----------------------------------------------------------------------------
-static void cmLGInfoProp(cmMakefile* mf, cmTarget* target,
+static void cmLGInfoProp(cmMakefile* mf, cmGeneratorTarget* target,
     const std::string& prop)
 {
   if(const char* val = target->GetProperty(prop))
@@ -3022,7 +3022,7 @@ static void cmLGInfoProp(cmMakefile* mf, cmTarget* target,
 }
 
 //----------------------------------------------------------------------------
-void cmLocalGenerator::GenerateAppleInfoPList(cmTarget* target,
+void cmLocalGenerator::GenerateAppleInfoPList(cmGeneratorTarget* target,
                                               const std::string& targetName,
                                               const char* fname)
 {
@@ -3066,7 +3066,7 @@ void cmLocalGenerator::GenerateAppleInfoPList(cmTarget* target,
 }
 
 //----------------------------------------------------------------------------
-void cmLocalGenerator::GenerateFrameworkInfoPList(cmTarget* target,
+void cmLocalGenerator::GenerateFrameworkInfoPList(cmGeneratorTarget* target,
                                                 const std::string& targetName,
                                                 const char* fname)
 {
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 5d2a349..2bc0e4a 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -279,13 +279,14 @@ public:
   /**
    * Generate a Mac OS X application bundle Info.plist file.
    */
-  void GenerateAppleInfoPList(cmTarget* target, const std::string& targetName,
+  void GenerateAppleInfoPList(cmGeneratorTarget* target,
+                              const std::string& targetName,
                               const char* fname);
 
   /**
    * Generate a Mac OS X framework Info.plist file.
    */
-  void GenerateFrameworkInfoPList(cmTarget* target,
+  void GenerateFrameworkInfoPList(cmGeneratorTarget* target,
                                   const std::string& targetName,
                                   const char* fname);
   /** Construct a comment for a custom command.  */
diff --git a/Source/cmOSXBundleGenerator.cxx b/Source/cmOSXBundleGenerator.cxx
index 4fe99e3..490759f 100644
--- a/Source/cmOSXBundleGenerator.cxx
+++ b/Source/cmOSXBundleGenerator.cxx
@@ -59,7 +59,7 @@ void cmOSXBundleGenerator::CreateAppBundle(const std::string& targetName,
   plist += "/";
   plist += this->GT->GetAppBundleDirectory(this->ConfigName, true);
   plist += "/Info.plist";
-  this->LocalGenerator->GenerateAppleInfoPList(this->GT->Target,
+  this->LocalGenerator->GenerateAppleInfoPList(this->GT,
                                                targetName,
                                                plist.c_str());
   this->Makefile->AddCMakeOutputFile(plist);
@@ -90,7 +90,7 @@ void cmOSXBundleGenerator::CreateFramework(
   std::string plist = newoutpath;
   plist += "/Resources/Info.plist";
   std::string name = cmSystemTools::GetFilenameName(targetName);
-  this->LocalGenerator->GenerateFrameworkInfoPList(this->GT->Target,
+  this->LocalGenerator->GenerateFrameworkInfoPList(this->GT,
                                                    name,
                                                    plist.c_str());
 
@@ -182,7 +182,7 @@ void cmOSXBundleGenerator::CreateCFBundle(const std::string& targetName,
     this->GT->GetCFBundleDirectory(this->ConfigName, true);
   plist += "/Info.plist";
   std::string name = cmSystemTools::GetFilenameName(targetName);
-  this->LocalGenerator->GenerateAppleInfoPList(this->GT->Target,
+  this->LocalGenerator->GenerateAppleInfoPList(this->GT,
                                                name,
                                                plist.c_str());
   this->Makefile->AddCMakeOutputFile(plist);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5b5b3c2c19e0d56ddab120c469aa416f41bf20fa
commit 5b5b3c2c19e0d56ddab120c469aa416f41bf20fa
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 9 22:29:17 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Oct 16 20:24:45 2015 +0200

    cmLocalGenerator: Port policy handling to cmGeneratorTarget.

diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index d830e26..60aff64 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2129,7 +2129,7 @@ void cmLocalGenerator
     }
 
   if (!warnCMP0063.empty() &&
-      this->WarnCMP0063.insert(target->Target).second)
+      this->WarnCMP0063.insert(target).second)
     {
     std::ostringstream w;
     w <<
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 749a93d..5d2a349 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -369,7 +369,7 @@ protected:
   std::string::size_type ObjectPathMax;
   std::set<std::string> ObjectMaxPathViolations;
 
-  std::set<cmTarget const*> WarnCMP0063;
+  std::set<cmGeneratorTarget const*> WarnCMP0063;
   cmGeneratorTargetsType GeneratorTargets;
 
   bool EmitUniversalBinaryFlags;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=29ec1367612e788f6750a51bfbe94b0766769daf
commit 29ec1367612e788f6750a51bfbe94b0766769daf
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 9 22:19:57 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Oct 16 20:24:45 2015 +0200

    cmLocalGenerator: Port some API to cmGeneratorTarget.

diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index a197f88..41af89b 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -316,10 +316,11 @@ std::string cmCommonTargetGenerator::GetFlags(const std::string &l)
       this->AddFortranFlags(flags);
       }
 
-    this->LocalGenerator->AddCMP0018Flags(flags, this->Target,
+    this->LocalGenerator->AddCMP0018Flags(flags, this->GeneratorTarget,
                                           lang, this->ConfigName);
 
-    this->LocalGenerator->AddVisibilityPresetFlags(flags, this->Target,
+    this->LocalGenerator->AddVisibilityPresetFlags(flags,
+                                                   this->GeneratorTarget,
                                                    lang);
 
     // Append old-style preprocessor definition flags.
@@ -331,7 +332,7 @@ std::string cmCommonTargetGenerator::GetFlags(const std::string &l)
       AppendFlags(flags,this->GetFrameworkFlags(l));
 
     // Add target-specific flags.
-    this->LocalGenerator->AddCompileOptions(flags, this->Target,
+    this->LocalGenerator->AddCompileOptions(flags, this->GeneratorTarget,
                                             lang, this->ConfigName);
 
     ByLanguageMap::value_type entry(l, flags);
@@ -354,7 +355,7 @@ std::string cmCommonTargetGenerator::GetDefines(const std::string &l)
       }
 
     // Add preprocessor definitions for this target and configuration.
-    this->LocalGenerator->AddCompileDefinitions(defines, this->Target,
+    this->LocalGenerator->AddCompileDefinitions(defines, this->GeneratorTarget,
                             this->LocalGenerator->GetConfigName(), l);
 
     std::string definesString;
diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx
index d1599c4..a6b14ba 100644
--- a/Source/cmExtraSublimeTextGenerator.cxx
+++ b/Source/cmExtraSublimeTextGenerator.cxx
@@ -388,7 +388,7 @@ cmExtraSublimeTextGenerator::ComputeFlagsForObject(cmSourceFile* source,
   //   }
 
   // Add shared-library flags if needed.
-  lg->AddCMP0018Flags(flags, gtgt->Target, language, config);
+  lg->AddCMP0018Flags(flags, gtgt, language, config);
 
   // Add include directory flags.
   {
@@ -403,7 +403,7 @@ cmExtraSublimeTextGenerator::ComputeFlagsForObject(cmSourceFile* source,
   lg->AppendFlags(flags, makefile->GetDefineFlags());
 
   // Add target-specific flags.
-  lg->AddCompileOptions(flags, gtgt->Target, language, config);
+  lg->AddCompileOptions(flags, gtgt, language, config);
 
   // Add source file specific flags.
   lg->AppendFlags(flags, source->GetProperty("COMPILE_FLAGS"));
@@ -433,7 +433,7 @@ ComputeDefines(cmSourceFile *source, cmLocalGenerator* lg,
     }
 
   // Add preprocessor definitions for this target and configuration.
-  lg->AddCompileDefinitions(defines, target->Target, config, language);
+  lg->AddCompileDefinitions(defines, target, config, language);
   lg->AppendDefines(defines, source->GetProperty("COMPILE_DEFINITIONS"));
   {
   std::string defPropName = "COMPILE_DEFINITIONS_";
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index d457e9c..d830e26 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -920,7 +920,7 @@ cmLocalGenerator::ExpandRuleVariables(std::string& s,
 }
 
 //----------------------------------------------------------------------------
-const char* cmLocalGenerator::GetRuleLauncher(cmTarget* target,
+const char* cmLocalGenerator::GetRuleLauncher(cmGeneratorTarget* target,
                                               const std::string& prop)
 {
   if(target)
@@ -934,7 +934,8 @@ const char* cmLocalGenerator::GetRuleLauncher(cmTarget* target,
 }
 
 //----------------------------------------------------------------------------
-void cmLocalGenerator::InsertRuleLauncher(std::string& s, cmTarget* target,
+void cmLocalGenerator::InsertRuleLauncher(std::string& s,
+                                          cmGeneratorTarget* target,
                                           const std::string& prop)
 {
   if(const char* val = this->GetRuleLauncher(target, prop))
@@ -1087,27 +1088,23 @@ std::string cmLocalGenerator::GetIncludeFlags(
 
 //----------------------------------------------------------------------------
 void cmLocalGenerator::AddCompileDefinitions(std::set<std::string>& defines,
-                                             cmTarget const* target,
+                                             cmGeneratorTarget const* target,
                                              const std::string& config,
                                              const std::string& lang)
 {
   std::vector<std::string> targetDefines;
-  cmGeneratorTarget* gtgt = this->GlobalGenerator->GetGeneratorTarget(target);
-  gtgt->GetCompileDefinitions(targetDefines, config, lang);
+  target->GetCompileDefinitions(targetDefines, config, lang);
   this->AppendDefines(defines, targetDefines);
 }
 
 //----------------------------------------------------------------------------
 void cmLocalGenerator::AddCompileOptions(
-  std::string& flags, cmTarget* target,
+  std::string& flags, cmGeneratorTarget* target,
   const std::string& lang, const std::string& config
   )
 {
   std::string langFlagRegexVar = std::string("CMAKE_")+lang+"_FLAG_REGEX";
 
-  cmGeneratorTarget* gtgt =
-      this->GlobalGenerator->GetGeneratorTarget(target);
-
   if(const char* langFlagRegexStr =
      this->Makefile->GetDefinition(langFlagRegexVar))
     {
@@ -1118,7 +1115,7 @@ void cmLocalGenerator::AddCompileOptions(
       {
       cmSystemTools::ParseWindowsCommandLine(targetFlags, opts);
       }
-    gtgt->GetCompileOptions(opts, config, lang);
+    target->GetCompileOptions(opts, config, lang);
     for(std::vector<std::string>::const_iterator i = opts.begin();
         i != opts.end(); ++i)
       {
@@ -1139,7 +1136,7 @@ void cmLocalGenerator::AddCompileOptions(
       this->AppendFlags(flags, targetFlags);
       }
     std::vector<std::string> opts;
-    gtgt->GetCompileOptions(opts, config, lang);
+    target->GetCompileOptions(opts, config, lang);
     for(std::vector<std::string>::const_iterator i = opts.begin();
         i != opts.end(); ++i)
       {
@@ -1148,19 +1145,19 @@ void cmLocalGenerator::AddCompileOptions(
       }
     }
   std::vector<std::string> features;
-  gtgt->GetCompileFeatures(features, config);
+  target->GetCompileFeatures(features, config);
   for(std::vector<std::string>::const_iterator it = features.begin();
       it != features.end(); ++it)
     {
-     if (!this->Makefile->AddRequiredTargetFeature(target, *it))
+     if (!this->Makefile->AddRequiredTargetFeature(target->Target, *it))
       {
       return;
       }
     }
 
   for(std::map<std::string, std::string>::const_iterator it
-      = gtgt->GetMaxLanguageStandards().begin();
-      it != gtgt->GetMaxLanguageStandards().end(); ++it)
+      = target->GetMaxLanguageStandards().begin();
+      it != target->GetMaxLanguageStandards().end(); ++it)
     {
     const char* standard = target->GetProperty(it->first + "_STANDARD");
     if(!standard)
@@ -1314,7 +1311,7 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
 
 void cmLocalGenerator::GetStaticLibraryFlags(std::string& flags,
                                              std::string const& config,
-                                             cmTarget* target)
+                                             cmGeneratorTarget* target)
 {
   this->AppendFlags(flags,
     this->Makefile->GetSafeDefinition("CMAKE_STATIC_LINKER_FLAGS"));
@@ -1348,7 +1345,7 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
   switch(target->GetType())
     {
     case cmState::STATIC_LIBRARY:
-      this->GetStaticLibraryFlags(linkFlags, buildType, target->Target);
+      this->GetStaticLibraryFlags(linkFlags, buildType, target);
       break;
     case cmState::MODULE_LIBRARY:
       libraryLinkVariable = "CMAKE_MODULE_LINKER_FLAGS";
@@ -1904,7 +1901,8 @@ void cmLocalGenerator::AddSharedFlags(std::string& flags,
 
 //----------------------------------------------------------------------------
 void cmLocalGenerator::
-AddCompilerRequirementFlag(std::string &flags, cmTarget const* target,
+AddCompilerRequirementFlag(std::string &flags,
+                           cmGeneratorTarget const* target,
                            const std::string& lang)
 {
   if (lang.empty())
@@ -1942,7 +1940,8 @@ AddCompilerRequirementFlag(std::string &flags, cmTarget const* target,
               "CMAKE_" + lang + standardProp
                       + "_" + type + "_COMPILE_OPTION";
 
-    const char *opt = target->GetMakefile()->GetDefinition(option_flag);
+    const char *opt = target->Target->GetMakefile()
+        ->GetDefinition(option_flag);
     if (!opt)
       {
       std::ostringstream e;
@@ -1983,7 +1982,7 @@ AddCompilerRequirementFlag(std::string &flags, cmTarget const* target,
     std::string e =
       lang + "_STANDARD is set to invalid value '" + standard + "'";
     this->GetGlobalGenerator()->GetCMakeInstance()
-      ->IssueMessage(cmake::FATAL_ERROR, e, target->GetBacktrace());
+      ->IssueMessage(cmake::FATAL_ERROR, e, target->Target->GetBacktrace());
     return;
     }
 
@@ -2007,7 +2006,7 @@ AddCompilerRequirementFlag(std::string &flags, cmTarget const* target,
                       + "_" + type + "_COMPILE_OPTION";
 
     const char *opt =
-        target->GetMakefile()->GetRequiredDefinition(option_flag);
+        target->Target->GetMakefile()->GetRequiredDefinition(option_flag);
     this->AppendFlagEscape(flags, opt);
     return;
     }
@@ -2018,7 +2017,8 @@ AddCompilerRequirementFlag(std::string &flags, cmTarget const* target,
               "CMAKE_" + lang + *stdIt
                       + "_" + type + "_COMPILE_OPTION";
 
-    if (const char *opt = target->GetMakefile()->GetDefinition(option_flag))
+    if (const char *opt = target->Target
+        ->GetMakefile()->GetDefinition(option_flag))
       {
       this->AppendFlagEscape(flags, opt);
       return;
@@ -2094,7 +2094,7 @@ static void AddInlineVisibilityCompileOption(std::string &flags,
 
 //----------------------------------------------------------------------------
 void cmLocalGenerator
-::AddVisibilityPresetFlags(std::string &flags, cmTarget const* target,
+::AddVisibilityPresetFlags(std::string &flags, cmGeneratorTarget const* target,
                             const std::string& lang)
 {
   if (lang.empty())
@@ -2106,9 +2106,9 @@ void cmLocalGenerator
   std::string *pWarnCMP0063 = 0;
   if (target->GetType() != cmState::SHARED_LIBRARY &&
       target->GetType() != cmState::MODULE_LIBRARY &&
-      !target->IsExecutableWithExports())
+      !target->Target->IsExecutableWithExports())
     {
-    switch (target->GetPolicyStatusCMP0063())
+    switch (target->Target->GetPolicyStatusCMP0063())
       {
       case cmPolicies::OLD:
         return;
@@ -2120,15 +2120,16 @@ void cmLocalGenerator
       }
     }
 
-  AddVisibilityCompileOption(flags, target, this, lang, pWarnCMP0063);
+  AddVisibilityCompileOption(flags, target->Target, this, lang, pWarnCMP0063);
 
   if(lang == "CXX")
     {
-    AddInlineVisibilityCompileOption(flags, target, this, pWarnCMP0063);
+    AddInlineVisibilityCompileOption(flags, target->Target,
+                                     this, pWarnCMP0063);
     }
 
   if (!warnCMP0063.empty() &&
-      this->WarnCMP0063.insert(target).second)
+      this->WarnCMP0063.insert(target->Target).second)
     {
     std::ostringstream w;
     w <<
@@ -2138,14 +2139,15 @@ void cmLocalGenerator
       "has the following visibility properties set for " << lang << ":\n" <<
       warnCMP0063 <<
       "For compatibility CMake is not honoring them for this target.";
-    target->GetMakefile()->GetCMakeInstance()
-      ->IssueMessage(cmake::AUTHOR_WARNING, w.str(), target->GetBacktrace());
+    target->Target->GetMakefile()->GetCMakeInstance()
+      ->IssueMessage(cmake::AUTHOR_WARNING, w.str(),
+                     target->Target->GetBacktrace());
     }
 }
 
 //----------------------------------------------------------------------------
 void cmLocalGenerator::AddCMP0018Flags(std::string &flags,
-                                       cmTarget const* target,
+                                       cmGeneratorTarget const* target,
                                        std::string const& lang,
                                        const std::string& config)
 {
@@ -2169,9 +2171,7 @@ void cmLocalGenerator::AddCMP0018Flags(std::string &flags,
       return;
       }
 
-    cmGeneratorTarget* gtgt =
-        this->GlobalGenerator->GetGeneratorTarget(target);
-    if (gtgt->GetLinkInterfaceDependentBoolProperty(
+    if (target->GetLinkInterfaceDependentBoolProperty(
                                                 "POSITION_INDEPENDENT_CODE",
                                                 config))
       {
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index ee0a618..749a93d 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -20,7 +20,6 @@
 class cmMakefile;
 class cmGlobalGenerator;
 class cmGeneratorTarget;
-class cmTarget;
 class cmTargetManifest;
 class cmSourceFile;
 class cmCustomCommand;
@@ -91,13 +90,15 @@ public:
 
   void AddLanguageFlags(std::string& flags, const std::string& lang,
                         const std::string& config);
-  void AddCMP0018Flags(std::string &flags, cmTarget const* target,
+  void AddCMP0018Flags(std::string &flags, cmGeneratorTarget const* target,
                        std::string const& lang, const std::string& config);
-  void AddVisibilityPresetFlags(std::string &flags, cmTarget const* target,
+  void AddVisibilityPresetFlags(std::string &flags,
+                                cmGeneratorTarget const* target,
                                 const std::string& lang);
   void AddConfigVariableFlags(std::string& flags, const std::string& var,
                               const std::string& config);
-  void AddCompilerRequirementFlag(std::string &flags, cmTarget const* target,
+  void AddCompilerRequirementFlag(std::string &flags,
+                                  cmGeneratorTarget const* target,
                                   const std::string& lang);
   ///! Append flags to a string.
   virtual void AppendFlags(std::string& flags, const std::string& newFlags);
@@ -188,10 +189,10 @@ public:
                              const std::string& lang = "C",
                              const std::string& config = "",
                              bool stripImplicitInclDirs = true) const;
-  void AddCompileOptions(std::string& flags, cmTarget* target,
+  void AddCompileOptions(std::string& flags, cmGeneratorTarget* target,
                          const std::string& lang, const std::string& config);
   void AddCompileDefinitions(std::set<std::string>& defines,
-                             cmTarget const* target,
+                             cmGeneratorTarget const* target,
                              const std::string& config,
                              const std::string& lang);
 
@@ -212,7 +213,7 @@ public:
       {
         memset(this, 0,  sizeof(*this));
       }
-    cmTarget* CMTarget;
+    cmGeneratorTarget* CMTarget;
     const char* TargetPDB;
     const char* TargetCompilePDB;
     const char* TargetVersionMajor;
@@ -298,7 +299,7 @@ public:
   /** Fill out the static linker flags for the given target.  */
   void GetStaticLibraryFlags(std::string& flags,
                              std::string const& config,
-                             cmTarget* target);
+                             cmGeneratorTarget* target);
 
   /** Fill out these strings for the given target.  Libraries to link,
    *  flags, and linkflags. */
@@ -341,8 +342,9 @@ protected:
   std::string ExpandRuleVariable(std::string const& variable,
                                  const RuleVariables& replaceValues);
 
-  const char* GetRuleLauncher(cmTarget* target, const std::string& prop);
-  void InsertRuleLauncher(std::string& s, cmTarget* target,
+  const char* GetRuleLauncher(cmGeneratorTarget* target,
+                              const std::string& prop);
+  void InsertRuleLauncher(std::string& s, cmGeneratorTarget* target,
                           const std::string& prop);
 
   // Handle old-style install rules stored in the targets.
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index f3ee2e3..add0aa9 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -1034,7 +1034,7 @@ void
 cmLocalUnixMakefileGenerator3
 ::AppendCustomCommands(std::vector<std::string>& commands,
                        const std::vector<cmCustomCommand>& ccs,
-                       cmTarget* target,
+                       cmGeneratorTarget* target,
                        cmLocalGenerator::RelativeRoot relative)
 {
   for(std::vector<cmCustomCommand>::const_iterator i = ccs.begin();
@@ -1050,7 +1050,7 @@ void
 cmLocalUnixMakefileGenerator3
 ::AppendCustomCommand(std::vector<std::string>& commands,
                       cmCustomCommandGenerator const& ccg,
-                      cmTarget* target,
+                      cmGeneratorTarget* target,
                       bool echo_comment,
                       cmLocalGenerator::RelativeRoot relative,
                       std::ostream* content)
@@ -1181,7 +1181,7 @@ cmLocalUnixMakefileGenerator3
 std::string
 cmLocalUnixMakefileGenerator3::MakeLauncher(
   cmCustomCommandGenerator const& ccg,
-  cmTarget* target, RelativeRoot relative)
+  cmGeneratorTarget* target, RelativeRoot relative)
 {
   // Short-circuit if there is no launcher.
   const char* prop = "RULE_LAUNCH_CUSTOM";
@@ -1788,6 +1788,9 @@ void cmLocalUnixMakefileGenerator3
       this->AppendEcho(commands, text,
                        cmLocalUnixMakefileGenerator3::EchoGlobal);
 
+      cmGeneratorTarget* gt = this->GlobalGenerator
+          ->GetGeneratorTarget(&glIt->second);
+
       // Global targets store their rules in pre- and post-build commands.
       this->AppendCustomDepends(depends,
                                 glIt->second.GetPreBuildCommands());
@@ -1795,11 +1798,11 @@ void cmLocalUnixMakefileGenerator3
                                 glIt->second.GetPostBuildCommands());
       this->AppendCustomCommands(commands,
                                  glIt->second.GetPreBuildCommands(),
-                                 &glIt->second,
+                                 gt,
                                  cmLocalGenerator::START_OUTPUT);
       this->AppendCustomCommands(commands,
                                  glIt->second.GetPostBuildCommands(),
-                                 &glIt->second,
+                                 gt,
                                  cmLocalGenerator::START_OUTPUT);
       std::string targetName = glIt->second.GetName();
       this->WriteMakeRule(ruleFileStream, targetString.c_str(),
@@ -1976,10 +1979,11 @@ void cmLocalUnixMakefileGenerator3::ClearDependencies(cmMakefile* mf,
 
 
 void cmLocalUnixMakefileGenerator3
-::WriteDependLanguageInfo(std::ostream& cmakefileStream, cmTarget &target)
+::WriteDependLanguageInfo(std::ostream& cmakefileStream,
+                          cmGeneratorTarget* target)
 {
   ImplicitDependLanguageMap const& implicitLangs =
-    this->GetImplicitDepends(target);
+    this->GetImplicitDepends(*target->Target);
 
   // list the languages
   cmakefileStream
@@ -2030,7 +2034,7 @@ void cmLocalUnixMakefileGenerator3
 
     // Build a list of preprocessor definitions for the target.
     std::set<std::string> defines;
-    this->AddCompileDefinitions(defines, &target,
+    this->AddCompileDefinitions(defines, target,
                                 this->ConfigName, l->first);
     if(!defines.empty())
       {
@@ -2056,12 +2060,10 @@ void cmLocalUnixMakefileGenerator3
       << "set(CMAKE_" << l->first << "_TARGET_INCLUDE_PATH\n";
     std::vector<std::string> includes;
 
-    cmGeneratorTarget* gt = this->GetGlobalGenerator()
-                                ->GetGeneratorTarget(&target);
 
     const std::string& config =
       this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
-    this->GetIncludeDirectories(includes, gt,
+    this->GetIncludeDirectories(includes, target,
                                 l->first, config);
     for(std::vector<std::string>::iterator i = includes.begin();
         i != includes.end(); ++i)
@@ -2084,7 +2086,7 @@ void cmLocalUnixMakefileGenerator3
     cmSystemTools::ExpandListArgument(xform, transformRules);
     }
   if(const char* xform =
-     target.GetProperty("IMPLICIT_DEPENDS_INCLUDE_TRANSFORM"))
+     target->GetProperty("IMPLICIT_DEPENDS_INCLUDE_TRANSFORM"))
     {
     cmSystemTools::ExpandListArgument(xform, transformRules);
     }
diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h
index 586dda0..beaddde 100644
--- a/Source/cmLocalUnixMakefileGenerator3.h
+++ b/Source/cmLocalUnixMakefileGenerator3.h
@@ -182,7 +182,8 @@ protected:
 
 
   // write the depend info
-  void WriteDependLanguageInfo(std::ostream& cmakefileStream, cmTarget &tgt);
+  void WriteDependLanguageInfo(std::ostream& cmakefileStream,
+                               cmGeneratorTarget *tgt);
 
   // write the local help rule
   void WriteHelpRule(std::ostream& ruleFileStream);
@@ -215,12 +216,12 @@ protected:
                           cmCustomCommandGenerator const& cc);
   void AppendCustomCommands(std::vector<std::string>& commands,
                             const std::vector<cmCustomCommand>& ccs,
-                            cmTarget* target,
+                            cmGeneratorTarget* target,
                             cmLocalGenerator::RelativeRoot relative =
                             cmLocalGenerator::HOME_OUTPUT);
   void AppendCustomCommand(std::vector<std::string>& commands,
                            cmCustomCommandGenerator const& ccg,
-                           cmTarget* target,
+                           cmGeneratorTarget* target,
                            bool echo_comment=false,
                            cmLocalGenerator::RelativeRoot relative =
                            cmLocalGenerator::HOME_OUTPUT,
@@ -237,7 +238,7 @@ protected:
 private:
   std::string ConvertShellCommand(std::string const& cmd, RelativeRoot root);
   std::string MakeLauncher(cmCustomCommandGenerator const& ccg,
-                           cmTarget* target, RelativeRoot relative);
+                           cmGeneratorTarget* target, RelativeRoot relative);
 
   virtual void ComputeObjectFilenames(
                         std::map<cmSourceFile const*, std::string>& mapping,
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 43bc4e1..178b462 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -280,10 +280,10 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
     {
     this->LocalGenerator
       ->AppendCustomCommands(commands, this->Target->GetPreBuildCommands(),
-                             this->Target);
+                             this->GeneratorTarget);
     this->LocalGenerator
       ->AppendCustomCommands(commands, this->Target->GetPreLinkCommands(),
-                             this->Target);
+                             this->GeneratorTarget);
     }
 
   // Determine whether a link script will be used.
@@ -358,7 +358,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
 
   cmLocalGenerator::RuleVariables vars;
   vars.RuleLauncher = "RULE_LAUNCH_LINK";
-  vars.CMTarget = this->Target;
+  vars.CMTarget = this->GeneratorTarget;
   vars.Language = linkLanguage.c_str();
   vars.Objects = buildObjs.c_str();
   std::string objectDir = this->GeneratorTarget->GetSupportDirectory();
@@ -449,7 +449,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
     {
     this->LocalGenerator->
       AppendCustomCommands(commands, this->Target->GetPostBuildCommands(),
-                           this->Target);
+                           this->GeneratorTarget);
     }
 
   // Write the build rule.
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 28b4ab8..2ed5f70 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -115,7 +115,7 @@ void cmMakefileLibraryTargetGenerator::WriteObjectLibraryRules()
   // Add post-build rules.
   this->LocalGenerator->
     AppendCustomCommands(commands, this->Target->GetPostBuildCommands(),
-                         this->Target);
+                         this->GeneratorTarget);
 
   // Depend on the object files.
   this->AppendObjectDepends(depends);
@@ -146,7 +146,7 @@ void cmMakefileLibraryTargetGenerator::WriteStaticLibraryRules()
 
   std::string extraFlags;
   this->LocalGenerator->GetStaticLibraryFlags(extraFlags,
-    cmSystemTools::UpperCase(this->ConfigName), this->Target);
+    cmSystemTools::UpperCase(this->ConfigName), this->GeneratorTarget);
   this->WriteLibraryRules(linkRuleVar, extraFlags, false);
 }
 
@@ -458,10 +458,10 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
     {
     this->LocalGenerator
       ->AppendCustomCommands(commands, this->Target->GetPreBuildCommands(),
-                             this->Target);
+                             this->GeneratorTarget);
     this->LocalGenerator
       ->AppendCustomCommands(commands, this->Target->GetPreLinkCommands(),
-                             this->Target);
+                             this->GeneratorTarget);
     }
 
   // Determine whether a link script will be used.
@@ -640,7 +640,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
   vars.TargetVersionMinor = targetVersionMinor.c_str();
 
   vars.RuleLauncher = "RULE_LAUNCH_LINK";
-  vars.CMTarget = this->Target;
+  vars.CMTarget = this->GeneratorTarget;
   vars.Language = linkLanguage.c_str();
   vars.Objects = buildObjs.c_str();
   std::string objectDir = this->GeneratorTarget->GetSupportDirectory();
@@ -811,7 +811,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
     {
     this->LocalGenerator->
       AppendCustomCommands(commands, this->Target->GetPostBuildCommands(),
-                           this->Target);
+                           this->GeneratorTarget);
     }
 
   // Compute the list of outputs.
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index df50747..b7970fd 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -589,7 +589,7 @@ cmMakefileTargetGenerator
   }
   cmLocalGenerator::RuleVariables vars;
   vars.RuleLauncher = "RULE_LAUNCH_COMPILE";
-  vars.CMTarget = this->Target;
+  vars.CMTarget = this->GeneratorTarget;
   vars.Language = lang.c_str();
   vars.Target = targetOutPathReal.c_str();
   vars.TargetPDB = targetOutPathPDB.c_str();
@@ -1040,7 +1040,7 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
     return;
     }
   this->LocalGenerator->
-    WriteDependLanguageInfo(*this->InfoFileStream,*this->Target);
+    WriteDependLanguageInfo(*this->InfoFileStream, this->GeneratorTarget);
 
   // Store multiple output pairs in the depend info file.
   if(!this->MultipleOutputPairs.empty())
@@ -1211,7 +1211,8 @@ void cmMakefileTargetGenerator
 
   // Now append the actual user-specified commands.
   std::ostringstream content;
-  this->LocalGenerator->AppendCustomCommand(commands, ccg, this->Target, false,
+  this->LocalGenerator->AppendCustomCommand(commands, ccg,
+                                            this->GeneratorTarget, false,
                                             cmLocalGenerator::HOME_OUTPUT,
                                             &content);
 
diff --git a/Source/cmMakefileUtilityTargetGenerator.cxx b/Source/cmMakefileUtilityTargetGenerator.cxx
index 18594bb..11601c5 100644
--- a/Source/cmMakefileUtilityTargetGenerator.cxx
+++ b/Source/cmMakefileUtilityTargetGenerator.cxx
@@ -74,13 +74,13 @@ void cmMakefileUtilityTargetGenerator::WriteRuleFiles()
     (depends, this->Target->GetPostBuildCommands());
 
   this->LocalGenerator->AppendCustomCommands
-    (commands, this->Target->GetPreBuildCommands(), this->Target);
+    (commands, this->Target->GetPreBuildCommands(), this->GeneratorTarget);
 
   // Depend on all custom command outputs for sources
   this->DriveCustomCommands(depends);
 
   this->LocalGenerator->AppendCustomCommands
-    (commands, this->Target->GetPostBuildCommands(), this->Target);
+    (commands, this->Target->GetPostBuildCommands(), this->GeneratorTarget);
 
   // Add dependencies on targets that must be built first.
   this->AppendTargetDepends(depends);
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index e2061e5..e5e4b7f 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -178,7 +178,7 @@ cmNinjaNormalTargetGenerator
   if (!this->GetGlobalGenerator()->HasRule(ruleName)) {
     cmLocalGenerator::RuleVariables vars;
     vars.RuleLauncher = "RULE_LAUNCH_LINK";
-    vars.CMTarget = this->GetTarget();
+    vars.CMTarget = this->GetGeneratorTarget();
     vars.Language = this->TargetLinkLanguage.c_str();
 
     std::string responseFlag;
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 4d69a5e..cb1122c 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -335,7 +335,7 @@ cmNinjaTargetGenerator
 {
   cmLocalGenerator::RuleVariables vars;
   vars.RuleLauncher = "RULE_LAUNCH_COMPILE";
-  vars.CMTarget = this->GetTarget();
+  vars.CMTarget = this->GetGeneratorTarget();
   vars.Language = lang.c_str();
   vars.Source = "$in";
   vars.Object = "$out";
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index 41172f6..386d430 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -120,7 +120,7 @@ static void GetCompileDefinitionsAndDirectories(
   incs = cmJoin(includeDirs, ";");
 
   std::set<std::string> defines;
-  localGen->AddCompileDefinitions(defines, target->Target, config, "CXX");
+  localGen->AddCompileDefinitions(defines, target, config, "CXX");
 
   defs += cmJoin(defines, ";");
 }

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d29f1acf72cb068ac05f4876c20e3559f232f4f1
commit d29f1acf72cb068ac05f4876c20e3559f232f4f1
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Oct 10 15:51:21 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Oct 16 20:24:45 2015 +0200

    Use cmGeneratorTarget for property access.

diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index f7cc502..a197f88 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -109,7 +109,7 @@ std::string cmCommonTargetGenerator::ComputeFortranModuleDirectory() const
 {
   std::string mod_dir;
   const char* target_mod_dir =
-    this->Target->GetProperty("Fortran_MODULE_DIRECTORY");
+    this->GeneratorTarget->GetProperty("Fortran_MODULE_DIRECTORY");
   const char* moddir_flag =
     this->Makefile->GetDefinition("CMAKE_Fortran_MODDIR_FLAG");
   if(target_mod_dir && moddir_flag)
@@ -214,7 +214,7 @@ cmCommonTargetGenerator
     this->LocalGenerator->GetFortranFormat(srcfmt);
   if(format == cmLocalGenerator::FortranFormatNone)
     {
-    const char* tgtfmt = this->Target->GetProperty("Fortran_FORMAT");
+    const char* tgtfmt = this->GeneratorTarget->GetProperty("Fortran_FORMAT");
     format = this->LocalGenerator->GetFortranFormat(tgtfmt);
     }
   const char* var = 0;
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 20fb70b..5e26aad 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -4859,7 +4859,7 @@ bool cmGeneratorTarget::ComputeOutputDir(const std::string& config,
     // Skip per-configuration subdirectory.
     conf = "";
     }
-  else if(const char* outdir = this->Target->GetProperty(propertyName))
+  else if(const char* outdir = this->GetProperty(propertyName))
     {
     // Use the user-specified output directory.
     cmGeneratorExpression ge;
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 433af7e..43bc4e1 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -197,7 +197,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
                            this->ConfigName);
 
 
-  if(this->Target->GetPropertyAsBool("WIN32_EXECUTABLE"))
+  if(this->GeneratorTarget->GetPropertyAsBool("WIN32_EXECUTABLE"))
     {
     this->LocalGenerator->AppendFlags
       (linkFlags, this->Makefile->GetDefinition("CMAKE_CREATE_WIN32_EXE"));
@@ -226,11 +226,11 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
 
   // Add target-specific linker flags.
   this->LocalGenerator->AppendFlags
-    (linkFlags, this->Target->GetProperty("LINK_FLAGS"));
+    (linkFlags, this->GeneratorTarget->GetProperty("LINK_FLAGS"));
   std::string linkFlagsConfig = "LINK_FLAGS_";
   linkFlagsConfig += cmSystemTools::UpperCase(this->ConfigName);
   this->LocalGenerator->AppendFlags
-    (linkFlags, this->Target->GetProperty(linkFlagsConfig));
+    (linkFlags, this->GeneratorTarget->GetProperty(linkFlagsConfig));
 
   this->AddModuleDefinitionFlag(linkFlags);
 
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 6cde0f6..28b4ab8 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -166,11 +166,11 @@ void cmMakefileLibraryTargetGenerator::WriteSharedLibraryRules(bool relink)
 
   std::string extraFlags;
   this->LocalGenerator->AppendFlags
-    (extraFlags, this->Target->GetProperty("LINK_FLAGS"));
+    (extraFlags, this->GeneratorTarget->GetProperty("LINK_FLAGS"));
   std::string linkFlagsConfig = "LINK_FLAGS_";
   linkFlagsConfig += cmSystemTools::UpperCase(this->ConfigName);
   this->LocalGenerator->AppendFlags
-    (extraFlags, this->Target->GetProperty(linkFlagsConfig));
+    (extraFlags, this->GeneratorTarget->GetProperty(linkFlagsConfig));
 
   this->LocalGenerator->AddConfigVariableFlags
     (extraFlags, "CMAKE_SHARED_LINKER_FLAGS", this->ConfigName);
@@ -190,11 +190,11 @@ void cmMakefileLibraryTargetGenerator::WriteModuleLibraryRules(bool relink)
 
   std::string extraFlags;
   this->LocalGenerator->AppendFlags(extraFlags,
-                                    this->Target->GetProperty("LINK_FLAGS"));
+                           this->GeneratorTarget->GetProperty("LINK_FLAGS"));
   std::string linkFlagsConfig = "LINK_FLAGS_";
   linkFlagsConfig += cmSystemTools::UpperCase(this->ConfigName);
   this->LocalGenerator->AppendFlags
-    (extraFlags, this->Target->GetProperty(linkFlagsConfig));
+    (extraFlags, this->GeneratorTarget->GetProperty(linkFlagsConfig));
   this->LocalGenerator->AddConfigVariableFlags
     (extraFlags, "CMAKE_MODULE_LINKER_FLAGS", this->ConfigName);
   this->AddModuleDefinitionFlag(extraFlags);
@@ -213,11 +213,11 @@ void cmMakefileLibraryTargetGenerator::WriteFrameworkRules(bool relink)
 
   std::string extraFlags;
   this->LocalGenerator->AppendFlags(extraFlags,
-                                    this->Target->GetProperty("LINK_FLAGS"));
+                             this->GeneratorTarget->GetProperty("LINK_FLAGS"));
   std::string linkFlagsConfig = "LINK_FLAGS_";
   linkFlagsConfig += cmSystemTools::UpperCase(this->ConfigName);
   this->LocalGenerator->AppendFlags
-    (extraFlags, this->Target->GetProperty(linkFlagsConfig));
+    (extraFlags, this->GeneratorTarget->GetProperty(linkFlagsConfig));
   this->LocalGenerator->AddConfigVariableFlags
     (extraFlags, "CMAKE_MACOSX_FRAMEWORK_LINKER_FLAGS", this->ConfigName);
 
@@ -569,7 +569,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
   if (this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY &&
       this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS"))
     {
-    if(this->Target->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
+    if(this->GeneratorTarget->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
       {
       std::string name_of_def_file =
         this->GeneratorTarget->GetSupportDirectory();
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 603214d..df50747 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -667,7 +667,7 @@ cmMakefileTargetGenerator
   if (!compileCommands.empty() && (lang == "C" || lang == "CXX"))
     {
     std::string const iwyu_prop = lang + "_INCLUDE_WHAT_YOU_USE";
-    const char *iwyu = this->Target->GetProperty(iwyu_prop);
+    const char *iwyu = this->GeneratorTarget->GetProperty(iwyu_prop);
     if (iwyu && *iwyu)
       {
       std::string run_iwyu = "$(CMAKE_COMMAND) -E __run_iwyu --iwyu=";
@@ -681,7 +681,7 @@ cmMakefileTargetGenerator
   if (!compileCommands.empty() && (lang == "C" || lang == "CXX"))
     {
     std::string const clauncher_prop = lang + "_COMPILER_LAUNCHER";
-    const char *clauncher = this->Target->GetProperty(clauncher_prop);
+    const char *clauncher = this->GeneratorTarget->GetProperty(clauncher_prop);
     if (clauncher && *clauncher)
       {
       std::vector<std::string> launcher_cmd;
@@ -1513,7 +1513,7 @@ void cmMakefileTargetGenerator
 
   // Add user-specified dependencies.
   if(const char* linkDepends =
-     this->Target->GetProperty("LINK_DEPENDS"))
+     this->GeneratorTarget->GetProperty("LINK_DEPENDS"))
     {
     cmSystemTools::ExpandListArgument(linkDepends, depends);
     }
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 3d1579f..4d69a5e 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -218,7 +218,8 @@ cmNinjaDeps cmNinjaTargetGenerator::ComputeLinkDeps() const
     }
 
   // Add user-specified dependencies.
-  if (const char* linkDepends = this->Target->GetProperty("LINK_DEPENDS"))
+  if (const char* linkDepends =
+      this->GeneratorTarget->GetProperty("LINK_DEPENDS"))
     {
     std::vector<std::string> linkDeps;
     cmSystemTools::ExpandListArgument(linkDepends, linkDeps);
@@ -410,7 +411,7 @@ cmNinjaTargetGenerator
   if (!compileCmds.empty() && (lang == "C" || lang == "CXX"))
     {
     std::string const iwyu_prop = lang + "_INCLUDE_WHAT_YOU_USE";
-    const char *iwyu = this->Target->GetProperty(iwyu_prop);
+    const char *iwyu = this->GeneratorTarget->GetProperty(iwyu_prop);
     if (iwyu && *iwyu)
       {
       std::string run_iwyu =
@@ -427,7 +428,7 @@ cmNinjaTargetGenerator
   if (!compileCmds.empty() && (lang == "C" || lang == "CXX"))
     {
     std::string const clauncher_prop = lang + "_COMPILER_LAUNCHER";
-    const char *clauncher = this->Target->GetProperty(clauncher_prop);
+    const char *clauncher = this->GeneratorTarget->GetProperty(clauncher_prop);
     if (clauncher && *clauncher)
       {
       std::vector<std::string> launcher_cmd;
diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx
index 9feb7ac..5bbe268 100644
--- a/Source/cmNinjaUtilityTargetGenerator.cxx
+++ b/Source/cmNinjaUtilityTargetGenerator.cxx
@@ -90,7 +90,8 @@ void cmNinjaUtilityTargetGenerator::Generate()
   } else {
     std::string command =
       this->GetLocalGenerator()->BuildCommandLine(commands);
-    const char *echoStr = this->GetTarget()->GetProperty("EchoString");
+    const char *echoStr =
+        this->GetGeneratorTarget()->GetProperty("EchoString");
     std::string desc;
     if (echoStr)
       desc = echoStr;
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 2225a46..f0344bb 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -270,7 +270,7 @@ void cmVisualStudio10TargetGenerator::Generate()
 {
   // do not generate external ms projects
   if(this->GeneratorTarget->GetType() == cmState::INTERFACE_LIBRARY
-      || this->Target->GetProperty("EXTERNAL_MSPROJECT"))
+      || this->GeneratorTarget->GetProperty("EXTERNAL_MSPROJECT"))
     {
     return;
     }
@@ -368,7 +368,7 @@ void cmVisualStudio10TargetGenerator::Generate()
     }
 
   const char* vsProjectTypes =
-    this->Target->GetProperty("VS_GLOBAL_PROJECT_TYPES");
+    this->GeneratorTarget->GetProperty("VS_GLOBAL_PROJECT_TYPES");
   if(vsProjectTypes)
     {
     this->WriteString("<ProjectTypes>", 2);
@@ -376,9 +376,12 @@ void cmVisualStudio10TargetGenerator::Generate()
       "</ProjectTypes>\n";
     }
 
-  const char* vsProjectName = this->Target->GetProperty("VS_SCC_PROJECTNAME");
-  const char* vsLocalPath = this->Target->GetProperty("VS_SCC_LOCALPATH");
-  const char* vsProvider = this->Target->GetProperty("VS_SCC_PROVIDER");
+  const char* vsProjectName =
+      this->GeneratorTarget->GetProperty("VS_SCC_PROJECTNAME");
+  const char* vsLocalPath =
+      this->GeneratorTarget->GetProperty("VS_SCC_LOCALPATH");
+  const char* vsProvider =
+      this->GeneratorTarget->GetProperty("VS_SCC_PROVIDER");
 
   if( vsProjectName && vsLocalPath && vsProvider )
     {
@@ -392,7 +395,8 @@ void cmVisualStudio10TargetGenerator::Generate()
     (*this->BuildFileStream) << cmVS10EscapeXML(vsProvider) <<
       "</SccProvider>\n";
 
-    const char* vsAuxPath = this->Target->GetProperty("VS_SCC_AUXPATH");
+    const char* vsAuxPath =
+        this->GeneratorTarget->GetProperty("VS_SCC_AUXPATH");
     if( vsAuxPath )
       {
       this->WriteString("<SccAuxPath>", 2);
@@ -401,13 +405,13 @@ void cmVisualStudio10TargetGenerator::Generate()
       }
     }
 
-  if(this->Target->GetPropertyAsBool("VS_WINRT_COMPONENT"))
+  if(this->GeneratorTarget->GetPropertyAsBool("VS_WINRT_COMPONENT"))
     {
     this->WriteString("<WinMDAssembly>true</WinMDAssembly>\n", 2);
     }
 
   const char* vsGlobalKeyword =
-    this->Target->GetProperty("VS_GLOBAL_KEYWORD");
+    this->GeneratorTarget->GetProperty("VS_GLOBAL_KEYWORD");
   if(!vsGlobalKeyword)
     {
     this->WriteString("<Keyword>Win32Proj</Keyword>\n", 2);
@@ -420,7 +424,7 @@ void cmVisualStudio10TargetGenerator::Generate()
     }
 
   const char* vsGlobalRootNamespace =
-    this->Target->GetProperty("VS_GLOBAL_ROOTNAMESPACE");
+    this->GeneratorTarget->GetProperty("VS_GLOBAL_ROOTNAMESPACE");
   if(vsGlobalRootNamespace)
     {
     this->WriteString("<RootNamespace>", 2);
@@ -431,14 +435,14 @@ void cmVisualStudio10TargetGenerator::Generate()
   this->WriteString("<Platform>", 2);
   (*this->BuildFileStream) << cmVS10EscapeXML(this->Platform)
                            << "</Platform>\n";
-  const char* projLabel = this->Target->GetProperty("PROJECT_LABEL");
+  const char* projLabel = this->GeneratorTarget->GetProperty("PROJECT_LABEL");
   if(!projLabel)
     {
     projLabel = this->Name.c_str();
     }
   this->WriteString("<ProjectName>", 2);
   (*this->BuildFileStream) << cmVS10EscapeXML(projLabel) << "</ProjectName>\n";
-  if(const char* targetFrameworkVersion = this->Target->GetProperty(
+  if(const char* targetFrameworkVersion = this->GeneratorTarget->GetProperty(
        "VS_DOTNET_TARGET_FRAMEWORK_VERSION"))
     {
     this->WriteString("<TargetFrameworkVersion>", 2);
@@ -497,7 +501,7 @@ void cmVisualStudio10TargetGenerator::WriteDotNetReferences()
 {
   std::vector<std::string> references;
   if(const char* vsDotNetReferences =
-     this->Target->GetProperty("VS_DOTNET_REFERENCES"))
+     this->GeneratorTarget->GetProperty("VS_DOTNET_REFERENCES"))
     {
     cmSystemTools::ExpandListArgument(vsDotNetReferences, references);
     }
@@ -543,7 +547,7 @@ void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup()
           i != this->Configurations.end(); ++i)
         {
         this->WritePlatformConfigTag("LogicalName", i->c_str(), 3);
-        if(this->Target->GetProperty("VS_GLOBAL_ROOTNAMESPACE"))
+        if(this->GeneratorTarget->GetProperty("VS_GLOBAL_ROOTNAMESPACE"))
           {
           (*this->BuildFileStream ) << "$(RootNamespace).";
           }
@@ -610,7 +614,7 @@ void cmVisualStudio10TargetGenerator::WriteWinRTReferences()
 {
   std::vector<std::string> references;
   if(const char* vsWinRTReferences =
-     this->Target->GetProperty("VS_WINRT_REFERENCES"))
+     this->GeneratorTarget->GetProperty("VS_WINRT_REFERENCES"))
     {
     cmSystemTools::ExpandListArgument(vsWinRTReferences, references);
     }
@@ -679,7 +683,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues()
         break;
       case cmState::EXECUTABLE:
         if(this->NsightTegra &&
-           !this->Target->GetPropertyAsBool("ANDROID_GUI"))
+           !this->GeneratorTarget->GetPropertyAsBool("ANDROID_GUI"))
           {
           // Android executables are .so too.
           configType += "DynamicLibrary";
@@ -746,10 +750,10 @@ void cmVisualStudio10TargetGenerator
 
   if((this->GeneratorTarget->GetType() <= cmState::OBJECT_LIBRARY &&
       this->ClOptions[config]->UsingUnicode()) ||
-     this->Target->GetPropertyAsBool("VS_WINRT_COMPONENT") ||
+     this->GeneratorTarget->GetPropertyAsBool("VS_WINRT_COMPONENT") ||
      this->GlobalGenerator->TargetsWindowsPhone() ||
      this->GlobalGenerator->TargetsWindowsStore() ||
-     this->Target->GetPropertyAsBool("VS_WINRT_EXTENSIONS"))
+     this->GeneratorTarget->GetPropertyAsBool("VS_WINRT_EXTENSIONS"))
     {
     this->WriteString("<CharacterSet>Unicode</CharacterSet>\n", 2);
     }
@@ -769,8 +773,8 @@ void cmVisualStudio10TargetGenerator
     pts += "</PlatformToolset>\n";
     this->WriteString(pts.c_str(), 2);
     }
-  if(this->Target->GetPropertyAsBool("VS_WINRT_COMPONENT") ||
-     this->Target->GetPropertyAsBool("VS_WINRT_EXTENSIONS"))
+  if(this->GeneratorTarget->GetPropertyAsBool("VS_WINRT_COMPONENT") ||
+     this->GeneratorTarget->GetPropertyAsBool("VS_WINRT_EXTENSIONS"))
     {
     this->WriteString("<WindowsAppContainer>true"
                       "</WindowsAppContainer>\n", 2);
@@ -788,27 +792,29 @@ void cmVisualStudio10TargetGenerator
   ntv += toolset? toolset : "Default";
   ntv += "</NdkToolchainVersion>\n";
   this->WriteString(ntv.c_str(), 2);
-  if(const char* minApi = this->Target->GetProperty("ANDROID_API_MIN"))
+  if(const char* minApi =
+     this->GeneratorTarget->GetProperty("ANDROID_API_MIN"))
     {
     this->WriteString("<AndroidMinAPI>", 2);
     (*this->BuildFileStream ) <<
       "android-" << cmVS10EscapeXML(minApi) << "</AndroidMinAPI>\n";
     }
-  if(const char* api = this->Target->GetProperty("ANDROID_API"))
+  if(const char* api = this->GeneratorTarget->GetProperty("ANDROID_API"))
     {
     this->WriteString("<AndroidTargetAPI>", 2);
     (*this->BuildFileStream ) <<
       "android-" << cmVS10EscapeXML(api) << "</AndroidTargetAPI>\n";
     }
 
-  if(const char* cpuArch = this->Target->GetProperty("ANDROID_ARCH"))
+  if(const char* cpuArch = this->GeneratorTarget->GetProperty("ANDROID_ARCH"))
     {
     this->WriteString("<AndroidArch>", 2);
     (*this->BuildFileStream) << cmVS10EscapeXML(cpuArch) <<
       "</AndroidArch>\n";
     }
 
-  if(const char* stlType = this->Target->GetProperty("ANDROID_STL_TYPE"))
+  if(const char* stlType =
+     this->GeneratorTarget->GetProperty("ANDROID_STL_TYPE"))
     {
     this->WriteString("<AndroidStlType>", 2);
     (*this->BuildFileStream) << cmVS10EscapeXML(stlType) <<
@@ -1963,7 +1969,7 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
   if (this->MSTools)
     {
     // If we have the VS_WINRT_COMPONENT set then force Compile as WinRT.
-    if (this->Target->GetPropertyAsBool("VS_WINRT_COMPONENT"))
+    if (this->GeneratorTarget->GetPropertyAsBool("VS_WINRT_COMPONENT"))
       {
       clOptions.AddFlag("CompileAsWinRT", "true");
       // For WinRT components, add the _WINRT_DLL define to produce a lib
@@ -2012,7 +2018,7 @@ void cmVisualStudio10TargetGenerator::WriteClOptions(
   if(this->NsightTegra)
     {
     if(const char* processMax =
-        this->Target->GetProperty("ANDROID_PROCESS_MAX"))
+        this->GeneratorTarget->GetProperty("ANDROID_PROCESS_MAX"))
       {
       this->WriteString("<ProcessMax>", 3);
       *this->BuildFileStream << cmVS10EscapeXML(processMax) <<
@@ -2270,18 +2276,18 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
     cmVS10EscapeXML(antBuildPath) << "</AntBuildPath>\n";
   }
 
-  if (this->Target->GetPropertyAsBool("ANDROID_SKIP_ANT_STEP"))
+  if (this->GeneratorTarget->GetPropertyAsBool("ANDROID_SKIP_ANT_STEP"))
     {
     this->WriteString("<SkipAntStep>true</SkipAntStep>\n", 3);
     }
 
-  if (this->Target->GetPropertyAsBool("ANDROID_PROGUARD"))
+  if (this->GeneratorTarget->GetPropertyAsBool("ANDROID_PROGUARD"))
     {
     this->WriteString("<EnableProGuard>true</EnableProGuard>\n", 3);
     }
 
   if (const char* proGuardConfigLocation =
-      this->Target->GetProperty("ANDROID_PROGUARD_CONFIG_PATH"))
+      this->GeneratorTarget->GetProperty("ANDROID_PROGUARD_CONFIG_PATH"))
     {
     this->WriteString("<ProGuardConfigLocation>", 3);
     (*this->BuildFileStream) << cmVS10EscapeXML(proGuardConfigLocation) <<
@@ -2289,7 +2295,7 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
     }
 
   if (const char* securePropertiesLocation =
-      this->Target->GetProperty("ANDROID_SECURE_PROPS_PATH"))
+      this->GeneratorTarget->GetProperty("ANDROID_SECURE_PROPS_PATH"))
     {
     this->WriteString("<SecurePropertiesLocation>", 3);
     (*this->BuildFileStream) << cmVS10EscapeXML(securePropertiesLocation) <<
@@ -2297,7 +2303,7 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
     }
 
   if (const char* nativeLibDirectoriesExpression =
-      this->Target->GetProperty("ANDROID_NATIVE_LIB_DIRECTORIES"))
+      this->GeneratorTarget->GetProperty("ANDROID_NATIVE_LIB_DIRECTORIES"))
     {
     cmGeneratorExpression ge;
     cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
@@ -2310,7 +2316,7 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
     }
 
   if (const char* nativeLibDependenciesExpression =
-      this->Target->GetProperty("ANDROID_NATIVE_LIB_DEPENDENCIES"))
+      this->GeneratorTarget->GetProperty("ANDROID_NATIVE_LIB_DEPENDENCIES"))
     {
     cmGeneratorExpression ge;
     cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
@@ -2323,7 +2329,7 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
     }
 
   if (const char* javaSourceDir =
-      this->Target->GetProperty("ANDROID_JAVA_SOURCE_DIR"))
+      this->GeneratorTarget->GetProperty("ANDROID_JAVA_SOURCE_DIR"))
     {
     this->WriteString("<JavaSourceDir>", 3);
     (*this->BuildFileStream) << cmVS10EscapeXML(javaSourceDir) <<
@@ -2331,7 +2337,7 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
     }
 
   if (const char* jarDirectoriesExpression =
-      this->Target->GetProperty("ANDROID_JAR_DIRECTORIES"))
+      this->GeneratorTarget->GetProperty("ANDROID_JAR_DIRECTORIES"))
     {
     cmGeneratorExpression ge;
     cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
@@ -2344,7 +2350,7 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
     }
 
   if (const char* jarDeps =
-      this->Target->GetProperty("ANDROID_JAR_DEPENDENCIES"))
+      this->GeneratorTarget->GetProperty("ANDROID_JAR_DEPENDENCIES"))
     {
     this->WriteString("<JarDependencies>", 3);
     (*this->BuildFileStream) << cmVS10EscapeXML(jarDeps) <<
@@ -2352,7 +2358,7 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
     }
 
   if (const char* assetsDirectories =
-      this->Target->GetProperty("ANDROID_ASSETS_DIRECTORIES"))
+      this->GeneratorTarget->GetProperty("ANDROID_ASSETS_DIRECTORIES"))
     {
     this->WriteString("<AssetsDirectories>", 3);
     (*this->BuildFileStream) << cmVS10EscapeXML(assetsDirectories) <<
@@ -2368,7 +2374,7 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
   }
 
   if (const char* antAdditionalOptions =
-      this->Target->GetProperty("ANDROID_ANT_ADDITIONAL_OPTIONS"))
+      this->GeneratorTarget->GetProperty("ANDROID_ANT_ADDITIONAL_OPTIONS"))
     {
     this->WriteString("<AdditionalOptions>", 3);
     (*this->BuildFileStream) << cmVS10EscapeXML(antAdditionalOptions) <<
@@ -2439,7 +2445,8 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
   flags += " ";
   flags += this->
     Target->GetMakefile()->GetRequiredDefinition(linkFlagVar.c_str());
-  const char* targetLinkFlags = this->Target->GetProperty("LINK_FLAGS");
+  const char* targetLinkFlags =
+      this->GeneratorTarget->GetProperty("LINK_FLAGS");
   if(targetLinkFlags)
     {
     flags += " ";
@@ -2447,7 +2454,8 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
     }
   std::string flagsProp = "LINK_FLAGS_";
   flagsProp += CONFIG;
-  if(const char* flagsConfig = this->Target->GetProperty(flagsProp.c_str()))
+  if(const char* flagsConfig =
+     this->GeneratorTarget->GetProperty(flagsProp.c_str()))
     {
     flags += " ";
     flags += flagsConfig;
@@ -2525,7 +2533,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
     {
     linkOptions.AddFlag("Version", "");
 
-    if ( this->Target->GetPropertyAsBool("WIN32_EXECUTABLE") )
+    if ( this->GeneratorTarget->GetPropertyAsBool("WIN32_EXECUTABLE") )
       {
       if (this->GlobalGenerator->TargetsWindowsCE())
         {
@@ -2597,7 +2605,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
 
     // A Windows Runtime component uses internal .NET metadata,
     // so does not have an import library.
-    if(this->Target->GetPropertyAsBool("VS_WINRT_COMPONENT") &&
+    if(this->GeneratorTarget->GetPropertyAsBool("VS_WINRT_COMPONENT") &&
        this->GeneratorTarget->GetType() != cmState::EXECUTABLE)
       {
       linkOptions.AddFlag("GenerateWindowsMetadata", "true");
@@ -2639,7 +2647,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
   if (this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY &&
       this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS"))
     {
-    if (this->Target->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
+    if (this->GeneratorTarget->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
       {
       linkOptions.AddFlag("ModuleDefinitionFile", "$(IntDir)exportall.def");
       }
@@ -2783,7 +2791,7 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups()
     this->WriteManifestOptions(*i);
     if(this->NsightTegra &&
        this->GeneratorTarget->GetType() == cmState::EXECUTABLE &&
-       this->Target->GetPropertyAsBool("ANDROID_GUI"))
+       this->GeneratorTarget->GetPropertyAsBool("ANDROID_GUI"))
       {
       this->WriteAntBuildOptions(*i);
       }
@@ -2798,7 +2806,7 @@ cmVisualStudio10TargetGenerator::WriteEvents(std::string const& configName)
   if (this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY &&
       this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS"))
     {
-    if (this->Target->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
+    if (this->GeneratorTarget->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
       {
       addedPrelink = true;
       std::vector<cmCustomCommand> commands =
@@ -2911,14 +2919,14 @@ void cmVisualStudio10TargetGenerator::WritePlatformExtensions()
       cmHasLiteralPrefix(this->GlobalGenerator->GetSystemVersion(), "10.0"))
     {
     const char* desktopExtensionsVersion =
-      this->Target->GetProperty("VS_DESKTOP_EXTENSIONS_VERSION");
+      this->GeneratorTarget->GetProperty("VS_DESKTOP_EXTENSIONS_VERSION");
     if (desktopExtensionsVersion)
       {
       this->WriteSinglePlatformExtension("WindowsDesktop",
                                          desktopExtensionsVersion);
       }
     const char* mobileExtensionsVersion =
-      this->Target->GetProperty("VS_MOBILE_EXTENSIONS_VERSION");
+      this->GeneratorTarget->GetProperty("VS_MOBILE_EXTENSIONS_VERSION");
     if (mobileExtensionsVersion)
       {
       this->WriteSinglePlatformExtension("WindowsMobile",
@@ -2958,11 +2966,11 @@ void cmVisualStudio10TargetGenerator::WriteSDKReferences()
       cmHasLiteralPrefix(this->GlobalGenerator->GetSystemVersion(), "10.0"))
     {
     const char* desktopExtensionsVersion =
-      this->Target->GetProperty("VS_DESKTOP_EXTENSIONS_VERSION");
+      this->GeneratorTarget->GetProperty("VS_DESKTOP_EXTENSIONS_VERSION");
     const char* mobileExtensionsVersion =
-      this->Target->GetProperty("VS_MOBILE_EXTENSIONS_VERSION");
+      this->GeneratorTarget->GetProperty("VS_MOBILE_EXTENSIONS_VERSION");
     const char* iotExtensionsVersion =
-      this->Target->GetProperty("VS_IOT_EXTENSIONS_VERSION");
+      this->GeneratorTarget->GetProperty("VS_IOT_EXTENSIONS_VERSION");
 
     if(desktopExtensionsVersion || mobileExtensionsVersion ||
        iotExtensionsVersion)
@@ -3194,7 +3202,8 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings()
       "</WindowsTargetPlatformVersion>\n";
     }
   const char* targetPlatformMinVersion =
-      this->Target->GetProperty("VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION");
+      this->GeneratorTarget
+      ->GetProperty("VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION");
   if(targetPlatformMinVersion)
     {
     this->WriteString("<WindowsTargetPlatformMinVersion>", 2);
@@ -3213,7 +3222,7 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings()
     }
 
   // Added IoT Startup Task support
-  if(this->Target->GetPropertyAsBool("VS_IOT_STARTUP_TASK"))
+  if(this->GeneratorTarget->GetPropertyAsBool("VS_IOT_STARTUP_TASK"))
     {
     this->WriteString("<ContainsStartupTask>true</ContainsStartupTask>\n", 2);
     }

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f170c3b04e279ea0fa86869512e4b3f3d27cf620
commit f170c3b04e279ea0fa86869512e4b3f3d27cf620
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 16 20:09:43 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Oct 16 20:24:44 2015 +0200

    Use GetName from cmGeneratorTarget.

diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index c37f797..d457e9c 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1421,7 +1421,7 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
         {
         cmSystemTools::Error
           ("CMake can not determine linker language for target: ",
-           target->Target->GetName().c_str());
+           target->GetName().c_str());
         return;
         }
       this->AddLanguageFlags(flags, linkLanguage, buildType);
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index ea91095..433af7e 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -168,7 +168,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
   if(linkLanguage.empty())
     {
     cmSystemTools::Error("Cannot determine link language for target \"",
-                         this->Target->GetName().c_str(), "\".");
+                         this->GeneratorTarget->GetName().c_str(), "\".");
     return;
     }
 
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 6695143..6cde0f6 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -122,11 +122,11 @@ void cmMakefileLibraryTargetGenerator::WriteObjectLibraryRules()
 
   // Write the rule.
   this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
-                                      this->Target->GetName(),
+                                      this->GeneratorTarget->GetName(),
                                       depends, commands, true);
 
   // Write the main driver rule to build everything in this target.
-  this->WriteTargetDriverRule(this->Target->GetName(), false);
+  this->WriteTargetDriverRule(this->GeneratorTarget->GetName(), false);
 }
 
 //----------------------------------------------------------------------------
@@ -244,7 +244,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
   if(linkLanguage.empty())
     {
     cmSystemTools::Error("Cannot determine link language for target \"",
-                         this->Target->GetName().c_str(), "\".");
+                         this->GeneratorTarget->GetName().c_str(), "\".");
     return;
     }
 
@@ -574,7 +574,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
       std::string name_of_def_file =
         this->GeneratorTarget->GetSupportDirectory();
       name_of_def_file += std::string("/") +
-        this->Target->GetName();
+        this->GeneratorTarget->GetName();
       name_of_def_file += ".def";
       std::string cmd = cmSystemTools::GetCMakeCommand();
       cmd = this->Convert(cmd, cmLocalGenerator::NONE,
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 48a29b3..603214d 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -248,7 +248,8 @@ void cmMakefileTargetGenerator::WriteCommonCodeRules()
     // Write an empty dependency file.
     cmGeneratedFileStream depFileStream(dependFileNameFull.c_str());
     depFileStream
-      << "# Empty dependencies file for " << this->Target->GetName() << ".\n"
+      << "# Empty dependencies file for "
+      << this->GeneratorTarget->GetName() << ".\n"
       << "# This may be replaced when dependencies are built." << std::endl;
     }
 
@@ -394,7 +395,7 @@ void cmMakefileTargetGenerator
     err << "Warning: Source file \""
         << source.GetFullPath()
         << "\" is listed multiple times for target \""
-        << this->Target->GetName()
+        << this->GeneratorTarget->GetName()
         << "\".";
     cmSystemTools::Message(err.str().c_str(), "Warning");
     return;
@@ -1267,10 +1268,10 @@ cmMakefileTargetGenerator
   // Write a make variable assignment that lists all objects for the
   // target.
   variableName =
-    this->LocalGenerator->CreateMakeVariable(this->Target->GetName(),
+    this->LocalGenerator->CreateMakeVariable(this->GeneratorTarget->GetName(),
                                              "_OBJECTS");
   *this->BuildFileStream
-    << "# Object files for target " << this->Target->GetName() << "\n"
+    << "# Object files for target " << this->GeneratorTarget->GetName() << "\n"
     << variableName << " =";
   std::string object;
   const char* lineContinue =
@@ -1292,12 +1293,12 @@ cmMakefileTargetGenerator
   // Write a make variable assignment that lists all external objects
   // for the target.
   variableNameExternal =
-    this->LocalGenerator->CreateMakeVariable(this->Target->GetName(),
+    this->LocalGenerator->CreateMakeVariable(this->GeneratorTarget->GetName(),
                                              "_EXTERNAL_OBJECTS");
   *this->BuildFileStream
     << "\n"
     << "# External object files for target "
-    << this->Target->GetName() << "\n"
+    << this->GeneratorTarget->GetName() << "\n"
     << variableNameExternal << " =";
   for(std::vector<std::string>::const_iterator i =
         this->ExternalObjects.begin();
diff --git a/Source/cmMakefileUtilityTargetGenerator.cxx b/Source/cmMakefileUtilityTargetGenerator.cxx
index 303ca63..18594bb 100644
--- a/Source/cmMakefileUtilityTargetGenerator.cxx
+++ b/Source/cmMakefileUtilityTargetGenerator.cxx
@@ -42,7 +42,8 @@ void cmMakefileUtilityTargetGenerator::WriteRuleFiles()
   this->CreateRuleFile();
 
   *this->BuildFileStream
-    << "# Utility rule file for " << this->Target->GetName() << ".\n\n";
+    << "# Utility rule file for "
+    << this->GeneratorTarget->GetName() << ".\n\n";
 
   if(!this->NoRuleMessages)
     {
@@ -101,11 +102,11 @@ void cmMakefileUtilityTargetGenerator::WriteRuleFiles()
 
   // Write the rule.
   this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
-                                      this->Target->GetName(),
+                                      this->GeneratorTarget->GetName(),
                                       depends, commands, true);
 
   // Write the main driver rule to build everything in this target.
-  this->WriteTargetDriverRule(this->Target->GetName(), false);
+  this->WriteTargetDriverRule(this->GeneratorTarget->GetName(), false);
 
   // Write clean target
   this->WriteTargetCleanRules();
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index a8f182b..e2061e5 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -77,7 +77,7 @@ void cmNinjaNormalTargetGenerator::Generate()
   if (this->TargetLinkLanguage.empty()) {
     cmSystemTools::Error("CMake can not determine linker language for "
                          "target: ",
-                         this->GetTarget()->GetName().c_str());
+                         this->GetGeneratorTarget()->GetName().c_str());
     return;
   }
 
@@ -158,7 +158,8 @@ cmNinjaNormalTargetGenerator
     + "_"
     + cmState::GetTargetTypeName(this->GetGeneratorTarget()->GetType())
     + "_LINKER__"
-    + cmGlobalNinjaGenerator::EncodeRuleName(this->GetTarget()->GetName())
+    + cmGlobalNinjaGenerator::EncodeRuleName(
+        this->GetGeneratorTarget()->GetName())
     ;
 }
 
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 0eba0b3..3d1579f 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -92,7 +92,7 @@ std::string cmNinjaTargetGenerator::LanguageCompilerRule(
   const std::string& lang) const
 {
   return lang + "_COMPILER__" +
-    cmGlobalNinjaGenerator::EncodeRuleName(this->Target->GetName());
+    cmGlobalNinjaGenerator::EncodeRuleName(this->GeneratorTarget->GetName());
 }
 
 std::string
@@ -271,7 +271,7 @@ cmNinjaTargetGenerator
 
 std::string cmNinjaTargetGenerator::GetTargetName() const
 {
-  return this->Target->GetName();
+  return this->GeneratorTarget->GetName();
 }
 
 
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 7968412..2225a46 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -178,7 +178,7 @@ cmVisualStudio10TargetGenerator(cmTarget* target,
   this->LocalGenerator =
     (cmLocalVisualStudio7Generator*)
     this->GeneratorTarget->GetLocalGenerator();
-  this->Name = this->Target->GetName();
+  this->Name = this->GeneratorTarget->GetName();
   this->GUID = this->GlobalGenerator->GetGUID(this->Name.c_str());
   this->Platform = gg->GetPlatformName();
   this->NsightTegra = gg->IsNsightTegra();
@@ -1775,7 +1775,7 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions()
       if(ttype == cmState::OBJECT_LIBRARY)
         {
         outDir = intermediateDir;
-        targetNameFull = this->Target->GetName();
+        targetNameFull = this->GeneratorTarget->GetName();
         targetNameFull += ".lib";
         }
       else
@@ -3325,7 +3325,8 @@ void cmVisualStudio10TargetGenerator::WriteMissingFilesWP80()
     this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget);
   this->ConvertToWindowsSlash(artifactDir);
   std::string artifactDirXML = cmVS10EscapeXML(artifactDir);
-  std::string targetNameXML = cmVS10EscapeXML(this->Target->GetName());
+  std::string targetNameXML =
+      cmVS10EscapeXML(this->GeneratorTarget->GetName());
 
   cmGeneratedFileStream fout(manifestFile.c_str());
   fout.SetCopyIfDifferent(true);
@@ -3408,7 +3409,8 @@ void cmVisualStudio10TargetGenerator::WriteMissingFilesWP81()
     this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget);
   this->ConvertToWindowsSlash(artifactDir);
   std::string artifactDirXML = cmVS10EscapeXML(artifactDir);
-  std::string targetNameXML = cmVS10EscapeXML(this->Target->GetName());
+  std::string targetNameXML =
+      cmVS10EscapeXML(this->GeneratorTarget->GetName());
 
   cmGeneratedFileStream fout(manifestFile.c_str());
   fout.SetCopyIfDifferent(true);
@@ -3468,7 +3470,8 @@ void cmVisualStudio10TargetGenerator::WriteMissingFilesWS80()
     this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget);
   this->ConvertToWindowsSlash(artifactDir);
   std::string artifactDirXML = cmVS10EscapeXML(artifactDir);
-  std::string targetNameXML = cmVS10EscapeXML(this->Target->GetName());
+  std::string targetNameXML =
+      cmVS10EscapeXML(this->GeneratorTarget->GetName());
 
   cmGeneratedFileStream fout(manifestFile.c_str());
   fout.SetCopyIfDifferent(true);
@@ -3520,7 +3523,8 @@ void cmVisualStudio10TargetGenerator::WriteMissingFilesWS81()
     this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget);
   this->ConvertToWindowsSlash(artifactDir);
   std::string artifactDirXML = cmVS10EscapeXML(artifactDir);
-  std::string targetNameXML = cmVS10EscapeXML(this->Target->GetName());
+  std::string targetNameXML =
+      cmVS10EscapeXML(this->GeneratorTarget->GetName());
 
   cmGeneratedFileStream fout(manifestFile.c_str());
   fout.SetCopyIfDifferent(true);
@@ -3577,7 +3581,8 @@ void cmVisualStudio10TargetGenerator::WriteMissingFilesWS10_0()
     this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget);
   this->ConvertToWindowsSlash(artifactDir);
   std::string artifactDirXML = cmVS10EscapeXML(artifactDir);
-  std::string targetNameXML = cmVS10EscapeXML(this->Target->GetName());
+  std::string targetNameXML =
+      cmVS10EscapeXML(this->GeneratorTarget->GetName());
 
   cmGeneratedFileStream fout(manifestFile.c_str());
   fout.SetCopyIfDifferent(true);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ed09f3b292bee34e8b30204c93ef5596a3124d00
commit ed09f3b292bee34e8b30204c93ef5596a3124d00
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 16 20:05:47 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Oct 16 20:24:44 2015 +0200

    Use IsImported from cmGeneratorTarget.

diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index f6de2ab..a5a1f29 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -417,7 +417,7 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index,
                                              const cmGeneratorTarget* dependee,
                                              bool linking)
 {
-  if(dependee->Target->IsImported() ||
+  if(dependee->IsImported() ||
      dependee->GetType() == cmState::INTERFACE_LIBRARY)
     {
     // Skip IMPORTED and INTERFACE targets but follow their utility
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index 8f7b480..dc06678 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -45,7 +45,7 @@ std::string cmCustomCommandGenerator::GetCommand(unsigned int c) const
   cmGeneratorTarget* target =
       this->LG->FindGeneratorTargetToUse(argv0);
   if(target && target->GetType() == cmState::EXECUTABLE &&
-     (target->Target->IsImported()
+     (target->IsImported()
       || !this->LG->GetMakefile()->IsOn("CMAKE_CROSSCOMPILING")))
     {
     return target->GetLocation(this->Config);
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 4d153b7..20fb70b 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -796,7 +796,7 @@ void cmGeneratorTarget
 const char* cmGeneratorTarget::GetLocation(const std::string& config) const
 {
   static std::string location;
-  if (this->Target->IsImported())
+  if (this->IsImported())
     {
     location = this->Target->ImportedGetFullPath(config, false);
     }
@@ -1491,7 +1491,7 @@ bool cmGeneratorTarget::MacOSXRpathInstallNameDirDefault() const
 //----------------------------------------------------------------------------
 std::string cmGeneratorTarget::GetSOName(const std::string& config) const
 {
-  if(this->Target->IsImported())
+  if(this->IsImported())
     {
     // Lookup the imported soname.
     if(cmGeneratorTarget::ImportInfo const* info =
@@ -1606,7 +1606,7 @@ cmGeneratorTarget::GetFrameworkDirectory(const std::string& config,
 std::string
 cmGeneratorTarget::GetFullName(const std::string& config, bool implib) const
 {
-  if(this->Target->IsImported())
+  if(this->IsImported())
     {
     return this->GetFullNameImported(config, implib);
     }
@@ -3033,7 +3033,7 @@ void cmGeneratorTarget::GetCompileDefinitions(std::vector<std::string> &list,
 void cmGeneratorTarget::ComputeTargetManifest(
                                               const std::string& config) const
 {
-  if (this->Target->IsImported())
+  if (this->IsImported())
     {
     return;
     }
@@ -3107,7 +3107,7 @@ void cmGeneratorTarget::ComputeTargetManifest(
 std::string cmGeneratorTarget::GetFullPath(const std::string& config,
                                            bool implib, bool realname) const
 {
-  if(this->Target->IsImported())
+  if(this->IsImported())
     {
     return this->Target->ImportedGetFullPath(config, implib);
     }
@@ -3152,7 +3152,7 @@ cmGeneratorTarget::NormalGetRealName(const std::string& 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())
+  if(this->IsImported())
     {
     std::string msg =  "NormalGetRealName called on imported target: ";
     msg += this->GetName();
@@ -3194,7 +3194,7 @@ void cmGeneratorTarget::GetLibraryNames(std::string& name,
   // 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())
+  if(this->IsImported())
     {
     std::string msg =  "GetLibraryNames called on imported target: ";
     msg += this->GetName();
@@ -3283,7 +3283,7 @@ void cmGeneratorTarget::GetExecutableNames(std::string& name,
   // 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())
+  if(this->IsImported())
     {
     std::string msg =
       "GetExecutableNames called on imported target: ";
@@ -4735,7 +4735,7 @@ cmGeneratorTarget::GetLinkInterfaceLibraries(const std::string& config,
 std::string cmGeneratorTarget::GetDirectory(const std::string& config,
                                    bool implib) const
 {
-  if (this->Target->IsImported())
+  if (this->IsImported())
     {
     // Return the directory from which the target is imported.
     return
@@ -5413,7 +5413,7 @@ const cmLinkImplementation *
 cmGeneratorTarget::GetLinkImplementation(const std::string& config) const
 {
   // There is no link implementation for imported targets.
-  if(this->Target->IsImported())
+  if(this->IsImported())
     {
     return 0;
     }
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index ee31e28..8e671a3 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -473,7 +473,7 @@ cmGlobalUnixMakefileGenerator3
        (type == cmState::OBJECT_LIBRARY) ||
        (type == cmState::UTILITY))
       {
-      if(gtarget->Target->IsImported())
+      if(gtarget->IsImported())
         {
         continue;
         }
@@ -632,7 +632,7 @@ cmGlobalUnixMakefileGenerator3
         t != targets.end(); ++t)
       {
       cmGeneratorTarget* gtarget = t->second;
-      if(gtarget->Target->IsImported())
+      if(gtarget->IsImported())
         {
         continue;
         }
@@ -733,7 +733,7 @@ cmGlobalUnixMakefileGenerator3
       t != targets.end(); ++t)
     {
     cmGeneratorTarget* gtarget = t->second;
-    if(gtarget->Target->IsImported())
+    if(gtarget->IsImported())
       {
       continue;
       }
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index e4cfcde..c37f797 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -476,7 +476,7 @@ void cmLocalGenerator::ComputeTargetManifest()
       {
       continue;
       }
-    if (target.Target->IsImported())
+    if (target.IsImported())
       {
       continue;
       }
diff --git a/Source/cmLocalGhsMultiGenerator.cxx b/Source/cmLocalGhsMultiGenerator.cxx
index 2535d2f..a408a23 100644
--- a/Source/cmLocalGhsMultiGenerator.cxx
+++ b/Source/cmLocalGhsMultiGenerator.cxx
@@ -32,7 +32,7 @@ void cmLocalGhsMultiGenerator::Generate()
        ++l)
     {
     if (l->second->GetType() == cmState::INTERFACE_LIBRARY
-        || l->second->Target->IsImported())
+        || l->second->IsImported())
       {
       continue;
       }

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=beff29f0d4bf1ffface0e6833f29f2f04ceccf0b
commit beff29f0d4bf1ffface0e6833f29f2f04ceccf0b
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 16 19:19:51 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Oct 16 20:24:44 2015 +0200

    cmGeneratorTarget: Move ComputeVersionedName from cmTarget.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 7e4c917..4d153b7 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -3250,11 +3250,11 @@ void cmGeneratorTarget::GetLibraryNames(std::string& name,
   else
   {
     // The library's soname.
-    this->Target->ComputeVersionedName(soName, prefix, base, suffix,
+    this->ComputeVersionedName(soName, prefix, base, suffix,
                               name, soversion);
 
     // The library's real name on disk.
-    this->Target->ComputeVersionedName(realName, prefix, base, suffix,
+    this->ComputeVersionedName(realName, prefix, base, suffix,
                               name, version);
   }
 
@@ -4437,6 +4437,23 @@ void cmGeneratorTarget::GetTargetVersion(bool soversion,
 }
 
 //----------------------------------------------------------------------------
+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
+{
+  vName = this->Makefile->IsOn("APPLE") ? (prefix+base) : name;
+  if(version)
+    {
+    vName += ".";
+    vName += version;
+    }
+  vName += this->Makefile->IsOn("APPLE") ? suffix : std::string();
+}
+
+//----------------------------------------------------------------------------
 void
 cmGeneratorTarget::ReportPropertyOrigin(const std::string &p,
                                const std::string &result,
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index f3b8d1f..f5a894b 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -483,6 +483,13 @@ private:
   // Returns ARCHIVE, LIBRARY, or RUNTIME based on platform and type.
   const char* GetOutputTargetType(bool implib) 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;
+
   struct CompatibleInterfacesBase
   {
     std::set<std::string> PropsBool;
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 850fc6a..1c4faab 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2119,23 +2119,6 @@ cmTarget::ImportedGetFullPath(const std::string& config, bool pimplib) const
 }
 
 //----------------------------------------------------------------------------
-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::SetPropertyDefault(const std::string& property,
                                   const char* default_value)
 {
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index a9d2454..443a2d0 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -414,13 +414,6 @@ private:
   friend class cmGeneratorTarget;
   friend class cmTargetTraceDependencies;
 
-  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;
-
   cmListFileBacktrace Backtrace;
 };
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=12e4790a0b40d8176940f855f7f6c9cfe6c39f9f
commit 12e4790a0b40d8176940f855f7f6c9cfe6c39f9f
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 16 19:19:51 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Oct 16 20:24:44 2015 +0200

    cmGeneratorTarget: Move GetTargetVersion from cmTarget.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index b6c2967..7e4c917 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -4399,6 +4399,44 @@ cmGeneratorTarget::GetLinkInformation(const std::string& config) const
 }
 
 //----------------------------------------------------------------------------
+void cmGeneratorTarget::GetTargetVersion(int& major, int& minor) const
+{
+  int patch;
+  this->GetTargetVersion(false, major, minor, patch);
+}
+
+//----------------------------------------------------------------------------
+void cmGeneratorTarget::GetTargetVersion(bool soversion,
+                                int& major, int& minor, int& patch) const
+{
+  // Set the default values.
+  major = 0;
+  minor = 0;
+  patch = 0;
+
+  assert(this->GetType() != cmState::INTERFACE_LIBRARY);
+
+  // Look for a VERSION or SOVERSION property.
+  const char* prop = soversion? "SOVERSION" : "VERSION";
+  if(const char* version = this->GetProperty(prop))
+    {
+    // Try to parse the version number and store the results that were
+    // successfully parsed.
+    int parsed_major;
+    int parsed_minor;
+    int parsed_patch;
+    switch(sscanf(version, "%d.%d.%d",
+                  &parsed_major, &parsed_minor, &parsed_patch))
+      {
+      case 3: patch = parsed_patch; // no break!
+      case 2: minor = parsed_minor; // no break!
+      case 1: major = parsed_major; // no break!
+      default: break;
+      }
+    }
+}
+
+//----------------------------------------------------------------------------
 void
 cmGeneratorTarget::ReportPropertyOrigin(const std::string &p,
                                const std::string &result,
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 0c198bb..f3b8d1f 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -445,6 +445,17 @@ public:
 
   const char* ImportedGetLocation(const std::string& config) const;
 
+  /** Get the target major and minor version numbers interpreted from
+      the VERSION property.  Version 0 is returned if the property is
+      not set or cannot be parsed.  */
+  void GetTargetVersion(int& major, int& minor) const;
+
+  /** Get the target major, minor, and patch version numbers
+      interpreted from the VERSION or SOVERSION property.  Version 0
+      is returned if the property is not set or cannot be parsed.  */
+  void
+  GetTargetVersion(bool soversion, int& major, int& minor, int& patch) const;
+
 private:
   friend class cmTargetTraceDependencies;
   struct SourceEntry { std::vector<cmSourceFile*> Depends; };
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index bc05aea..8454bc1 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -2422,7 +2422,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
     int patch;
 
     // VERSION -> current_version
-    target.GetTargetVersion(false, major, minor, patch);
+    gtgt->GetTargetVersion(false, major, minor, patch);
     std::ostringstream v;
 
     // Xcode always wants at least 1.0.0 or nothing
@@ -2434,7 +2434,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
                                 this->CreateString(v.str().c_str()));
 
     // SOVERSION -> compatibility_version
-    target.GetTargetVersion(true, major, minor, patch);
+    gtgt->GetTargetVersion(true, major, minor, patch);
     std::ostringstream vso;
 
     // Xcode always wants at least 1.0.0 or nothing
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index b6f5aed..3e901ba 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -1319,7 +1319,7 @@ void cmLocalVisualStudio6Generator
     {
     int major;
     int minor;
-    target.GetTargetVersion(major, minor);
+    gt->GetTargetVersion(major, minor);
     std::ostringstream targetVersionStream;
     targetVersionStream << "/version:" << major << "." << minor;
     targetVersionFlag = targetVersionStream.str();
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 1122919..6d02bfa 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -1215,7 +1215,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
     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());
@@ -1314,7 +1314,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
     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());
@@ -1384,11 +1384,11 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
 //----------------------------------------------------------------------------
 void
 cmLocalVisualStudio7Generator
-::WriteTargetVersionAttribute(std::ostream& fout, cmTarget& target)
+::WriteTargetVersionAttribute(std::ostream& fout, cmGeneratorTarget* gt)
 {
   int major;
   int minor;
-  target.GetTargetVersion(major, minor);
+  gt->GetTargetVersion(major, minor);
   fout << "\t\t\t\tVersion=\"" << major << "." << minor << "\"\n";
 }
 
diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h
index ba6a72b..16cf004 100644
--- a/Source/cmLocalVisualStudio7Generator.h
+++ b/Source/cmLocalVisualStudio7Generator.h
@@ -106,7 +106,8 @@ private:
                        const char* source,
                        const cmCustomCommand& command,
                        FCInfo& fcinfo);
-  void WriteTargetVersionAttribute(std::ostream& fout, cmTarget& target);
+  void WriteTargetVersionAttribute(std::ostream& fout,
+                                   cmGeneratorTarget* gt);
 
   bool WriteGroup(const cmSourceGroup *sg,
                   cmTarget& target, std::ostream &fout,
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 2d2de5f..ea91095 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -382,7 +382,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
   std::ostringstream minorStream;
   int major;
   int minor;
-  this->Target->GetTargetVersion(major, minor);
+  this->GeneratorTarget->GetTargetVersion(major, minor);
   majorStream << major;
   minorStream << minor;
   targetVersionMajor = majorStream.str();
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index a0aa10b..6695143 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -630,7 +630,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
   std::ostringstream minorStream;
   int major;
   int minor;
-  this->Target->GetTargetVersion(major, minor);
+  this->GeneratorTarget->GetTargetVersion(major, minor);
   majorStream << major;
   minorStream << minor;
   targetVersionMajor = majorStream.str();
@@ -862,7 +862,7 @@ cmMakefileLibraryTargetGenerator
   int major;
   int minor;
   int patch;
-  this->Target->GetTargetVersion(so, major, minor, patch);
+  this->GeneratorTarget->GetTargetVersion(so, major, minor, patch);
   if(major > 0 || minor > 0 || patch > 0)
     {
     // Append the flag since a non-zero version is specified.
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 066c64e..a8f182b 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -227,7 +227,7 @@ cmNinjaNormalTargetGenerator
     std::ostringstream minorStream;
     int major;
     int minor;
-    this->GetTarget()->GetTargetVersion(major, minor);
+    this->GetGeneratorTarget()->GetTargetVersion(major, minor);
     majorStream << major;
     minorStream << minor;
     targetVersionMajor = majorStream.str();
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 7f21efe..850fc6a 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1616,44 +1616,6 @@ bool cmTarget::HaveWellDefinedOutputFiles() const
 }
 
 //----------------------------------------------------------------------------
-void cmTarget::GetTargetVersion(int& major, int& minor) const
-{
-  int patch;
-  this->GetTargetVersion(false, major, minor, patch);
-}
-
-//----------------------------------------------------------------------------
-void cmTarget::GetTargetVersion(bool soversion,
-                                int& major, int& minor, int& patch) const
-{
-  // Set the default values.
-  major = 0;
-  minor = 0;
-  patch = 0;
-
-  assert(this->GetType() != cmState::INTERFACE_LIBRARY);
-
-  // Look for a VERSION or SOVERSION property.
-  const char* prop = soversion? "SOVERSION" : "VERSION";
-  if(const char* version = this->GetProperty(prop))
-    {
-    // Try to parse the version number and store the results that were
-    // successfully parsed.
-    int parsed_major;
-    int parsed_minor;
-    int parsed_patch;
-    switch(sscanf(version, "%d.%d.%d",
-                  &parsed_major, &parsed_minor, &parsed_patch))
-      {
-      case 3: patch = parsed_patch; // no break!
-      case 2: minor = parsed_minor; // no break!
-      case 1: major = parsed_major; // no break!
-      default: break;
-      }
-    }
-}
-
-//----------------------------------------------------------------------------
 bool cmTarget::HandleLocationPropertyPolicy(cmMakefile* context) const
 {
   if (this->IsImported())
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 6cd876e..a9d2454 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -213,17 +213,6 @@ public:
 
   bool IsImported() const {return this->IsImportedTarget;}
 
-  /** Get the target major and minor version numbers interpreted from
-      the VERSION property.  Version 0 is returned if the property is
-      not set or cannot be parsed.  */
-  void GetTargetVersion(int& major, int& minor) const;
-
-  /** Get the target major, minor, and patch version numbers
-      interpreted from the VERSION or SOVERSION property.  Version 0
-      is returned if the property is not set or cannot be parsed.  */
-  void
-  GetTargetVersion(bool soversion, int& major, int& minor, int& patch) const;
-
   // Get the properties
   cmPropertyMap &GetProperties() const { return this->Properties; }
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=14272277205ac7927a4c13b628ce411538f7b17c
commit 14272277205ac7927a4c13b628ce411538f7b17c
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 16 19:19:51 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Oct 16 20:24:44 2015 +0200

    cmGeneratorTarget: Move CheckCMP0004 from cmTarget.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 87a75b4..b6c2967 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -4445,7 +4445,7 @@ void cmGeneratorTarget::LookupLinkItems(std::vector<std::string> const& names,
   for(std::vector<std::string>::const_iterator i = names.begin();
       i != names.end(); ++i)
     {
-    std::string name = this->Target->CheckCMP0004(*i);
+    std::string name = this->CheckCMP0004(*i);
     if(name == this->GetName() || name.empty())
       {
       continue;
@@ -5476,6 +5476,65 @@ void cmGeneratorTarget::GetObjectLibrariesCMP0026(
 }
 
 //----------------------------------------------------------------------------
+std::string cmGeneratorTarget::CheckCMP0004(std::string const& item) const
+{
+  // Strip whitespace off the library names because we used to do this
+  // in case variables were expanded at generate time.  We no longer
+  // do the expansion but users link to libraries like " ${VAR} ".
+  std::string lib = item;
+  std::string::size_type pos = lib.find_first_not_of(" \t\r\n");
+  if(pos != lib.npos)
+    {
+    lib = lib.substr(pos, lib.npos);
+    }
+  pos = lib.find_last_not_of(" \t\r\n");
+  if(pos != lib.npos)
+    {
+    lib = lib.substr(0, pos+1);
+    }
+  if(lib != item)
+    {
+    cmake* cm = this->LocalGenerator->GetCMakeInstance();
+    switch(this->Target->GetPolicyStatusCMP0004())
+      {
+      case cmPolicies::WARN:
+        {
+        std::ostringstream w;
+        w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0004) << "\n"
+          << "Target \"" << this->GetName() << "\" links to item \""
+          << item << "\" which has leading or trailing whitespace.";
+        cm->IssueMessage(cmake::AUTHOR_WARNING, w.str(),
+                         this->Target->GetBacktrace());
+        }
+      case cmPolicies::OLD:
+        break;
+      case cmPolicies::NEW:
+        {
+        std::ostringstream e;
+        e << "Target \"" << this->GetName() << "\" links to item \""
+          << item << "\" which has leading or trailing whitespace.  "
+          << "This is now an error according to policy CMP0004.";
+        cm->IssueMessage(cmake::FATAL_ERROR, e.str(),
+                         this->Target->GetBacktrace());
+        }
+        break;
+      case cmPolicies::REQUIRED_IF_USED:
+      case cmPolicies::REQUIRED_ALWAYS:
+        {
+        std::ostringstream e;
+        e << cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0004) << "\n"
+          << "Target \"" << this->GetName() << "\" links to item \""
+          << item << "\" which has leading or trailing whitespace.";
+        cm->IssueMessage(cmake::FATAL_ERROR, e.str(),
+                         this->Target->GetBacktrace());
+        }
+        break;
+      }
+    }
+  return lib;
+}
+
+//----------------------------------------------------------------------------
 void cmGeneratorTarget::GetLanguages(std::set<std::string>& languages,
                             const std::string& config) const
 {
@@ -5636,7 +5695,7 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
         li != llibs.end(); ++li)
       {
       // Skip entries that resolve to the target itself or are empty.
-      std::string name = this->Target->CheckCMP0004(*li);
+      std::string name = this->CheckCMP0004(*li);
       if(name == this->GetName() || name.empty())
         {
         if(name == this->GetName())
@@ -5702,7 +5761,7 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
     {
     if(li->second != GENERAL_LibraryType && li->second != linkType)
       {
-      std::string name = this->Target->CheckCMP0004(li->first);
+      std::string name = this->CheckCMP0004(li->first);
       if(name == this->GetName() || name.empty())
         {
         continue;
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index f72c85d..0c198bb 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -537,6 +537,9 @@ private:
                          ImportInfo& info) const;
   ImportInfo const* GetImportInfo(const std::string& config) 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;
 
   cmLinkInterface const*
     GetImportLinkInterface(const std::string& config,
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 55a9c49..7f21efe 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2368,63 +2368,6 @@ bool cmTarget::GetMappedConfig(std::string const& desired_config,
 }
 
 //----------------------------------------------------------------------------
-std::string cmTarget::CheckCMP0004(std::string const& item) const
-{
-  // Strip whitespace off the library names because we used to do this
-  // in case variables were expanded at generate time.  We no longer
-  // do the expansion but users link to libraries like " ${VAR} ".
-  std::string lib = item;
-  std::string::size_type pos = lib.find_first_not_of(" \t\r\n");
-  if(pos != lib.npos)
-    {
-    lib = lib.substr(pos, lib.npos);
-    }
-  pos = lib.find_last_not_of(" \t\r\n");
-  if(pos != lib.npos)
-    {
-    lib = lib.substr(0, pos+1);
-    }
-  if(lib != item)
-    {
-    cmake* cm = this->Makefile->GetCMakeInstance();
-    switch(this->GetPolicyStatusCMP0004())
-      {
-      case cmPolicies::WARN:
-        {
-        std::ostringstream w;
-        w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0004) << "\n"
-          << "Target \"" << this->GetName() << "\" links to item \""
-          << item << "\" which has leading or trailing whitespace.";
-        cm->IssueMessage(cmake::AUTHOR_WARNING, w.str(),
-                         this->GetBacktrace());
-        }
-      case cmPolicies::OLD:
-        break;
-      case cmPolicies::NEW:
-        {
-        std::ostringstream e;
-        e << "Target \"" << this->GetName() << "\" links to item \""
-          << item << "\" which has leading or trailing whitespace.  "
-          << "This is now an error according to policy CMP0004.";
-        cm->IssueMessage(cmake::FATAL_ERROR, e.str(), this->GetBacktrace());
-        }
-        break;
-      case cmPolicies::REQUIRED_IF_USED:
-      case cmPolicies::REQUIRED_ALWAYS:
-        {
-        std::ostringstream e;
-        e << cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0004) << "\n"
-          << "Target \"" << this->GetName() << "\" links to item \""
-          << item << "\" which has leading or trailing whitespace.";
-        cm->IssueMessage(cmake::FATAL_ERROR, e.str(), this->GetBacktrace());
-        }
-        break;
-      }
-    }
-  return lib;
-}
-
-//----------------------------------------------------------------------------
 cmTargetInternalPointer::cmTargetInternalPointer()
 {
   this->Pointer = new cmTargetInternals;
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index fa11953..6cd876e 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -213,10 +213,6 @@ public:
 
   bool IsImported() const {return this->IsImportedTarget;}
 
-  /** 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;
-
   /** Get the target major and minor version numbers interpreted from
       the VERSION property.  Version 0 is returned if the property is
       not set or cannot be parsed.  */

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8f363d6771dfa792d606978e1e406229637078f6
commit 8f363d6771dfa792d606978e1e406229637078f6
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 16 19:19:50 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Oct 16 20:24:43 2015 +0200

    cmGeneratorTarget: Move ImportInfo from cmTarget.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 2ef2f5c..87a75b4 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1364,7 +1364,8 @@ bool cmGeneratorTarget::IsImportedSharedLibWithoutSOName(
 {
   if(this->IsImported() && this->GetType() == cmState::SHARED_LIBRARY)
     {
-    if(cmTarget::ImportInfo const* info = this->Target->GetImportInfo(config))
+    if(cmGeneratorTarget::ImportInfo const* info =
+       this->GetImportInfo(config))
       {
       return info->NoSOName;
       }
@@ -1405,7 +1406,8 @@ bool cmGeneratorTarget::HasMacOSXRpathInstallNameDir(
   else
     {
     // Lookup the imported soname.
-    if(cmTarget::ImportInfo const* info = this->Target->GetImportInfo(config))
+    if(cmGeneratorTarget::ImportInfo const* info =
+       this->GetImportInfo(config))
       {
       if(!info->NoSOName && !info->SOName.empty())
         {
@@ -1492,7 +1494,8 @@ std::string cmGeneratorTarget::GetSOName(const std::string& config) const
   if(this->Target->IsImported())
     {
     // Lookup the imported soname.
-    if(cmTarget::ImportInfo const* info = this->Target->GetImportInfo(config))
+    if(cmGeneratorTarget::ImportInfo const* info =
+       this->GetImportInfo(config))
       {
       if(info->NoSOName)
         {
@@ -5080,7 +5083,7 @@ cmGeneratorTarget::GetImportLinkInterface(const std::string& config,
                                  cmGeneratorTarget const* headTarget,
                                  bool usage_requirements_only) const
 {
-  cmTarget::ImportInfo const* info = this->Target->GetImportInfo(config);
+  cmGeneratorTarget::ImportInfo const* info = this->GetImportInfo(config);
   if(!info)
     {
     return 0;
@@ -5118,6 +5121,223 @@ cmGeneratorTarget::GetImportLinkInterface(const std::string& config,
   return &iface;
 }
 
+//----------------------------------------------------------------------------
+cmGeneratorTarget::ImportInfo const*
+cmGeneratorTarget::GetImportInfo(const std::string& config) const
+{
+  // There is no imported information for non-imported targets.
+  if(!this->IsImported())
+    {
+    return 0;
+    }
+
+  // Lookup/compute/cache the import information for this
+  // configuration.
+  std::string config_upper;
+  if(!config.empty())
+    {
+    config_upper = cmSystemTools::UpperCase(config);
+    }
+  else
+    {
+    config_upper = "NOCONFIG";
+    }
+
+  ImportInfoMapType::const_iterator i =
+    this->ImportInfoMap.find(config_upper);
+  if(i == this->ImportInfoMap.end())
+    {
+    ImportInfo info;
+    this->ComputeImportInfo(config_upper, info);
+    ImportInfoMapType::value_type entry(config_upper, info);
+    i = this->ImportInfoMap.insert(entry).first;
+    }
+
+  if(this->GetType() == cmState::INTERFACE_LIBRARY)
+    {
+    return &i->second;
+    }
+  // If the location is empty then the target is not available for
+  // this configuration.
+  if(i->second.Location.empty() && i->second.ImportLibrary.empty())
+    {
+    return 0;
+    }
+
+  // Return the import information.
+  return &i->second;
+}
+
+//----------------------------------------------------------------------------
+void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config,
+                                 ImportInfo& info) const
+{
+  // This method finds information about an imported target from its
+  // properties.  The "IMPORTED_" namespace is reserved for properties
+  // defined by the project exporting the target.
+
+  // Initialize members.
+  info.NoSOName = false;
+
+  const char* loc = 0;
+  const char* imp = 0;
+  std::string suffix;
+  if (!this->Target->GetMappedConfig(desired_config, &loc, &imp, suffix))
+    {
+    return;
+    }
+
+  // Get the link interface.
+  {
+  std::string linkProp = "INTERFACE_LINK_LIBRARIES";
+  const char *propertyLibs = this->GetProperty(linkProp);
+
+  if (this->GetType() != cmState::INTERFACE_LIBRARY)
+    {
+    if(!propertyLibs)
+      {
+      linkProp = "IMPORTED_LINK_INTERFACE_LIBRARIES";
+      linkProp += suffix;
+      propertyLibs = this->GetProperty(linkProp);
+      }
+
+    if(!propertyLibs)
+      {
+      linkProp = "IMPORTED_LINK_INTERFACE_LIBRARIES";
+      propertyLibs = this->GetProperty(linkProp);
+      }
+    }
+  if(propertyLibs)
+    {
+    info.LibrariesProp = linkProp;
+    info.Libraries = propertyLibs;
+    }
+  }
+  if(this->GetType() == cmState::INTERFACE_LIBRARY)
+    {
+    return;
+    }
+
+  // A provided configuration has been chosen.  Load the
+  // configuration's properties.
+
+  // Get the location.
+  if(loc)
+    {
+    info.Location = loc;
+    }
+  else
+    {
+    std::string impProp = "IMPORTED_LOCATION";
+    impProp += suffix;
+    if(const char* config_location = this->GetProperty(impProp))
+      {
+      info.Location = config_location;
+      }
+    else if(const char* location = this->GetProperty("IMPORTED_LOCATION"))
+      {
+      info.Location = location;
+      }
+    }
+
+  // Get the soname.
+  if(this->GetType() == cmState::SHARED_LIBRARY)
+    {
+    std::string soProp = "IMPORTED_SONAME";
+    soProp += suffix;
+    if(const char* config_soname = this->GetProperty(soProp))
+      {
+      info.SOName = config_soname;
+      }
+    else if(const char* soname = this->GetProperty("IMPORTED_SONAME"))
+      {
+      info.SOName = soname;
+      }
+    }
+
+  // Get the "no-soname" mark.
+  if(this->GetType() == cmState::SHARED_LIBRARY)
+    {
+    std::string soProp = "IMPORTED_NO_SONAME";
+    soProp += suffix;
+    if(const char* config_no_soname = this->GetProperty(soProp))
+      {
+      info.NoSOName = cmSystemTools::IsOn(config_no_soname);
+      }
+    else if(const char* no_soname = this->GetProperty("IMPORTED_NO_SONAME"))
+      {
+      info.NoSOName = cmSystemTools::IsOn(no_soname);
+      }
+    }
+
+  // Get the import library.
+  if(imp)
+    {
+    info.ImportLibrary = imp;
+    }
+  else if(this->GetType() == cmState::SHARED_LIBRARY ||
+          this->Target->IsExecutableWithExports())
+    {
+    std::string impProp = "IMPORTED_IMPLIB";
+    impProp += suffix;
+    if(const char* config_implib = this->GetProperty(impProp))
+      {
+      info.ImportLibrary = config_implib;
+      }
+    else if(const char* implib = this->GetProperty("IMPORTED_IMPLIB"))
+      {
+      info.ImportLibrary = implib;
+      }
+    }
+
+  // Get the link dependencies.
+  {
+  std::string linkProp = "IMPORTED_LINK_DEPENDENT_LIBRARIES";
+  linkProp += suffix;
+  if(const char* config_libs = this->GetProperty(linkProp))
+    {
+    info.SharedDeps = config_libs;
+    }
+  else if(const char* libs =
+          this->GetProperty("IMPORTED_LINK_DEPENDENT_LIBRARIES"))
+    {
+    info.SharedDeps = libs;
+    }
+  }
+
+  // Get the link languages.
+  if(this->Target->LinkLanguagePropagatesToDependents())
+    {
+    std::string linkProp = "IMPORTED_LINK_INTERFACE_LANGUAGES";
+    linkProp += suffix;
+    if(const char* config_libs = this->GetProperty(linkProp))
+      {
+      info.Languages = config_libs;
+      }
+    else if(const char* libs =
+            this->GetProperty("IMPORTED_LINK_INTERFACE_LANGUAGES"))
+      {
+      info.Languages = libs;
+      }
+    }
+
+  // Get the cyclic repetition count.
+  if(this->GetType() == cmState::STATIC_LIBRARY)
+    {
+    std::string linkProp = "IMPORTED_LINK_INTERFACE_MULTIPLICITY";
+    linkProp += suffix;
+    if(const char* config_reps = this->GetProperty(linkProp))
+      {
+      sscanf(config_reps, "%u", &info.Multiplicity);
+      }
+    else if(const char* reps =
+            this->GetProperty("IMPORTED_LINK_INTERFACE_MULTIPLICITY"))
+      {
+      sscanf(reps, "%u", &info.Multiplicity);
+      }
+    }
+}
+
 cmHeadToLinkInterfaceMap&
 cmGeneratorTarget::GetHeadToLinkInterfaceMap(const std::string &config) const
 {
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index e48e36e..f72c85d 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -516,6 +516,28 @@ private:
   cmHeadToLinkInterfaceMap& GetHeadToLinkInterfaceUsageRequirementsMap(
       std::string const& config) const;
 
+  // Cache import information from properties for each configuration.
+  struct ImportInfo
+  {
+    ImportInfo(): NoSOName(false), Multiplicity(0) {}
+    bool NoSOName;
+    int Multiplicity;
+    std::string Location;
+    std::string SOName;
+    std::string ImportLibrary;
+    std::string Languages;
+    std::string Libraries;
+    std::string LibrariesProp;
+    std::string SharedDeps;
+  };
+
+  typedef std::map<std::string, ImportInfo> ImportInfoMapType;
+  mutable ImportInfoMapType ImportInfoMap;
+  void ComputeImportInfo(std::string const& desired_config,
+                         ImportInfo& info) const;
+  ImportInfo const* GetImportInfo(const std::string& config) const;
+
+
   cmLinkInterface const*
     GetImportLinkInterface(const std::string& config,
                            const cmGeneratorTarget* head,
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index c5e19cc..55a9c49 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1316,7 +1316,6 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
   else
     {
     this->Properties.SetProperty(prop, value);
-    this->MaybeInvalidatePropertyCache(prop);
     }
 }
 
@@ -1409,7 +1408,6 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
   else
     {
     this->Properties.AppendProperty(prop, value, asString);
-    this->MaybeInvalidatePropertyCache(prop);
     }
 }
 
@@ -1508,16 +1506,6 @@ void cmTarget::InsertCompileDefinition(std::string const& entry,
 }
 
 //----------------------------------------------------------------------------
-void cmTarget::MaybeInvalidatePropertyCache(const std::string& prop)
-{
-  // Wipe out maps caching information affected by this property.
-  if(this->IsImported() && cmHasLiteralPrefix(prop, "IMPORTED"))
-    {
-    this->ImportInfoMap.clear();
-    }
-}
-
-//----------------------------------------------------------------------------
 static void cmTargetCheckLINK_INTERFACE_LIBRARIES(
   const std::string& prop, const char* value, cmMakefile* context,
   bool imported)
@@ -2248,53 +2236,6 @@ const char* cmTarget::GetExportMacro() const
     }
 }
 
-//----------------------------------------------------------------------------
-cmTarget::ImportInfo const*
-cmTarget::GetImportInfo(const std::string& config) const
-{
-  // There is no imported information for non-imported targets.
-  if(!this->IsImported())
-    {
-    return 0;
-    }
-
-  // Lookup/compute/cache the import information for this
-  // configuration.
-  std::string config_upper;
-  if(!config.empty())
-    {
-    config_upper = cmSystemTools::UpperCase(config);
-    }
-  else
-    {
-    config_upper = "NOCONFIG";
-    }
-
-  ImportInfoMapType::const_iterator i =
-    this->ImportInfoMap.find(config_upper);
-  if(i == this->ImportInfoMap.end())
-    {
-    ImportInfo info;
-    this->ComputeImportInfo(config_upper, info);
-    ImportInfoMapType::value_type entry(config_upper, info);
-    i = this->ImportInfoMap.insert(entry).first;
-    }
-
-  if(this->GetType() == cmState::INTERFACE_LIBRARY)
-    {
-    return &i->second;
-    }
-  // If the location is empty then the target is not available for
-  // this configuration.
-  if(i->second.Location.empty() && i->second.ImportLibrary.empty())
-    {
-    return 0;
-    }
-
-  // Return the import information.
-  return &i->second;
-}
-
 bool cmTarget::GetMappedConfig(std::string const& desired_config,
                                const char** loc,
                                const char** imp,
@@ -2427,176 +2368,6 @@ bool cmTarget::GetMappedConfig(std::string const& desired_config,
 }
 
 //----------------------------------------------------------------------------
-void cmTarget::ComputeImportInfo(std::string const& desired_config,
-                                 ImportInfo& info) const
-{
-  // This method finds information about an imported target from its
-  // properties.  The "IMPORTED_" namespace is reserved for properties
-  // defined by the project exporting the target.
-
-  // Initialize members.
-  info.NoSOName = false;
-
-  const char* loc = 0;
-  const char* imp = 0;
-  std::string suffix;
-  if (!this->GetMappedConfig(desired_config, &loc, &imp, suffix))
-    {
-    return;
-    }
-
-  // Get the link interface.
-  {
-  std::string linkProp = "INTERFACE_LINK_LIBRARIES";
-  const char *propertyLibs = this->GetProperty(linkProp);
-
-  if (this->GetType() != cmState::INTERFACE_LIBRARY)
-    {
-    if(!propertyLibs)
-      {
-      linkProp = "IMPORTED_LINK_INTERFACE_LIBRARIES";
-      linkProp += suffix;
-      propertyLibs = this->GetProperty(linkProp);
-      }
-
-    if(!propertyLibs)
-      {
-      linkProp = "IMPORTED_LINK_INTERFACE_LIBRARIES";
-      propertyLibs = this->GetProperty(linkProp);
-      }
-    }
-  if(propertyLibs)
-    {
-    info.LibrariesProp = linkProp;
-    info.Libraries = propertyLibs;
-    }
-  }
-  if(this->GetType() == cmState::INTERFACE_LIBRARY)
-    {
-    return;
-    }
-
-  // A provided configuration has been chosen.  Load the
-  // configuration's properties.
-
-  // Get the location.
-  if(loc)
-    {
-    info.Location = loc;
-    }
-  else
-    {
-    std::string impProp = "IMPORTED_LOCATION";
-    impProp += suffix;
-    if(const char* config_location = this->GetProperty(impProp))
-      {
-      info.Location = config_location;
-      }
-    else if(const char* location = this->GetProperty("IMPORTED_LOCATION"))
-      {
-      info.Location = location;
-      }
-    }
-
-  // Get the soname.
-  if(this->GetType() == cmState::SHARED_LIBRARY)
-    {
-    std::string soProp = "IMPORTED_SONAME";
-    soProp += suffix;
-    if(const char* config_soname = this->GetProperty(soProp))
-      {
-      info.SOName = config_soname;
-      }
-    else if(const char* soname = this->GetProperty("IMPORTED_SONAME"))
-      {
-      info.SOName = soname;
-      }
-    }
-
-  // Get the "no-soname" mark.
-  if(this->GetType() == cmState::SHARED_LIBRARY)
-    {
-    std::string soProp = "IMPORTED_NO_SONAME";
-    soProp += suffix;
-    if(const char* config_no_soname = this->GetProperty(soProp))
-      {
-      info.NoSOName = cmSystemTools::IsOn(config_no_soname);
-      }
-    else if(const char* no_soname = this->GetProperty("IMPORTED_NO_SONAME"))
-      {
-      info.NoSOName = cmSystemTools::IsOn(no_soname);
-      }
-    }
-
-  // Get the import library.
-  if(imp)
-    {
-    info.ImportLibrary = imp;
-    }
-  else if(this->GetType() == cmState::SHARED_LIBRARY ||
-          this->IsExecutableWithExports())
-    {
-    std::string impProp = "IMPORTED_IMPLIB";
-    impProp += suffix;
-    if(const char* config_implib = this->GetProperty(impProp))
-      {
-      info.ImportLibrary = config_implib;
-      }
-    else if(const char* implib = this->GetProperty("IMPORTED_IMPLIB"))
-      {
-      info.ImportLibrary = implib;
-      }
-    }
-
-  // Get the link dependencies.
-  {
-  std::string linkProp = "IMPORTED_LINK_DEPENDENT_LIBRARIES";
-  linkProp += suffix;
-  if(const char* config_libs = this->GetProperty(linkProp))
-    {
-    info.SharedDeps = config_libs;
-    }
-  else if(const char* libs =
-          this->GetProperty("IMPORTED_LINK_DEPENDENT_LIBRARIES"))
-    {
-    info.SharedDeps = libs;
-    }
-  }
-
-  // Get the link languages.
-  if(this->LinkLanguagePropagatesToDependents())
-    {
-    std::string linkProp = "IMPORTED_LINK_INTERFACE_LANGUAGES";
-    linkProp += suffix;
-    if(const char* config_libs = this->GetProperty(linkProp))
-      {
-      info.Languages = config_libs;
-      }
-    else if(const char* libs =
-            this->GetProperty("IMPORTED_LINK_INTERFACE_LANGUAGES"))
-      {
-      info.Languages = libs;
-      }
-    }
-
-  // Get the cyclic repetition count.
-  if(this->GetType() == cmState::STATIC_LIBRARY)
-    {
-    std::string linkProp = "IMPORTED_LINK_INTERFACE_MULTIPLICITY";
-    linkProp += suffix;
-    if(const char* config_reps = this->GetProperty(linkProp))
-      {
-      sscanf(config_reps, "%u", &info.Multiplicity);
-      }
-    else if(const char* reps =
-            this->GetProperty("IMPORTED_LINK_INTERFACE_MULTIPLICITY"))
-      {
-      sscanf(reps, "%u", &info.Multiplicity);
-      }
-    }
-}
-
-//----------------------------------------------------------------------------
 std::string cmTarget::CheckCMP0004(std::string const& item) const
 {
   // Strip whitespace off the library names because we used to do this
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 7715c7c..fa11953 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -419,32 +419,8 @@ private:
   bool LinkLibrariesForVS6Analyzed;
 #endif
 
-  // Cache import information from properties for each configuration.
-  struct ImportInfo
-  {
-    ImportInfo(): NoSOName(false), Multiplicity(0) {}
-    bool NoSOName;
-    int Multiplicity;
-    std::string Location;
-    std::string SOName;
-    std::string ImportLibrary;
-    std::string Languages;
-    std::string Libraries;
-    std::string LibrariesProp;
-    std::string SharedDeps;
-  };
-
-  typedef std::map<std::string, ImportInfo> ImportInfoMapType;
-  mutable ImportInfoMapType ImportInfoMap;
-
-  ImportInfo const* GetImportInfo(const std::string& config) const;
-  void ComputeImportInfo(std::string const& desired_config,
-                         ImportInfo& info) const;
-
   std::string ProcessSourceItemCMP0049(const std::string& s);
 
-  void MaybeInvalidatePropertyCache(const std::string& prop);
-
   /** Return whether or not the target has a DLL import library.  */
   bool HasImportLibrary() const;
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5794dbc301ace0041c5fc50096cc5331e8ba3c34
commit 5794dbc301ace0041c5fc50096cc5331e8ba3c34
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 16 19:39:58 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Oct 16 20:24:43 2015 +0200

    cmTarget: Inline the essential part of imported target location.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 60c5e64..c5e19cc 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2091,13 +2091,75 @@ const char* cmTarget::GetPrefixVariableInternal(bool implib) const
 
 //----------------------------------------------------------------------------
 std::string
-cmTarget::ImportedGetFullPath(const std::string& config, bool implib) const
+cmTarget::ImportedGetFullPath(const std::string& config, bool pimplib) const
 {
+  assert(this->IsImported());
+
+  // Lookup/compute/cache the import information for this
+  // configuration.
+  std::string config_upper;
+  if(!config.empty())
+    {
+    config_upper = cmSystemTools::UpperCase(config);
+    }
+  else
+    {
+    config_upper = "NOCONFIG";
+    }
+
   std::string result;
-  if(cmTarget::ImportInfo const* info = this->GetImportInfo(config))
+
+  const char* loc = 0;
+  const char* imp = 0;
+  std::string suffix;
+
+  if(this->GetType() != cmState::INTERFACE_LIBRARY
+     && this->GetMappedConfig(config_upper, &loc, &imp, suffix))
     {
-    result = implib? info->ImportLibrary : info->Location;
+    if (!pimplib)
+      {
+      if(loc)
+        {
+        result = loc;
+        }
+      else
+        {
+        std::string impProp = "IMPORTED_LOCATION";
+        impProp += suffix;
+        if(const char* config_location = this->GetProperty(impProp))
+          {
+          result = config_location;
+          }
+        else if(const char* location =
+                this->GetProperty("IMPORTED_LOCATION"))
+          {
+          result = location;
+          }
+        }
+      }
+    else
+      {
+      if(imp)
+        {
+        result = imp;
+        }
+      else if(this->GetType() == cmState::SHARED_LIBRARY ||
+              this->IsExecutableWithExports())
+        {
+        std::string impProp = "IMPORTED_IMPLIB";
+        impProp += suffix;
+        if(const char* config_implib = this->GetProperty(impProp))
+          {
+          result = config_implib;
+          }
+        else if(const char* implib = this->GetProperty("IMPORTED_IMPLIB"))
+          {
+          result = implib;
+          }
+        }
+      }
     }
+
   if(result.empty())
     {
     result = this->GetName();

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a892b285f8c621ba50f45f5c4218980c911fd1b6
commit a892b285f8c621ba50f45f5c4218980c911fd1b6
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 16 19:19:50 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Oct 16 20:24:43 2015 +0200

    cmGeneratorTarget: Move ImportedGetLocation from cmTarget.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 98150df..2ef2f5c 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -3344,6 +3344,16 @@ std::string cmGeneratorTarget::GetFullNameInternal(const std::string& config,
 }
 
 //----------------------------------------------------------------------------
+const char*
+cmGeneratorTarget::ImportedGetLocation(const std::string& config) const
+{
+  static std::string location;
+  assert(this->IsImported());
+  location = this->Target->ImportedGetFullPath(config, false);
+  return location.c_str();
+}
+
+//----------------------------------------------------------------------------
 std::string cmGeneratorTarget::GetFullNameImported(const std::string& config,
                                                    bool implib) const
 {
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index cf8c18f..e48e36e 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -443,6 +443,8 @@ public:
       no soname at all.  */
   bool IsImportedSharedLibWithoutSOName(const std::string& config) const;
 
+  const char* ImportedGetLocation(const std::string& config) const;
+
 private:
   friend class cmTargetTraceDependencies;
   struct SourceEntry { std::vector<cmSourceFile*> Depends; };
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index f9875b3..41172f6 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -132,6 +132,7 @@ static void SetupAutoMocTarget(cmGeneratorTarget const* target,
                           std::map<std::string, std::string> &configIncludes,
                           std::map<std::string, std::string> &configDefines)
 {
+  cmLocalGenerator* lg = target->GetLocalGenerator();
   cmMakefile* makefile = target->Target->GetMakefile();
 
   const char* tmp = target->GetProperty("AUTOMOC_MOC_OPTIONS");
@@ -188,7 +189,8 @@ static void SetupAutoMocTarget(cmGeneratorTarget const* target,
   const char *qtVersion = makefile->GetDefinition("_target_qt_version");
   if (strcmp(qtVersion, "5") == 0)
     {
-    cmTarget *qt5Moc = makefile->FindTargetToUse("Qt5::moc");
+    cmGeneratorTarget *qt5Moc =
+        lg->FindGeneratorTargetToUse("Qt5::moc");
     if (!qt5Moc)
       {
       cmSystemTools::Error("Qt5::moc target not found ",
@@ -200,7 +202,8 @@ static void SetupAutoMocTarget(cmGeneratorTarget const* target,
     }
   else if (strcmp(qtVersion, "4") == 0)
     {
-    cmTarget *qt4Moc = makefile->FindTargetToUse("Qt4::moc");
+    cmGeneratorTarget *qt4Moc =
+        lg->FindGeneratorTargetToUse("Qt4::moc");
     if (!qt4Moc)
       {
       cmSystemTools::Error("Qt4::moc target not found ",
@@ -230,6 +233,7 @@ static void SetupAutoUicTarget(cmGeneratorTarget const* target,
                           std::vector<std::string> const& skipUic,
                           std::map<std::string, std::string> &configUicOptions)
 {
+  cmLocalGenerator* lg = target->GetLocalGenerator();
   cmMakefile *makefile = target->Target->GetMakefile();
 
   std::set<std::string> skipped;
@@ -303,7 +307,8 @@ static void SetupAutoUicTarget(cmGeneratorTarget const* target,
   std::string targetName = target->GetName();
   if (strcmp(qtVersion, "5") == 0)
     {
-    cmTarget *qt5Uic = makefile->FindTargetToUse("Qt5::uic");
+    cmGeneratorTarget *qt5Uic =
+        lg->FindGeneratorTargetToUse("Qt5::uic");
     if (!qt5Uic)
       {
       // Project does not use Qt5Widgets, but has AUTOUIC ON anyway
@@ -316,7 +321,8 @@ static void SetupAutoUicTarget(cmGeneratorTarget const* target,
     }
   else if (strcmp(qtVersion, "4") == 0)
     {
-    cmTarget *qt4Uic = makefile->FindTargetToUse("Qt4::uic");
+    cmGeneratorTarget *qt4Uic =
+        lg->FindGeneratorTargetToUse("Qt4::uic");
     if (!qt4Uic)
       {
       cmSystemTools::Error("Qt4::uic target not found ",
@@ -335,6 +341,7 @@ static void SetupAutoUicTarget(cmGeneratorTarget const* target,
 
 static std::string GetRccExecutable(cmGeneratorTarget const* target)
 {
+  cmLocalGenerator* lg = target->GetLocalGenerator();
   cmMakefile *makefile = target->Target->GetMakefile();
   const char *qtVersion = makefile->GetDefinition("_target_qt_version");
   if (!qtVersion)
@@ -355,7 +362,8 @@ static std::string GetRccExecutable(cmGeneratorTarget const* target)
   std::string targetName = target->GetName();
   if (strcmp(qtVersion, "5") == 0)
     {
-    cmTarget *qt5Rcc = makefile->FindTargetToUse("Qt5::rcc");
+    cmGeneratorTarget *qt5Rcc =
+        lg->FindGeneratorTargetToUse("Qt5::rcc");
     if (!qt5Rcc)
       {
       cmSystemTools::Error("Qt5::rcc target not found ",
@@ -366,7 +374,8 @@ static std::string GetRccExecutable(cmGeneratorTarget const* target)
     }
   else if (strcmp(qtVersion, "4") == 0)
     {
-    cmTarget *qt4Rcc = makefile->FindTargetToUse("Qt4::rcc");
+    cmGeneratorTarget *qt4Rcc =
+        lg->FindGeneratorTargetToUse("Qt4::rcc");
     if (!qt4Rcc)
       {
       cmSystemTools::Error("Qt4::rcc target not found ",
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index bd01140..60c5e64 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1628,15 +1628,6 @@ bool cmTarget::HaveWellDefinedOutputFiles() const
 }
 
 //----------------------------------------------------------------------------
-const char* cmTarget::ImportedGetLocation(const std::string& config) const
-{
-  static std::string location;
-  assert(this->IsImported());
-  location = this->ImportedGetFullPath(config, false);
-  return location.c_str();
-}
-
-//----------------------------------------------------------------------------
 void cmTarget::GetTargetVersion(int& major, int& minor) const
 {
   int patch;
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index a2846df..7715c7c 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -217,8 +217,6 @@ public:
       the link dependencies of this target.  */
   std::string CheckCMP0004(std::string const& item) const;
 
-  const char* ImportedGetLocation(const std::string& config) const;
-
   /** Get the target major and minor version numbers interpreted from
       the VERSION property.  Version 0 is returned if the property is
       not set or cannot be parsed.  */

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cb8c728f17a61732064280ddb98203cb277e5a3c
commit cb8c728f17a61732064280ddb98203cb277e5a3c
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 16 19:19:50 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Oct 16 20:24:43 2015 +0200

    cmGeneratorTarget: Move GetFullNameImported from cmTarget.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 806d27d..98150df 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1605,7 +1605,7 @@ cmGeneratorTarget::GetFullName(const std::string& config, bool implib) const
 {
   if(this->Target->IsImported())
     {
-    return this->Target->GetFullNameImported(config, implib);
+    return this->GetFullNameImported(config, implib);
     }
   else
     {
@@ -3344,6 +3344,14 @@ std::string cmGeneratorTarget::GetFullNameInternal(const std::string& config,
 }
 
 //----------------------------------------------------------------------------
+std::string cmGeneratorTarget::GetFullNameImported(const std::string& config,
+                                                   bool implib) const
+{
+  return cmSystemTools::GetFilenameName(
+    this->Target->ImportedGetFullPath(config, implib));
+}
+
+//----------------------------------------------------------------------------
 void cmGeneratorTarget::GetFullNameInternal(const std::string& config,
                                             bool implib,
                                             std::string& outPrefix,
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 39c9772..cf8c18f 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -229,6 +229,9 @@ public:
   void
   GetObjectLibrariesCMP0026(std::vector<cmGeneratorTarget*>& objlibs) const;
 
+  std::string GetFullNameImported(const std::string& config,
+                                  bool implib) const;
+
   bool GetConfigCommonSourceFiles(std::vector<cmSourceFile*>& files) const;
 
   bool HaveBuildTreeRPATH(const std::string& config) const;
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index a7372e3..bd01140 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2100,14 +2100,6 @@ const char* cmTarget::GetPrefixVariableInternal(bool implib) const
 
 //----------------------------------------------------------------------------
 std::string
-cmTarget::GetFullNameImported(const std::string& config, bool implib) const
-{
-  return cmSystemTools::GetFilenameName(
-    this->ImportedGetFullPath(config, implib));
-}
-
-//----------------------------------------------------------------------------
-std::string
 cmTarget::ImportedGetFullPath(const std::string& config, bool implib) const
 {
   std::string result;
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index dda6e6a..a2846df 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -383,9 +383,6 @@ private:
   void SetPropertyDefault(const std::string& property,
                           const char* default_value);
 
-  std::string GetFullNameImported(const std::string& config,
-                                  bool implib) const;
-
   std::string ImportedGetFullPath(const std::string& config,
                                   bool implib) const;
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fb4fca0b5efabdf061bd256ed9d35edae6f42b9d
commit fb4fca0b5efabdf061bd256ed9d35edae6f42b9d
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 16 19:19:49 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Oct 16 20:24:43 2015 +0200

    cmGeneratorTarget: Access global state through LocalGenerator.

diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index 96fcc90..f7cc502 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -400,8 +400,7 @@ cmCommonTargetGenerator::GetLinkedTargetDirectories() const
                 && emitted.insert(linkee).second)
         {
         cmLocalGenerator* lg = linkee->GetLocalGenerator();
-        cmMakefile* mf = linkee->Target->GetMakefile();
-        std::string di = mf->GetCurrentBinaryDirectory();
+        std::string di = lg->GetCurrentBinaryDirectory();
         di += "/";
         di += lg->GetTargetDirectory(linkee);
         dirs.push_back(di);
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index 945c284..c7c0e73 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -1497,11 +1497,11 @@ static const struct TargetPolicyNode : public cmGeneratorExpressionNode
       const char *policy = targetPolicyWhitelist[i];
       if (parameters.front() == policy)
         {
-        cmMakefile *mf = context->HeadTarget->Target->GetMakefile();
+        cmLocalGenerator* lg = context->HeadTarget->GetLocalGenerator();
         switch(statusForTarget(context->HeadTarget, policy))
           {
           case cmPolicies::WARN:
-            mf->IssueMessage(cmake::AUTHOR_WARNING,
+            lg->IssueMessage(cmake::AUTHOR_WARNING,
                         cmPolicies::GetPolicyWarning(policyForString(policy)));
           case cmPolicies::REQUIRED_IF_USED:
           case cmPolicies::REQUIRED_ALWAYS:
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index d3b5d10..806d27d 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -985,7 +985,7 @@ static bool processSources(cmGeneratorTarget const* tgt,
         {
         if(!e.empty())
           {
-          cmake* cm = mf->GetCMakeInstance();
+          cmake* cm = tgt->GetLocalGenerator()->GetCMakeInstance();
           cm->IssueMessage(cmake::FATAL_ERROR, e,
                           tgt->Target->GetBacktrace());
           }
@@ -1043,7 +1043,7 @@ void cmGeneratorTarget::GetSourceFiles(std::vector<std::string> &files,
 {
   assert(this->GetType() != cmState::INTERFACE_LIBRARY);
 
-  if (!this->Makefile->GetGlobalGenerator()->GetConfigureDoneCMP0026())
+  if (!this->LocalGenerator->GetGlobalGenerator()->GetConfigureDoneCMP0026())
     {
     // At configure-time, this method can be called as part of getting the
     // LOCATION property or to export() a file to be include()d.  However
@@ -1088,7 +1088,7 @@ void cmGeneratorTarget::GetSourceFiles(std::vector<std::string> &files,
                                  "SOURCES")
                         != debugProperties.end();
 
-  if (this->Makefile->GetGlobalGenerator()->GetConfigureDoneCMP0026())
+  if (this->LocalGenerator->GetGlobalGenerator()->GetConfigureDoneCMP0026())
     {
     this->DebugSourcesDone = true;
     }
@@ -1447,7 +1447,7 @@ bool cmGeneratorTarget::HasMacOSXRpathInstallNameDir(
     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();
+    cmake* cm = this->LocalGenerator->GetCMakeInstance();
     cm->IssueMessage(cmake::FATAL_ERROR, w.str(),
                      this->Target->GetBacktrace());
     }
@@ -1474,7 +1474,7 @@ bool cmGeneratorTarget::MacOSXRpathInstallNameDirDefault() const
 
   if(cmp0042 == cmPolicies::WARN)
     {
-    this->Makefile->GetGlobalGenerator()->
+    this->LocalGenerator->GetGlobalGenerator()->
       AddCMP0042WarnTarget(this->GetName());
     }
 
@@ -1782,14 +1782,12 @@ class cmTargetSelectLinker
 {
   int Preference;
   cmGeneratorTarget const* Target;
-  cmMakefile* Makefile;
   cmGlobalGenerator* GG;
   std::set<std::string> Preferred;
 public:
   cmTargetSelectLinker(cmGeneratorTarget const* target)
       : Preference(0), Target(target)
     {
-    this->Makefile = this->Target->Makefile;
     this->GG = this->Target->GetLocalGenerator()->GetGlobalGenerator();
     }
   void Consider(const char* lang)
@@ -1823,7 +1821,7 @@ public:
         e << "  " << *li << "\n";
         }
       e << "Set the LINKER_LANGUAGE property for this target.";
-      cmake* cm = this->Makefile->GetCMakeInstance();
+      cmake* cm = this->Target->GetLocalGenerator()->GetCMakeInstance();
       cm->IssueMessage(cmake::FATAL_ERROR, e.str(),
                        this->Target->Target->GetBacktrace());
       }
@@ -4823,7 +4821,7 @@ bool cmGeneratorTarget::ComputeOutputDir(const std::string& config,
   // specified as a relative path.  Treat a relative path as
   // relative to the current output directory for this makefile.
   out = (cmSystemTools::CollapseFullPath
-         (out, this->Makefile->GetCurrentBinaryDirectory()));
+         (out, this->LocalGenerator->GetCurrentBinaryDirectory()));
 
   // The generator may add the configuration's subdirectory.
   if(!conf.empty())
@@ -4888,7 +4886,7 @@ bool cmGeneratorTarget::ComputePDBOutputDir(const std::string& kind,
   // specified as a relative path.  Treat a relative path as
   // relative to the current output directory for this makefile.
   out = (cmSystemTools::CollapseFullPath
-         (out, this->Makefile->GetCurrentBinaryDirectory()));
+         (out, this->LocalGenerator->GetCurrentBinaryDirectory()));
 
   // The generator may add the configuration's subdirectory.
   if(!conf.empty())
@@ -5555,7 +5553,7 @@ bool cmGeneratorTarget::HasImportLibrary() const
 //----------------------------------------------------------------------------
 std::string cmGeneratorTarget::GetSupportDirectory() const
 {
-  std::string dir = this->Makefile->GetCurrentBinaryDirectory();
+  std::string dir = this->LocalGenerator->GetCurrentBinaryDirectory();
   dir += cmake::GetCMakeFilesDirectory();
   dir += "/";
   dir += this->GetName();

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=50fb2ad6463c500fde44c000c777aa3ac1cffc7e
commit 50fb2ad6463c500fde44c000c777aa3ac1cffc7e
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 16 19:19:49 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Oct 16 20:17:32 2015 +0200

    cmGeneratorTarget: Port Utility items to cmGeneratorTarget.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 52ae310..d3b5d10 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -774,9 +774,8 @@ std::set<cmLinkItem> const& cmGeneratorTarget::GetUtilityItems() const
     for(std::set<std::string>::const_iterator i = utilities.begin();
         i != utilities.end(); ++i)
       {
-      cmTarget* tgt = this->Makefile->FindTargetToUse(*i);
-      cmGeneratorTarget* gt = tgt ? this->GlobalGenerator
-          ->GetGeneratorTarget(tgt) : 0;
+      cmGeneratorTarget* gt =
+          this->LocalGenerator->FindGeneratorTargetToUse(*i);
       this->UtilityItems.insert(cmLinkItem(*i, gt));
       }
     }

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d233030f5bcfe2509b82433f7df6383cd301e34e
commit d233030f5bcfe2509b82433f7df6383cd301e34e
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 16 19:19:49 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Oct 16 20:17:31 2015 +0200

    cmGeneratorTarget: Port implementation to cmGeneratorTarget.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 994fcb1..52ae310 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -5483,13 +5483,14 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
 cmGeneratorTarget*
 cmGeneratorTarget::FindTargetToLink(std::string const& name) const
 {
-  cmTarget const* tgt = this->Makefile->FindTargetToUse(name);
+  cmGeneratorTarget* tgt =
+      this->LocalGenerator->FindGeneratorTargetToUse(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(tgt && tgt->GetType() == cmState::EXECUTABLE &&
-     !tgt->IsExecutableWithExports())
+     !tgt->Target->IsExecutableWithExports())
     {
     tgt = 0;
     }
@@ -5502,17 +5503,13 @@ cmGeneratorTarget::FindTargetToLink(std::string const& name) const
       "allowed.  "
       "One may link only to STATIC or SHARED libraries, or to executables "
       "with the ENABLE_EXPORTS property set.";
-    cmake* cm = this->Makefile->GetCMakeInstance();
+    cmake* cm = this->LocalGenerator->GetCMakeInstance();
     cm->IssueMessage(cmake::FATAL_ERROR, e.str(),
                      this->Target->GetBacktrace());
     tgt = 0;
     }
 
-  if (!tgt)
-    {
-    return 0;
-    }
-  return this->GlobalGenerator->GetGeneratorTarget(tgt);
+  return tgt;
 }
 
 //----------------------------------------------------------------------------

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0ebe2bbf4ae7f19b10f8374313b2bbd6fcd6c3da
commit 0ebe2bbf4ae7f19b10f8374313b2bbd6fcd6c3da
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 16 19:19:49 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Oct 16 20:17:31 2015 +0200

    cmGeneratorTarget: Port language computation to cmGeneratorTarget.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 9b3bf28..994fcb1 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -5276,10 +5276,10 @@ void cmGeneratorTarget::GetLanguages(std::set<std::string>& languages,
           i = externalObjects.begin(); i != externalObjects.end(); ++i)
       {
       std::string objLib = (*i)->GetObjectLibrary();
-      if (cmTarget* tgt = this->Makefile->FindTargetToUse(objLib))
+      if (cmGeneratorTarget* tgt =
+          this->LocalGenerator->FindGeneratorTargetToUse(objLib))
         {
-        objectLibraries.push_back(this->GlobalGenerator
-                                  ->GetGeneratorTarget(tgt));
+        objectLibraries.push_back(tgt);
         }
       }
     }

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=60bd9f9c92faae368fab1c44cf81b489c6a875cb
commit 60bd9f9c92faae368fab1c44cf81b489c6a875cb
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 16 19:19:48 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Oct 16 20:17:22 2015 +0200

    cmGeneratorTarget: Move GetObjectLibrariesCMP0026 from cmTarget.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index e4abfd3..9b3bf28 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -5201,6 +5201,46 @@ bool cmGeneratorTarget::GetConfigCommonSourceFiles(
 }
 
 //----------------------------------------------------------------------------
+void cmGeneratorTarget::GetObjectLibrariesCMP0026(
+    std::vector<cmGeneratorTarget*>& objlibs) const
+{
+  // At configure-time, this method can be called as part of getting the
+  // LOCATION property or to export() a file to be include()d.  However
+  // there is no cmGeneratorTarget at configure-time, so search the SOURCES
+  // for TARGET_OBJECTS instead for backwards compatibility with OLD
+  // behavior of CMP0024 and CMP0026 only.
+  cmStringRange rng = this->Target->GetSourceEntries();
+  for(std::vector<std::string>::const_iterator
+        i = rng.begin(); i != rng.end(); ++i)
+    {
+    std::string const& entry = *i;
+
+    std::vector<std::string> files;
+    cmSystemTools::ExpandListArgument(entry, files);
+    for (std::vector<std::string>::const_iterator
+        li = files.begin(); li != files.end(); ++li)
+      {
+      if(cmHasLiteralPrefix(*li, "$<TARGET_OBJECTS:") &&
+          (*li)[li->size() - 1] == '>')
+        {
+        std::string objLibName = li->substr(17, li->size()-18);
+
+        if (cmGeneratorExpression::Find(objLibName) != std::string::npos)
+          {
+          continue;
+          }
+        cmGeneratorTarget *objLib =
+            this->LocalGenerator->FindGeneratorTargetToUse(objLibName);
+        if(objLib)
+          {
+          objlibs.push_back(objLib);
+          }
+        }
+      }
+    }
+}
+
+//----------------------------------------------------------------------------
 void cmGeneratorTarget::GetLanguages(std::set<std::string>& languages,
                             const std::string& config) const
 {
@@ -5220,14 +5260,13 @@ void cmGeneratorTarget::GetLanguages(std::set<std::string>& languages,
   std::vector<cmSourceFile const*> externalObjects;
   if (!this->GlobalGenerator->GetConfigureDoneCMP0026())
     {
-    std::vector<cmTarget*> objectTargets;
-    this->Target->GetObjectLibrariesCMP0026(objectTargets);
+    std::vector<cmGeneratorTarget*> objectTargets;
+    this->GetObjectLibrariesCMP0026(objectTargets);
     objectLibraries.reserve(objectTargets.size());
-    for (std::vector<cmTarget*>::const_iterator it = objectTargets.begin();
-         it != objectTargets.end(); ++it)
+    for (std::vector<cmGeneratorTarget*>::const_iterator it =
+         objectTargets.begin(); it != objectTargets.end(); ++it)
       {
-      objectLibraries.push_back(this->GlobalGenerator
-                                ->GetGeneratorTarget(*it));
+      objectLibraries.push_back(*it);
       }
     }
   else
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 05a7d4d..39c9772 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -226,6 +226,9 @@ public:
   void GetLanguages(std::set<std::string>& languages,
                     std::string const& config) const;
 
+  void
+  GetObjectLibrariesCMP0026(std::vector<cmGeneratorTarget*>& objlibs) const;
+
   bool GetConfigCommonSourceFiles(std::vector<cmSourceFile*>& files) const;
 
   bool HaveBuildTreeRPATH(const std::string& config) const;
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index fecdc45..a7372e3 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2204,45 +2204,6 @@ const char* cmTarget::GetExportMacro() const
 }
 
 //----------------------------------------------------------------------------
-void
-cmTarget::GetObjectLibrariesCMP0026(std::vector<cmTarget*>& objlibs) const
-{
-  // At configure-time, this method can be called as part of getting the
-  // LOCATION property or to export() a file to be include()d.  However
-  // there is no cmGeneratorTarget at configure-time, so search the SOURCES
-  // for TARGET_OBJECTS instead for backwards compatibility with OLD
-  // behavior of CMP0024 and CMP0026 only.
-  for(std::vector<std::string>::const_iterator
-        i = this->Internal->SourceEntries.begin();
-      i != this->Internal->SourceEntries.end(); ++i)
-    {
-    std::string const& entry = *i;
-
-    std::vector<std::string> files;
-    cmSystemTools::ExpandListArgument(entry, files);
-    for (std::vector<std::string>::const_iterator
-        li = files.begin(); li != files.end(); ++li)
-      {
-      if(cmHasLiteralPrefix(*li, "$<TARGET_OBJECTS:") &&
-          (*li)[li->size() - 1] == '>')
-        {
-        std::string objLibName = li->substr(17, li->size()-18);
-
-        if (cmGeneratorExpression::Find(objLibName) != std::string::npos)
-          {
-          continue;
-          }
-        cmTarget *objLib = this->Makefile->FindTargetToUse(objLibName);
-        if(objLib)
-          {
-          objlibs.push_back(objLib);
-          }
-        }
-      }
-    }
-}
-
-//----------------------------------------------------------------------------
 cmTarget::ImportInfo const*
 cmTarget::GetImportInfo(const std::string& config) const
 {
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index c0b9e09..dda6e6a 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -213,8 +213,6 @@ public:
 
   bool IsImported() const {return this->IsImportedTarget;}
 
-  void GetObjectLibrariesCMP0026(std::vector<cmTarget*>& objlibs) 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;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=82a6eaf4d0381f0e3236dbd067fe853653bbe6b5
commit 82a6eaf4d0381f0e3236dbd067fe853653bbe6b5
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 16 19:19:48 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Oct 16 20:17:13 2015 +0200

    cmGeneratorTarget: Port TraceDependencies to cmTarget.
    
    The problem of needing cmTarget is not solved with this, but the removal
    of the cmTarget member is valuable.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 466d3c2..e4abfd3 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -2120,9 +2120,9 @@ public:
   cmTargetTraceDependencies(cmGeneratorTarget* target);
   void Trace();
 private:
-  cmTarget* Target;
   cmGeneratorTarget* GeneratorTarget;
   cmMakefile* Makefile;
+  cmLocalGenerator* LocalGenerator;
   cmGlobalGenerator const* GlobalGenerator;
   typedef cmGeneratorTarget::SourceEntry SourceEntry;
   SourceEntry* CurrentEntry;
@@ -2146,11 +2146,12 @@ private:
 //----------------------------------------------------------------------------
 cmTargetTraceDependencies
 ::cmTargetTraceDependencies(cmGeneratorTarget* target):
-  Target(target->Target), GeneratorTarget(target)
+  GeneratorTarget(target)
 {
   // Convenience.
-  this->Makefile = this->Target->GetMakefile();
-  this->GlobalGenerator = target->GetLocalGenerator()->GetGlobalGenerator();
+  this->Makefile = target->Target->GetMakefile();
+  this->LocalGenerator = target->GetLocalGenerator();
+  this->GlobalGenerator = this->LocalGenerator->GetGlobalGenerator();
   this->CurrentEntry = 0;
 
   // Queue all the source files already specified for the target.
@@ -2193,9 +2194,12 @@ cmTargetTraceDependencies
     }
 
   // Queue pre-build, pre-link, and post-build rule dependencies.
-  this->CheckCustomCommands(this->Target->GetPreBuildCommands());
-  this->CheckCustomCommands(this->Target->GetPreLinkCommands());
-  this->CheckCustomCommands(this->Target->GetPostBuildCommands());
+  this->CheckCustomCommands(
+        this->GeneratorTarget->Target->GetPreBuildCommands());
+  this->CheckCustomCommands(
+        this->GeneratorTarget->Target->GetPreLinkCommands());
+  this->CheckCustomCommands(
+        this->GeneratorTarget->Target->GetPostBuildCommands());
 }
 
 //----------------------------------------------------------------------------
@@ -2324,7 +2328,7 @@ bool cmTargetTraceDependencies::IsUtility(std::string const& dep)
         tLocation = cmSystemTools::CollapseFullPath(tLocation);
         if(depLocation == tLocation)
           {
-          this->Target->AddUtility(util);
+          this->GeneratorTarget->Target->AddUtility(util);
           return true;
           }
         }
@@ -2333,7 +2337,7 @@ bool cmTargetTraceDependencies::IsUtility(std::string const& dep)
       {
       // The original name of the dependency was not a full path.  It
       // must name a target, so add the target-level dependency.
-      this->Target->AddUtility(util);
+      this->GeneratorTarget->Target->AddUtility(util);
       return true;
       }
     }
@@ -2359,7 +2363,8 @@ cmTargetTraceDependencies
     {
     std::string const& command = *cit->begin();
     // Check for a target with this name.
-    if(cmTarget* t = this->Makefile->FindTargetToUse(command))
+    if(cmGeneratorTarget* t =
+       this->LocalGenerator->FindGeneratorTargetToUse(command))
       {
       if(t->GetType() == cmState::EXECUTABLE)
         {
@@ -2367,7 +2372,7 @@ cmTargetTraceDependencies
         // this project.  Add the target-level dependency to make
         // sure the executable is up to date before this custom
         // command possibly runs.
-        this->Target->AddUtility(command);
+        this->GeneratorTarget->Target->AddUtility(command);
         }
       }
 
@@ -2386,7 +2391,7 @@ cmTargetTraceDependencies
   for(std::set<cmGeneratorTarget*>::iterator ti = targets.begin();
       ti != targets.end(); ++ti)
     {
-    this->Target->AddUtility((*ti)->GetName());
+    this->GeneratorTarget->Target->AddUtility((*ti)->GetName());
     }
 
   // Queue the custom command dependencies.

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8aaed08696a7444b80b6319e2b5af320ee589658
commit 8aaed08696a7444b80b6319e2b5af320ee589658
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 16 19:19:48 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Oct 16 20:15:03 2015 +0200

    cmGeneratorTarget: Port object library handling to cmGeneratorTarget.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 6f91d1a..466d3c2 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -2004,27 +2004,26 @@ cmGeneratorTarget::UseObjectLibraries(std::vector<std::string>& objs,
 {
   std::vector<cmSourceFile const*> objectFiles;
   this->GetExternalObjects(objectFiles, config);
-  std::vector<cmTarget*> objectLibraries;
+  std::vector<cmGeneratorTarget*> objectLibraries;
   for(std::vector<cmSourceFile const*>::const_iterator
       it = objectFiles.begin(); it != objectFiles.end(); ++it)
     {
     std::string objLib = (*it)->GetObjectLibrary();
-    if (cmTarget* tgt = this->Makefile->FindTargetToUse(objLib))
+    if (cmGeneratorTarget* tgt =
+        this->LocalGenerator->FindGeneratorTargetToUse(objLib))
       {
       objectLibraries.push_back(tgt);
       }
     }
 
-  std::vector<cmTarget*>::const_iterator end
+  std::vector<cmGeneratorTarget*>::const_iterator end
       = cmRemoveDuplicates(objectLibraries);
 
-  for(std::vector<cmTarget*>::const_iterator
+  for(std::vector<cmGeneratorTarget*>::const_iterator
         ti = objectLibraries.begin();
       ti != end; ++ti)
     {
-    cmTarget* objLib = *ti;
-    cmGeneratorTarget* ogt =
-      this->GlobalGenerator->GetGeneratorTarget(objLib);
+    cmGeneratorTarget* ogt = *ti;
     std::vector<cmSourceFile const*> objectSources;
     ogt->GetObjectSources(objectSources, config);
     for(std::vector<cmSourceFile const*>::const_iterator

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=393654bf49f2c8d86e9ec88fc3c8322497432aea
commit 393654bf49f2c8d86e9ec88fc3c8322497432aea
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 16 19:19:48 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Oct 16 19:20:17 2015 +0200

    cmGeneratorTarget: Port internal class to cmGeneratorTarget.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 4fd9cec..6f91d1a 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1691,7 +1691,7 @@ public:
                                cmGeneratorTarget const* head):
     Config(config), Languages(languages), HeadTarget(head),
     Makefile(target->Target->GetMakefile()), Target(target)
-  { this->Visited.insert(target->Target); }
+  { this->Visited.insert(target); }
 
   void Visit(cmLinkItem const& item)
     {
@@ -1732,7 +1732,7 @@ public:
         }
       return;
       }
-    if(!this->Visited.insert(item.Target->Target).second)
+    if(!this->Visited.insert(item.Target).second)
       {
       return;
       }
@@ -1758,7 +1758,7 @@ private:
   cmGeneratorTarget const* HeadTarget;
   cmMakefile* Makefile;
   const cmGeneratorTarget* Target;
-  std::set<cmTarget const*> Visited;
+  std::set<cmGeneratorTarget const*> Visited;
 };
 
 //----------------------------------------------------------------------------

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

Summary of changes:
 Source/cmCommonTargetGenerator.cxx             |   16 +-
 Source/cmComputeTargetDepends.cxx              |    2 +-
 Source/cmCustomCommandGenerator.cxx            |    2 +-
 Source/cmExtraSublimeTextGenerator.cxx         |    6 +-
 Source/cmGeneratorExpressionNode.cxx           |    4 +-
 Source/cmGeneratorTarget.cxx                   |  537 ++++++++++++++++++++----
 Source/cmGeneratorTarget.h                     |   51 +++
 Source/cmGlobalUnixMakefileGenerator3.cxx      |    6 +-
 Source/cmGlobalXCodeGenerator.cxx              |    4 +-
 Source/cmLocalGenerator.cxx                    |   76 ++--
 Source/cmLocalGenerator.h                      |   29 +-
 Source/cmLocalGhsMultiGenerator.cxx            |    2 +-
 Source/cmLocalUnixMakefileGenerator3.cxx       |   26 +-
 Source/cmLocalUnixMakefileGenerator3.h         |    9 +-
 Source/cmLocalVisualStudio6Generator.cxx       |    2 +-
 Source/cmLocalVisualStudio7Generator.cxx       |    8 +-
 Source/cmLocalVisualStudio7Generator.h         |    3 +-
 Source/cmMakefileExecutableTargetGenerator.cxx |   18 +-
 Source/cmMakefileLibraryTargetGenerator.cxx    |   38 +-
 Source/cmMakefileTargetGenerator.cxx           |   26 +-
 Source/cmMakefileUtilityTargetGenerator.cxx    |   11 +-
 Source/cmNinjaNormalTargetGenerator.cxx        |    9 +-
 Source/cmNinjaTargetGenerator.cxx              |   13 +-
 Source/cmNinjaUtilityTargetGenerator.cxx       |    3 +-
 Source/cmOSXBundleGenerator.cxx                |    6 +-
 Source/cmQtAutoGeneratorInitializer.cxx        |   23 +-
 Source/cmTarget.cxx                            |  463 +++-----------------
 Source/cmTarget.h                              |   53 ---
 Source/cmVisualStudio10TargetGenerator.cxx     |  128 +++---
 29 files changed, 831 insertions(+), 743 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list