[Cmake-commits] CMake branch, next, updated. v3.4.0-rc1-639-gc9224a0

Stephen Kelly steveire at gmail.com
Sat Oct 17 09:27:32 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  c9224a0aa83711e24dbda9514c7107fa1bce19c5 (commit)
       via  cefb623d84c7657574c3dc2cc62ff94f0d65acae (commit)
       via  429440edab6f0e15991f281928e9c38f798b4e4a (commit)
       via  39540916916e390fc7059f77f646cd7f341693b9 (commit)
       via  80c97771319f3ab6d32ffc77c2660d863e7a7166 (commit)
       via  0c454746a0865d2310fb0746a85c5491df196b72 (commit)
       via  943b26f4f39d94d50d1f0f9b84ef139225eb921f (commit)
       via  1884d054d86a1e8d326cdcbc904a2d4b34382a2b (commit)
       via  52b56835e39b93a42f7c5235b8469178dfc5db12 (commit)
       via  4f1135ba712f145edb70299d38ac539d70c13c42 (commit)
       via  274d73e8616430028ec1245ba6cdc66f73d7cdba (commit)
       via  80bfcc17eff2681012a234275f6f9bb60b84142e (commit)
       via  d693e2fca03d03f12f02c38270543b29b0270600 (commit)
       via  bf32afb11df8ca3e03c418a9073941dd3e12fb5c (commit)
       via  a4d256a66132604486d047aa019de58f398b408d (commit)
       via  772e91eba562f466e9ce11dfc7b61a8c716f7afb (commit)
       via  10902e4a6c66162c165cf804e46c8879290244a3 (commit)
      from  640dde743eaf4e35012d35b51c64fb3e819372fc (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=c9224a0aa83711e24dbda9514c7107fa1bce19c5
commit c9224a0aa83711e24dbda9514c7107fa1bce19c5
Merge: 640dde74 cefb623
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Oct 17 09:27:28 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sat Oct 17 09:27:28 2015 -0400

    Merge topic 'use-generator-target' into next
    
    cefb623d cmGeneratorTarget: Move IsCFBundleOnApple from cmTarget.
    429440ed cmGeneratorTarget: Move IsXCTestOnApple from cmTarget.
    39540916 cmGeneratorTarget: Copy IsAppBundleOnApple from cmTarget.
    80c97771 cmGeneratorTarget: Copy IsFrameworkOnApple from cmTarget.
    0c454746 cmGeneratorTarget: Move IsLinkable from cmTarget.
    943b26f4 Xcode: Port internal API to cmGeneratorTarget.
    1884d054 cmGeneratorTarget: Move GetExportName from cmTarget.
    52b56835 Export: Port internal API to cmGeneratorTarget.
    4f1135ba Export: Port internal utility to cmGeneratorTarget.
    274d73e8 Export: Port some API to cmGlobalGenerator.
    80bfcc17 cmInstallTargetGenerator: Port GetInstallFilename to cmGeneratorTarget.
    d693e2fc Export: Port interface to cmGeneratorTarget.
    bf32afb1 cmExportTryCompileFileGenerator: Port to cmGeneratorTarget.
    a4d256a6 cmExportSet: Store a cmGeneratorTarget.
    772e91eb cmGlobalGenerator: Compute export() related classes early.
    10902e4a fixup! Use GetName from cmGeneratorTarget.


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cefb623d84c7657574c3dc2cc62ff94f0d65acae
commit cefb623d84c7657574c3dc2cc62ff94f0d65acae
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 9 23:59:10 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Oct 17 15:25:41 2015 +0200

    cmGeneratorTarget: Move IsCFBundleOnApple from cmTarget.

diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 9bdf2f5..5177ec8 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -1095,7 +1095,7 @@ cmExportFileGenerator
        << " PROPERTY MACOSX_BUNDLE 1)\n";
     }
 
-  if (target->Target->IsCFBundleOnApple())
+  if (target->IsCFBundleOnApple())
     {
     os << "set_property(TARGET " << targetName
        << " PROPERTY BUNDLE 1)\n";
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 7e457bb..b2959fe 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1574,7 +1574,7 @@ bool cmGeneratorTarget::IsBundleOnApple() const
 {
   return this->IsFrameworkOnApple()
       || this->IsAppBundleOnApple()
-      || this->Target->IsCFBundleOnApple();
+      || this->IsCFBundleOnApple();
 }
 
 //----------------------------------------------------------------------------
@@ -1943,7 +1943,7 @@ cmGeneratorTarget::BuildMacContentDirectory(const std::string& base,
     {
     fpath += this->GetFrameworkDirectory(config, contentOnly);
     }
-  if(this->Target->IsCFBundleOnApple())
+  if(this->IsCFBundleOnApple())
     {
     fpath += this->GetCFBundleDirectory(config, contentOnly);
     }
@@ -3483,7 +3483,7 @@ void cmGeneratorTarget::GetFullNameInternal(const std::string& config,
     targetSuffix = 0;
     }
 
-  if(this->Target->IsCFBundleOnApple())
+  if(this->IsCFBundleOnApple())
     {
     fw_prefix = this->GetCFBundleDirectory(config, false);
     fw_prefix += "/";
@@ -5966,6 +5966,14 @@ bool cmGeneratorTarget::IsAppBundleOnApple() const
 //----------------------------------------------------------------------------
 bool cmGeneratorTarget::IsXCTestOnApple() const
 {
-  return (this->Target->IsCFBundleOnApple() &&
+  return (this->IsCFBundleOnApple() &&
           this->GetPropertyAsBool("XCTEST"));
 }
+
+//----------------------------------------------------------------------------
+bool cmGeneratorTarget::IsCFBundleOnApple() const
+{
+  return (this->GetType() == cmState::MODULE_LIBRARY &&
+          this->Makefile->IsOn("APPLE") &&
+          this->GetPropertyAsBool("BUNDLE"));
+}
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index ce2f42e..6537421 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -425,6 +425,9 @@ public:
   /** Return whether this target is a XCTest on Apple.  */
   bool IsXCTestOnApple() const;
 
+  /** Return whether this target is a CFBundle (plugin) on Apple.  */
+  bool IsCFBundleOnApple() const;
+
   struct SourceFileFlags
   GetTargetSourceFileFlags(const cmSourceFile* sf) const;
 
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index e0cba04..017d1e1 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1197,7 +1197,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
     // some build phases only apply to bundles and/or frameworks
     bool isFrameworkTarget = gtgt->IsFrameworkOnApple();
     bool isBundleTarget = cmtarget.GetPropertyAsBool("MACOSX_BUNDLE");
-    bool isCFBundleTarget = cmtarget.IsCFBundleOnApple();
+    bool isCFBundleTarget = gtgt->IsCFBundleOnApple();
 
     cmXCodeObject* buildFiles = 0;
 
@@ -1993,7 +1993,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
       pndir = gtgt->GetDirectory(configName);
       }
 
-    if(gtgt->IsFrameworkOnApple() || target.IsCFBundleOnApple())
+    if(gtgt->IsFrameworkOnApple() || gtgt->IsCFBundleOnApple())
       {
       pnprefix = "";
       }
@@ -2046,7 +2046,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
     {
     buildSettings->AddAttribute("LIBRARY_STYLE",
                                 this->CreateString("BUNDLE"));
-    if (target.IsCFBundleOnApple())
+    if (gtgt->IsCFBundleOnApple())
       {
       // It turns out that a BUNDLE is basically the same
       // in many ways as an application bundle, as far as
@@ -2653,7 +2653,7 @@ const char* cmGlobalXCodeGenerator::GetTargetFileType(
     case cmState::MODULE_LIBRARY:
       if (target->IsXCTestOnApple())
         return "wrapper.cfbundle";
-      else if (target->Target->IsCFBundleOnApple())
+      else if (target->IsCFBundleOnApple())
         return "wrapper.plug-in";
       else
         return ((this->XcodeVersion >= 22)?
@@ -2680,7 +2680,7 @@ const char* cmGlobalXCodeGenerator::GetTargetProductType(
     case cmState::MODULE_LIBRARY:
       if (target->IsXCTestOnApple())
         return "com.apple.product-type.bundle.unit-test";
-      else if (target->Target->IsCFBundleOnApple())
+      else if (target->IsCFBundleOnApple())
         return "com.apple.product-type.bundle";
       else
         return ((this->XcodeVersion >= 22)?
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index e16dfd7..a97cc5f 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -226,7 +226,7 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os,
       filesFrom.push_back(from1);
       filesTo.push_back(to1);
       }
-    else if(this->Target->Target->IsCFBundleOnApple())
+    else if(this->Target->IsCFBundleOnApple())
       {
       // Install the whole app bundle directory.
       type = cmInstallType_DIRECTORY;
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 015c880..df2a8c9 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -279,7 +279,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
     this->OSXBundleGenerator->CreateFramework(targetName, outpath);
     outpath += "/";
     }
-  else if(this->Target->IsCFBundleOnApple())
+  else if(this->GeneratorTarget->IsCFBundleOnApple())
     {
     outpath = this->GeneratorTarget->GetDirectory(this->ConfigName);
     this->OSXBundleGenerator->CreateCFBundle(targetName, outpath);
@@ -360,7 +360,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
         buildEcho += " shared library ";
         break;
       case cmState::MODULE_LIBRARY:
-        if (this->Target->IsCFBundleOnApple())
+        if (this->GeneratorTarget->IsCFBundleOnApple())
             buildEcho += " CFBundle";
         buildEcho += " shared module ";
         break;
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 8a4f17e..dafbda9 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -139,7 +139,7 @@ const char *cmNinjaNormalTargetGenerator::GetVisibleTypeName() const
     case cmState::SHARED_LIBRARY:
       return "shared library";
     case cmState::MODULE_LIBRARY:
-      if (this->GetTarget()->IsCFBundleOnApple())
+      if (this->GetGeneratorTarget()->IsCFBundleOnApple())
         return "CFBundle shared module";
       else
         return "shared module";
@@ -434,7 +434,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
     this->OSXBundleGenerator->CreateFramework(this->TargetNameOut,
                                               gt.GetDirectory(cfgName));
     }
-  else if(target.IsCFBundleOnApple())
+  else if(gt.IsCFBundleOnApple())
     {
     // Create the core foundation bundle.
     this->OSXBundleGenerator->CreateCFBundle(this->TargetNameOut,
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 02a5ea6..f663678 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -369,14 +369,6 @@ bool cmTarget::IsAppBundleOnApple() const
 }
 
 //----------------------------------------------------------------------------
-bool cmTarget::IsCFBundleOnApple() const
-{
-  return (this->GetType() == cmState::MODULE_LIBRARY &&
-          this->Makefile->IsOn("APPLE") &&
-          this->GetPropertyAsBool("BUNDLE"));
-}
-
-//----------------------------------------------------------------------------
 void cmTarget::AddTracedSources(std::vector<std::string> const& srcs)
 {
   if (!srcs.empty())
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 7cf4808..0e966e9 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -235,9 +235,6 @@ public:
       Apple.  */
   bool IsFrameworkOnApple() const;
 
-  /** Return whether this target is a CFBundle (plugin) on Apple.  */
-  bool IsCFBundleOnApple() const;
-
   /** Return whether this target is an executable Bundle on Apple.  */
   bool IsAppBundleOnApple() const;
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=429440edab6f0e15991f281928e9c38f798b4e4a
commit 429440edab6f0e15991f281928e9c38f798b4e4a
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Oct 10 00:15:38 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Oct 17 15:25:16 2015 +0200

    cmGeneratorTarget: Move IsXCTestOnApple from cmTarget.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index ab0d02b..7e457bb 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1587,7 +1587,7 @@ std::string cmGeneratorTarget::GetCFBundleDirectory(const std::string& config,
   const char *ext = this->GetProperty("BUNDLE_EXTENSION");
   if (!ext)
     {
-    if (this->Target->IsXCTestOnApple())
+    if (this->IsXCTestOnApple())
       {
       ext = "xctest";
       }
@@ -5962,3 +5962,10 @@ bool cmGeneratorTarget::IsAppBundleOnApple() const
           this->Makefile->IsOn("APPLE") &&
           this->GetPropertyAsBool("MACOSX_BUNDLE"));
 }
+
+//----------------------------------------------------------------------------
+bool cmGeneratorTarget::IsXCTestOnApple() const
+{
+  return (this->Target->IsCFBundleOnApple() &&
+          this->GetPropertyAsBool("XCTEST"));
+}
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 24a1c2c..ce2f42e 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -422,6 +422,9 @@ public:
   /** Return whether this target is an executable Bundle on Apple.  */
   bool IsAppBundleOnApple() const;
 
+  /** Return whether this target is a XCTest on Apple.  */
+  bool IsXCTestOnApple() const;
+
   struct SourceFileFlags
   GetTargetSourceFileFlags(const cmSourceFile* sf) const;
 
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 5e12378..e0cba04 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -2651,7 +2651,7 @@ const char* cmGlobalXCodeGenerator::GetTargetFileType(
     case cmState::STATIC_LIBRARY:
       return "archive.ar";
     case cmState::MODULE_LIBRARY:
-      if (target->Target->IsXCTestOnApple())
+      if (target->IsXCTestOnApple())
         return "wrapper.cfbundle";
       else if (target->Target->IsCFBundleOnApple())
         return "wrapper.plug-in";
@@ -2678,7 +2678,7 @@ const char* cmGlobalXCodeGenerator::GetTargetProductType(
     case cmState::STATIC_LIBRARY:
       return "com.apple.product-type.library.static";
     case cmState::MODULE_LIBRARY:
-      if (target->Target->IsXCTestOnApple())
+      if (target->IsXCTestOnApple())
         return "com.apple.product-type.bundle.unit-test";
       else if (target->Target->IsCFBundleOnApple())
         return "com.apple.product-type.bundle";
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 761267d..02a5ea6 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -377,13 +377,6 @@ bool cmTarget::IsCFBundleOnApple() const
 }
 
 //----------------------------------------------------------------------------
-bool cmTarget::IsXCTestOnApple() const
-{
-  return (this->IsCFBundleOnApple() &&
-          this->GetPropertyAsBool("XCTEST"));
-}
-
-//----------------------------------------------------------------------------
 void cmTarget::AddTracedSources(std::vector<std::string> const& srcs)
 {
   if (!srcs.empty())
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 51e97fd..7cf4808 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -238,9 +238,6 @@ public:
   /** Return whether this target is a CFBundle (plugin) on Apple.  */
   bool IsCFBundleOnApple() const;
 
-  /** Return whether this target is a XCTest on Apple.  */
-  bool IsXCTestOnApple() const;
-
   /** Return whether this target is an executable Bundle on Apple.  */
   bool IsAppBundleOnApple() const;
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=39540916916e390fc7059f77f646cd7f341693b9
commit 39540916916e390fc7059f77f646cd7f341693b9
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 9 23:58:19 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Oct 17 15:24:34 2015 +0200

    cmGeneratorTarget: Copy IsAppBundleOnApple from cmTarget.
    
    Leave the cmTarget method behind for now to implement cmInstallCommand.

diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index 781220d..3af7b71 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -202,7 +202,7 @@ cmExportBuildFileGenerator
   std::string prop = "IMPORTED_LOCATION";
   prop += suffix;
   std::string value;
-  if(target->Target->IsAppBundleOnApple())
+  if(target->IsAppBundleOnApple())
     {
     value = target->GetFullPath(config, false);
     }
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 132c0b5..9bdf2f5 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -1089,7 +1089,7 @@ cmExportFileGenerator
     }
 
   // Mark the imported executable if it is an application bundle.
-  if(target->Target->IsAppBundleOnApple())
+  if(target->IsAppBundleOnApple())
     {
     os << "set_property(TARGET " << targetName
        << " PROPERTY MACOSX_BUNDLE 1)\n";
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index d57d67f..a2d6ad1 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -433,7 +433,7 @@ cmExportInstallFileGenerator
     prop += suffix;
 
     // Append the installed file name.
-    if(target->Target->IsAppBundleOnApple())
+    if(target->IsAppBundleOnApple())
       {
       value += itgen->GetInstallFilename(target, config);
       value += ".app/Contents/MacOS/";
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 42b5c63..ab0d02b 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -851,7 +851,7 @@ const char* cmGeneratorTarget::GetLocationForBuild() const
     location += cfgid;
     }
 
-  if(this->Target->IsAppBundleOnApple())
+  if(this->IsAppBundleOnApple())
     {
     std::string macdir = this->BuildMacContentDirectory("", "",
                                                                 false);
@@ -1573,7 +1573,7 @@ cmGeneratorTarget::GetAppBundleDirectory(const std::string& config,
 bool cmGeneratorTarget::IsBundleOnApple() const
 {
   return this->IsFrameworkOnApple()
-      || this->Target->IsAppBundleOnApple()
+      || this->IsAppBundleOnApple()
       || this->Target->IsCFBundleOnApple();
 }
 
@@ -1935,7 +1935,7 @@ cmGeneratorTarget::BuildMacContentDirectory(const std::string& base,
                                             bool contentOnly) const
 {
   std::string fpath = base;
-  if(this->Target->IsAppBundleOnApple())
+  if(this->IsAppBundleOnApple())
     {
     fpath += this->GetAppBundleDirectory(config, contentOnly);
     }
@@ -3143,7 +3143,7 @@ std::string cmGeneratorTarget::NormalGetFullPath(const std::string& config,
 {
   std::string fpath = this->GetDirectory(config, implib);
   fpath += "/";
-  if(this->Target->IsAppBundleOnApple())
+  if(this->IsAppBundleOnApple())
     {
     fpath = this->BuildMacContentDirectory(fpath, config, false);
     fpath += "/";
@@ -3438,8 +3438,7 @@ void cmGeneratorTarget::GetFullNameInternal(const std::string& config,
     configPostfix = this->GetProperty(configProp);
     // Mac application bundles and frameworks have no postfix.
     if(configPostfix &&
-       (this->Target->IsAppBundleOnApple()
-         || this->IsFrameworkOnApple()))
+       (this->IsAppBundleOnApple() || this->IsFrameworkOnApple()))
       {
       configPostfix = 0;
       }
@@ -5955,3 +5954,11 @@ bool cmGeneratorTarget::IsFrameworkOnApple() const
           this->Makefile->IsOn("APPLE") &&
           this->GetPropertyAsBool("FRAMEWORK"));
 }
+
+//----------------------------------------------------------------------------
+bool cmGeneratorTarget::IsAppBundleOnApple() const
+{
+  return (this->GetType() == cmState::EXECUTABLE &&
+          this->Makefile->IsOn("APPLE") &&
+          this->GetPropertyAsBool("MACOSX_BUNDLE"));
+}
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 471a500..24a1c2c 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -419,6 +419,9 @@ public:
       Apple.  */
   bool IsFrameworkOnApple() const;
 
+  /** Return whether this target is an executable Bundle on Apple.  */
+  bool IsAppBundleOnApple() const;
+
   struct SourceFileFlags
   GetTargetSourceFileFlags(const cmSourceFile* sf) const;
 
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index 9c0aca0..e16dfd7 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -150,7 +150,7 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os,
       std::string to1 = toDir + targetName;
 
       // Handle OSX Bundles.
-      if(this->Target->Target->IsAppBundleOnApple())
+      if(this->Target->IsAppBundleOnApple())
         {
         // Install the whole app bundle directory.
         type = cmInstallType_DIRECTORY;
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 178b462..31fb37b 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -100,7 +100,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
 
   // Construct the full path version of the names.
   std::string outpath = this->GeneratorTarget->GetDirectory(this->ConfigName);
-  if(this->Target->IsAppBundleOnApple())
+  if(this->GeneratorTarget->IsAppBundleOnApple())
     {
     this->OSXBundleGenerator->CreateAppBundle(targetName, outpath);
     }
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 4cfbda5..8a4f17e 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -412,7 +412,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
                                      gt.GetFullPath(cfgName,
                                        /*implib=*/true));
 
-  if (target.IsAppBundleOnApple())
+  if (gt.IsAppBundleOnApple())
     {
     // Create the app bundle
     std::string outpath = gt.GetDirectory(cfgName);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=80c97771319f3ab6d32ffc77c2660d863e7a7166
commit 80c97771319f3ab6d32ffc77c2660d863e7a7166
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 9 23:57:17 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Oct 17 15:24:34 2015 +0200

    cmGeneratorTarget: Copy IsFrameworkOnApple from cmTarget.
    
    Leave the cmTarget method behind for now to implement cmInstallCommand.

diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index 889c55c..2497f82 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -1111,7 +1111,7 @@ void cmComputeLinkInformation::AddTargetItem(std::string const& item,
 
   // For compatibility with CMake 2.4 include the item's directory in
   // the linker search path.
-  if(this->OldLinkDirMode && !target->Target->IsFrameworkOnApple() &&
+  if(this->OldLinkDirMode && !target->IsFrameworkOnApple() &&
      this->OldLinkDirMask.find(cmSystemTools::GetFilenamePath(item)) ==
      this->OldLinkDirMask.end())
     {
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index fdc21db..132c0b5 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -1082,7 +1082,7 @@ cmExportFileGenerator
     }
 
   // Mark the imported library if it is a framework.
-  if(target->Target->IsFrameworkOnApple())
+  if(target->IsFrameworkOnApple())
     {
     os << "set_property(TARGET " << targetName
        << " PROPERTY FRAMEWORK 1)\n";
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index bdf29b2..42b5c63 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1572,7 +1572,7 @@ cmGeneratorTarget::GetAppBundleDirectory(const std::string& config,
 //----------------------------------------------------------------------------
 bool cmGeneratorTarget::IsBundleOnApple() const
 {
-  return this->Target->IsFrameworkOnApple()
+  return this->IsFrameworkOnApple()
       || this->Target->IsAppBundleOnApple()
       || this->Target->IsCFBundleOnApple();
 }
@@ -1939,7 +1939,7 @@ cmGeneratorTarget::BuildMacContentDirectory(const std::string& base,
     {
     fpath += this->GetAppBundleDirectory(config, contentOnly);
     }
-  if(this->Target->IsFrameworkOnApple())
+  if(this->IsFrameworkOnApple())
     {
     fpath += this->GetFrameworkDirectory(config, contentOnly);
     }
@@ -1959,7 +1959,7 @@ cmGeneratorTarget::GetMacContentDirectory(const std::string& config,
   std::string fpath = this->GetDirectory(config, implib);
   fpath += "/";
   bool contentOnly = true;
-  if(this->Target->IsFrameworkOnApple())
+  if(this->IsFrameworkOnApple())
     {
     // additional files with a framework go into the version specific
     // directory
@@ -3227,7 +3227,7 @@ void cmGeneratorTarget::GetLibraryNames(std::string& name,
   const char* version = this->GetProperty("VERSION");
   const char* soversion = this->GetProperty("SOVERSION");
   if(!this->HasSOName(config) ||
-     this->Target->IsFrameworkOnApple())
+     this->IsFrameworkOnApple())
     {
     // Versioning is supported only for shared libraries and modules,
     // and then only when the platform supports an soname flag.
@@ -3255,7 +3255,7 @@ void cmGeneratorTarget::GetLibraryNames(std::string& name,
   // The library name.
   name = prefix+base+suffix;
 
-  if(this->Target->IsFrameworkOnApple())
+  if(this->IsFrameworkOnApple())
     {
     realName = prefix;
     if(!this->Makefile->PlatformIsAppleIos())
@@ -3439,7 +3439,7 @@ void cmGeneratorTarget::GetFullNameInternal(const std::string& config,
     // Mac application bundles and frameworks have no postfix.
     if(configPostfix &&
        (this->Target->IsAppBundleOnApple()
-         || this->Target->IsFrameworkOnApple()))
+         || this->IsFrameworkOnApple()))
       {
       configPostfix = 0;
       }
@@ -3476,7 +3476,7 @@ void cmGeneratorTarget::GetFullNameInternal(const std::string& config,
 
   // frameworks have directory prefix but no suffix
   std::string fw_prefix;
-  if(this->Target->IsFrameworkOnApple())
+  if(this->IsFrameworkOnApple())
     {
     fw_prefix = this->GetOutputName(config, false);
     fw_prefix += ".framework/";
@@ -5947,3 +5947,11 @@ bool cmGeneratorTarget::IsLinkable() const
           this->GetType() == cmState::INTERFACE_LIBRARY ||
           this->Target->IsExecutableWithExports());
 }
+
+//----------------------------------------------------------------------------
+bool cmGeneratorTarget::IsFrameworkOnApple() const
+{
+  return (this->GetType() == cmState::SHARED_LIBRARY &&
+          this->Makefile->IsOn("APPLE") &&
+          this->GetPropertyAsBool("FRAMEWORK"));
+}
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index a4a432c..471a500 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -415,6 +415,10 @@ public:
   /** Return whether this target may be used to link another target.  */
   bool IsLinkable() const;
 
+  /** Return whether this target is a shared library Framework on
+      Apple.  */
+  bool IsFrameworkOnApple() const;
+
   struct SourceFileFlags
   GetTargetSourceFileFlags(const cmSourceFile* sf) const;
 
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index f54f936..1142ddd 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2208,7 +2208,8 @@ cmGlobalGenerator::NameResolvesToFramework(const std::string& libname) const
 
   if(cmTarget* tgt = this->FindTarget(libname))
     {
-    if(tgt->IsFrameworkOnApple())
+    cmGeneratorTarget* gt = this->GetGeneratorTarget(tgt);
+    if(gt->IsFrameworkOnApple())
        {
        return true;
        }
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 02da028..89a6dff 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -917,11 +917,13 @@ cmGlobalNinjaGenerator
   std::string configName =
     target->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE");
 
+  cmGeneratorTarget *gtgt = this->GetGeneratorTarget(target);
+
   // for frameworks, we want the real name, not smple name
   // frameworks always appear versioned, and the build.ninja
   // will always attempt to manage symbolic links instead
   // of letting cmOSXBundleGenerator do it.
-  bool realname = target->IsFrameworkOnApple();
+  bool realname = gtgt->IsFrameworkOnApple();
 
   switch (target->GetType()) {
   case cmState::EXECUTABLE:
@@ -929,7 +931,6 @@ cmGlobalNinjaGenerator
   case cmState::STATIC_LIBRARY:
   case cmState::MODULE_LIBRARY:
     {
-    cmGeneratorTarget *gtgt = this->GetGeneratorTarget(target);
     outputs.push_back(this->ConvertToNinjaPath(
       gtgt->GetFullPath(configName, false, realname)));
     break;
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 7e5d963..5e12378 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -787,14 +787,16 @@ cmGlobalXCodeGenerator::CreateXCodeSourceFile(cmLocalGenerator* lg,
 
   // Is this a resource file in this target? Add it to the resources group...
   //
+
+  cmGeneratorTarget* gtgt = this->GetGeneratorTarget(&cmtarget);
   cmGeneratorTarget::SourceFileFlags tsFlags =
-            this->GetGeneratorTarget(&cmtarget)->GetTargetSourceFileFlags(sf);
+      gtgt->GetTargetSourceFileFlags(sf);
   bool isResource = tsFlags.Type == cmGeneratorTarget::SourceFileTypeResource;
 
   // Is this a "private" or "public" framework header file?
   // Set the ATTRIBUTES attribute appropriately...
   //
-  if(cmtarget.IsFrameworkOnApple())
+  if(gtgt->IsFrameworkOnApple())
     {
     if(tsFlags.Type == cmGeneratorTarget::SourceFileTypePrivateHeader)
       {
@@ -1193,7 +1195,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
       }
 
     // some build phases only apply to bundles and/or frameworks
-    bool isFrameworkTarget = cmtarget.IsFrameworkOnApple();
+    bool isFrameworkTarget = gtgt->IsFrameworkOnApple();
     bool isBundleTarget = cmtarget.GetPropertyAsBool("MACOSX_BUNDLE");
     bool isCFBundleTarget = cmtarget.IsCFBundleOnApple();
 
@@ -1289,7 +1291,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
         copyFilesBuildPhase->AddAttribute("dstSubfolderSpec",
           this->CreateString("6"));
         std::ostringstream ostr;
-        if (cmtarget.IsFrameworkOnApple())
+        if (gtgt->IsFrameworkOnApple())
           {
           // dstPath in frameworks is relative to Versions/<version>
           ostr << mit->first;
@@ -1467,8 +1469,10 @@ void cmGlobalXCodeGenerator::CreateCustomCommands(cmXCodeObject* buildPhases,
   std::vector<cmCustomCommand> postbuild
     = cmtarget.GetPostBuildCommands();
 
+  cmGeneratorTarget* gtgt = this->GetGeneratorTarget(&cmtarget);
+
   if(cmtarget.GetType() == cmState::SHARED_LIBRARY &&
-    !cmtarget.IsFrameworkOnApple())
+    !gtgt->IsFrameworkOnApple())
     {
     cmCustomCommandLines cmd;
     cmd.resize(1);
@@ -1500,7 +1504,6 @@ void cmGlobalXCodeGenerator::CreateCustomCommands(cmXCodeObject* buildPhases,
     }
 
   std::vector<cmSourceFile*> classes;
-  cmGeneratorTarget* gtgt = this->GetGeneratorTarget(&cmtarget);
   if (!gtgt->GetConfigCommonSourceFiles(classes))
     {
     return;
@@ -1943,7 +1946,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
 
   const char* version = target.GetProperty("VERSION");
   const char* soversion = target.GetProperty("SOVERSION");
-  if(!gtgt->HasSOName(configName) || target.IsFrameworkOnApple())
+  if(!gtgt->HasSOName(configName) || gtgt->IsFrameworkOnApple())
     {
     version = 0;
     soversion = 0;
@@ -1990,7 +1993,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
       pndir = gtgt->GetDirectory(configName);
       }
 
-    if(target.IsFrameworkOnApple() || target.IsCFBundleOnApple())
+    if(gtgt->IsFrameworkOnApple() || target.IsCFBundleOnApple())
       {
       pnprefix = "";
       }
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index c2798b2..9c0aca0 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -208,7 +208,7 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os,
       // An import library looks like a static library.
       type = cmInstallType_STATIC_LIBRARY;
       }
-    else if(this->Target->Target->IsFrameworkOnApple())
+    else if(this->Target->IsFrameworkOnApple())
       {
       // There is a bug in cmInstallCommand if this fails.
       assert(this->NamelinkMode == NamelinkModeNone);
@@ -605,7 +605,7 @@ cmInstallTargetGenerator
     std::string for_install =
       this->Target->GetInstallNameDirForInstallTree();
 
-    if(this->Target->Target->IsFrameworkOnApple() && for_install.empty())
+    if(this->Target->IsFrameworkOnApple() && for_install.empty())
       {
       // Frameworks seem to have an id corresponding to their own full
       // path.
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 2ed5f70..015c880 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -153,7 +153,7 @@ void cmMakefileLibraryTargetGenerator::WriteStaticLibraryRules()
 //----------------------------------------------------------------------------
 void cmMakefileLibraryTargetGenerator::WriteSharedLibraryRules(bool relink)
 {
-  if(this->Target->IsFrameworkOnApple())
+  if(this->GeneratorTarget->IsFrameworkOnApple())
     {
     this->WriteFrameworkRules(relink);
     return;
@@ -273,7 +273,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
   // Construct the full path version of the names.
   std::string outpath;
   std::string outpathImp;
-  if(this->Target->IsFrameworkOnApple())
+  if(this->GeneratorTarget->IsFrameworkOnApple())
     {
     outpath = this->GeneratorTarget->GetDirectory(this->ConfigName);
     this->OSXBundleGenerator->CreateFramework(targetName, outpath);
@@ -791,7 +791,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
 
   // Add a rule to create necessary symlinks for the library.
   // Frameworks are handled by cmOSXBundleGenerator.
-  if(targetOutPath != targetOutPathReal && !this->Target->IsFrameworkOnApple())
+  if(targetOutPath != targetOutPathReal
+     && !this->GeneratorTarget->IsFrameworkOnApple())
     {
     std::string symlink = "$(CMAKE_COMMAND) -E cmake_symlink_library ";
     symlink += targetOutPathReal;
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index e5e4b7f..4cfbda5 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -281,7 +281,7 @@ cmNinjaNormalTargetGenerator
   }
 
   if (this->TargetNameOut != this->TargetNameReal &&
-    !this->GetTarget()->IsFrameworkOnApple()) {
+    !this->GetGeneratorTarget()->IsFrameworkOnApple()) {
     std::string cmakeCommand =
       this->GetLocalGenerator()->ConvertToOutputFormat(
         cmSystemTools::GetCMakeCommand(), cmLocalGenerator::SHELL);
@@ -428,7 +428,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
     targetOutputReal += this->TargetNameReal;
     targetOutputReal = this->ConvertToNinjaPath(targetOutputReal);
     }
-  else if (target.IsFrameworkOnApple())
+  else if (gt.IsFrameworkOnApple())
     {
     // Create the library framework.
     this->OSXBundleGenerator->CreateFramework(this->TargetNameOut,
@@ -732,7 +732,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
                         &usedResponseFile);
   this->WriteLinkRule(usedResponseFile);
 
-  if (targetOutput != targetOutputReal && !target.IsFrameworkOnApple())
+  if (targetOutput != targetOutputReal && !gt.IsFrameworkOnApple())
     {
     if (targetType == cmState::EXECUTABLE)
       {

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0c454746a0865d2310fb0746a85c5491df196b72
commit 0c454746a0865d2310fb0746a85c5491df196b72
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 9 23:44:11 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Oct 17 15:24:34 2015 +0200

    cmGeneratorTarget: Move IsLinkable from cmTarget.

diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index 7bdc555..889c55c 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -643,7 +643,7 @@ void cmComputeLinkInformation::AddItem(std::string const& item,
     return;
     }
 
-  if(tgt && tgt->Target->IsLinkable())
+  if(tgt && tgt->IsLinkable())
     {
     // This is a CMake target.  Ask the target for its real name.
     if(impexe && this->LoaderFlag)
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 3e58400..fdc21db 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -210,7 +210,7 @@ bool cmExportFileGenerator::PopulateInterfaceLinkLibrariesProperty(
                       ImportPropertyMap &properties,
                       std::vector<std::string> &missingTargets)
 {
-  if(!target->Target->IsLinkable())
+  if(!target->IsLinkable())
     {
     return false;
     }
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index c7c0e73..1a878e2 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -1654,7 +1654,7 @@ struct TargetFilesystemArtifactResultCreator<ArtifactLinkerTag>
                             const GeneratorExpressionContent *content)
   {
     // The file used to link to the target (.so, .lib, .a).
-    if(!target->Target->IsLinkable())
+    if(!target->IsLinkable())
       {
       ::reportError(context, content->GetOriginalExpression(),
                     "TARGET_LINKER_FILE is allowed only for libraries and "
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 03c950e..bdf29b2 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -5936,3 +5936,14 @@ std::string cmGeneratorTarget::GetSupportDirectory() const
 #endif
   return dir;
 }
+
+//----------------------------------------------------------------------------
+bool cmGeneratorTarget::IsLinkable() const
+{
+  return (this->GetType() == cmState::STATIC_LIBRARY ||
+          this->GetType() == cmState::SHARED_LIBRARY ||
+          this->GetType() == cmState::MODULE_LIBRARY ||
+          this->GetType() == cmState::UNKNOWN_LIBRARY ||
+          this->GetType() == cmState::INTERFACE_LIBRARY ||
+          this->Target->IsExecutableWithExports());
+}
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 1029158..a4a432c 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -412,6 +412,9 @@ public:
   /** Get a build-tree directory in which to place target support files.  */
   std::string GetSupportDirectory() const;
 
+  /** Return whether this target may be used to link another target.  */
+  bool IsLinkable() const;
+
   struct SourceFileFlags
   GetTargetSourceFileFlags(const cmSourceFile* sf) const;
 
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index d81d3b8..fcc27ca 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -385,7 +385,7 @@ bool cmGlobalVisualStudioGenerator::ComputeTargetDepends()
 }
 
 //----------------------------------------------------------------------------
-static bool VSLinkable(cmTarget const* t)
+static bool VSLinkable(cmGeneratorTarget const* t)
 {
   return t->IsLinkable() || t->GetType() == cmState::OBJECT_LIBRARY;
 }
@@ -475,7 +475,8 @@ void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends(cmTarget& target)
       di != utilDepends.end(); ++di)
     {
     cmTarget const* dep = *di;
-    if(allowLinkable || !VSLinkable(dep) || linked.count(dep))
+    cmGeneratorTarget* gt = this->GetGeneratorTarget(dep);
+    if(allowLinkable || !VSLinkable(gt) || linked.count(dep))
       {
       // Direct dependency allowed.
       vsTargetDepend.insert(dep->GetName());
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 57a2d24..761267d 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -345,17 +345,6 @@ bool cmTarget::IsExecutableWithExports() const
 }
 
 //----------------------------------------------------------------------------
-bool cmTarget::IsLinkable() const
-{
-  return (this->GetType() == cmState::STATIC_LIBRARY ||
-          this->GetType() == cmState::SHARED_LIBRARY ||
-          this->GetType() == cmState::MODULE_LIBRARY ||
-          this->GetType() == cmState::UNKNOWN_LIBRARY ||
-          this->GetType() == cmState::INTERFACE_LIBRARY ||
-          this->IsExecutableWithExports());
-}
-
-//----------------------------------------------------------------------------
 bool cmTarget::HasImportLibrary() const
 {
   return (this->DLLPlatform &&
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index dafe86a..51e97fd 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -228,9 +228,6 @@ public:
       enabled.  */
   bool IsExecutableWithExports() const;
 
-  /** Return whether this target may be used to link another target.  */
-  bool IsLinkable() const;
-
   /** Return whether or not the target is for a DLL platform.  */
   bool IsDLLPlatform() const { return this->DLLPlatform; }
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=943b26f4f39d94d50d1f0f9b84ef139225eb921f
commit 943b26f4f39d94d50d1f0f9b84ef139225eb921f
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Oct 17 15:20:23 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Oct 17 15:24:30 2015 +0200

    Xcode: Port internal API to cmGeneratorTarget.

diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index d4ccde6..7e5d963 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -2639,23 +2639,24 @@ cmGlobalXCodeGenerator::GetTargetLinkFlagsVar(cmTarget const& cmtarget) const
 }
 
 //----------------------------------------------------------------------------
-const char* cmGlobalXCodeGenerator::GetTargetFileType(cmTarget& cmtarget)
+const char* cmGlobalXCodeGenerator::GetTargetFileType(
+    cmGeneratorTarget* target)
 {
-  switch(cmtarget.GetType())
+  switch(target->GetType())
     {
     case cmState::OBJECT_LIBRARY:
     case cmState::STATIC_LIBRARY:
       return "archive.ar";
     case cmState::MODULE_LIBRARY:
-      if (cmtarget.IsXCTestOnApple())
+      if (target->Target->IsXCTestOnApple())
         return "wrapper.cfbundle";
-      else if (cmtarget.IsCFBundleOnApple())
+      else if (target->Target->IsCFBundleOnApple())
         return "wrapper.plug-in";
       else
         return ((this->XcodeVersion >= 22)?
               "compiled.mach-o.executable" : "compiled.mach-o.dylib");
     case cmState::SHARED_LIBRARY:
-      return (cmtarget.GetPropertyAsBool("FRAMEWORK")?
+      return (target->GetPropertyAsBool("FRAMEWORK")?
               "wrapper.framework" : "compiled.mach-o.dylib");
     case cmState::EXECUTABLE:
       return "compiled.mach-o.executable";
@@ -2665,28 +2666,29 @@ const char* cmGlobalXCodeGenerator::GetTargetFileType(cmTarget& cmtarget)
 }
 
 //----------------------------------------------------------------------------
-const char* cmGlobalXCodeGenerator::GetTargetProductType(cmTarget& cmtarget)
+const char* cmGlobalXCodeGenerator::GetTargetProductType(
+    cmGeneratorTarget* target)
 {
-  switch(cmtarget.GetType())
+  switch(target->GetType())
     {
     case cmState::OBJECT_LIBRARY:
     case cmState::STATIC_LIBRARY:
       return "com.apple.product-type.library.static";
     case cmState::MODULE_LIBRARY:
-      if (cmtarget.IsXCTestOnApple())
+      if (target->Target->IsXCTestOnApple())
         return "com.apple.product-type.bundle.unit-test";
-      else if (cmtarget.IsCFBundleOnApple())
+      else if (target->Target->IsCFBundleOnApple())
         return "com.apple.product-type.bundle";
       else
         return ((this->XcodeVersion >= 22)?
                 "com.apple.product-type.tool" :
                 "com.apple.product-type.library.dynamic");
     case cmState::SHARED_LIBRARY:
-      return (cmtarget.GetPropertyAsBool("FRAMEWORK")?
+      return (target->GetPropertyAsBool("FRAMEWORK")?
               "com.apple.product-type.framework" :
               "com.apple.product-type.library.dynamic");
     case cmState::EXECUTABLE:
-      return (cmtarget.GetPropertyAsBool("MACOSX_BUNDLE")?
+      return (target->GetPropertyAsBool("MACOSX_BUNDLE")?
               "com.apple.product-type.application" :
               "com.apple.product-type.tool");
     default: break;
@@ -2727,9 +2729,11 @@ cmGlobalXCodeGenerator::CreateXCodeTarget(cmTarget& cmtarget,
   target->AddAttribute("name", this->CreateString(cmtarget.GetName()));
   target->AddAttribute("productName",this->CreateString(cmtarget.GetName()));
 
+  cmGeneratorTarget *gtgt = this->GetGeneratorTarget(&cmtarget);
+
   cmXCodeObject* fileRef =
     this->CreateObject(cmXCodeObject::PBXFileReference);
-  if(const char* fileType = this->GetTargetFileType(cmtarget))
+  if(const char* fileType = this->GetTargetFileType(gtgt))
     {
     fileRef->AddAttribute("explicitFileType", this->CreateString(fileType));
     }
@@ -2742,7 +2746,6 @@ cmGlobalXCodeGenerator::CreateXCodeTarget(cmTarget& cmtarget,
     }
   else
     {
-    cmGeneratorTarget *gtgt = this->GetGeneratorTarget(&cmtarget);
     fullName = gtgt->GetFullName(defConfig.c_str());
     }
   fileRef->AddAttribute("path", this->CreateString(fullName.c_str()));
@@ -2752,7 +2755,7 @@ cmGlobalXCodeGenerator::CreateXCodeTarget(cmTarget& cmtarget,
   fileRef->SetComment(cmtarget.GetName().c_str());
   target->AddAttribute("productReference",
                        this->CreateObjectReference(fileRef));
-  if(const char* productType = this->GetTargetProductType(cmtarget))
+  if(const char* productType = this->GetTargetProductType(gtgt))
     {
     target->AddAttribute("productType", this->CreateString(productType));
     }
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index 9daf0ab..feb5009 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -137,8 +137,8 @@ private:
   void ForceLinkerLanguages();
   void ForceLinkerLanguage(cmTarget& cmtarget);
   const char* GetTargetLinkFlagsVar(cmTarget const& cmtarget) const;
-  const char* GetTargetFileType(cmTarget& cmtarget);
-  const char* GetTargetProductType(cmTarget& cmtarget);
+  const char* GetTargetFileType(cmGeneratorTarget* target);
+  const char* GetTargetProductType(cmGeneratorTarget* target);
   std::string AddConfigurations(cmXCodeObject* target, cmTarget& cmtarget);
   void AppendOrAddBuildSetting(cmXCodeObject* settings, const char* attr,
                                const char* value);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1884d054d86a1e8d326cdcbc904a2d4b34382a2b
commit 1884d054d86a1e8d326cdcbc904a2d4b34382a2b
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Oct 17 15:08:13 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Oct 17 15:12:08 2015 +0200

    cmGeneratorTarget: Move GetExportName from cmTarget.

diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index d191e47..781220d 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -48,7 +48,7 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
     {
     cmGeneratorTarget *te = this->LG
                                 ->FindGeneratorTargetToUse(*tei);
-    expectedTargets += sep + this->Namespace + te->Target->GetExportName();
+    expectedTargets += sep + this->Namespace + te->GetExportName();
     sep = " ";
     if(this->ExportedTargets.insert(te).second)
       {
@@ -253,7 +253,7 @@ cmExportBuildFileGenerator::HandleMissingTarget(
       {
       std::string missingTarget = namespaces[0];
 
-      missingTarget += dependee->Target->GetExportName();
+      missingTarget += dependee->GetExportName();
       link_libs += missingTarget;
       missingTargets.push_back(missingTarget);
       return;
@@ -268,7 +268,7 @@ cmExportBuildFileGenerator::HandleMissingTarget(
   // Assume the target will be exported by another command.
   // Append it with the export namespace.
   link_libs += this->Namespace;
-  link_libs += dependee->Target->GetExportName();
+  link_libs += dependee->GetExportName();
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 1c3e9fe..3e58400 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -18,7 +18,6 @@
 #include "cmLocalGenerator.h"
 #include "cmMakefile.h"
 #include "cmSystemTools.h"
-#include "cmTarget.h"
 #include "cmTargetExport.h"
 #include "cmVersion.h"
 #include "cmComputeLinkInformation.h"
@@ -623,7 +622,7 @@ void cmExportFileGenerator::GenerateInterfaceProperties(
   if (!properties.empty())
     {
     std::string targetName = this->Namespace;
-    targetName += target->Target->GetExportName();
+    targetName += target->GetExportName();
     os << "set_target_properties(" << targetName << " PROPERTIES\n";
     for(ImportPropertyMap::const_iterator pi = properties.begin();
         pi != properties.end(); ++pi)
@@ -655,7 +654,7 @@ cmExportFileGenerator::AddTargetNamespace(std::string &input,
     }
   if(this->ExportedTargets.find(tgt) != this->ExportedTargets.end())
     {
-    input = this->Namespace + tgt->Target->GetExportName();
+    input = this->Namespace + tgt->GetExportName();
     }
   else
     {
@@ -1047,7 +1046,7 @@ cmExportFileGenerator
   // Construct the imported target name.
   std::string targetName = this->Namespace;
 
-  targetName += target->Target->GetExportName();
+  targetName += target->GetExportName();
 
   // Create the imported target.
   os << "# Create imported target " << targetName << "\n";
@@ -1114,7 +1113,7 @@ cmExportFileGenerator
   // Construct the imported target name.
   std::string targetName = this->Namespace;
 
-  targetName += target->Target->GetExportName();
+  targetName += target->GetExportName();
 
   // Set the import properties.
   os << "# Import target \"" << targetName << "\" for configuration \""
@@ -1234,7 +1233,7 @@ cmExportFileGenerator
 {
   // Construct the imported target name.
   std::string targetName = this->Namespace;
-  targetName += target->Target->GetExportName();
+  targetName += target->GetExportName();
 
   os << "list(APPEND _IMPORT_CHECK_TARGETS " << targetName << " )\n"
         "list(APPEND _IMPORT_CHECK_FILES_FOR_" << targetName << " ";
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index ea5badc..d57d67f 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -49,7 +49,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
       tei != this->IEGen->GetExportSet()->GetTargetExports()->end(); ++tei)
     {
     expectedTargets +=
-        sep + this->Namespace + (*tei)->Target->Target->GetExportName();
+        sep + this->Namespace + (*tei)->Target->GetExportName();
     sep = " ";
     cmTargetExport * te = *tei;
     if(this->ExportedTargets.insert(te->Target).second)
@@ -465,7 +465,7 @@ cmExportInstallFileGenerator::HandleMissingTarget(std::string& link_libs,
     {
     std::string missingTarget = namespaces[0];
 
-    missingTarget += dependee->Target->GetExportName();
+    missingTarget += dependee->GetExportName();
     link_libs += missingTarget;
     missingTargets.push_back(missingTarget);
     }
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 5e26aad..03c950e 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -335,6 +335,26 @@ std::string cmGeneratorTarget::GetName() const
 }
 
 //----------------------------------------------------------------------------
+std::string cmGeneratorTarget::GetExportName() const
+{
+  const char *exportName = this->GetProperty("EXPORT_NAME");
+
+  if (exportName && *exportName)
+    {
+    if (!cmGeneratorExpression::IsValidTargetName(exportName))
+      {
+      std::ostringstream e;
+      e << "EXPORT_NAME property \"" << exportName << "\" for \""
+        << this->GetName() << "\": is not valid.";
+      cmSystemTools::Error(e.str().c_str());
+      return "";
+      }
+    return exportName;
+    }
+  return this->GetName();
+}
+
+//----------------------------------------------------------------------------
 const char *cmGeneratorTarget::GetProperty(const std::string& prop) const
 {
   return this->Target->GetProperty(prop);
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index f5a894b..1029158 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -43,6 +43,8 @@ public:
 
   cmState::TargetType GetType() const;
   std::string GetName() const;
+  std::string GetExportName() const;
+
   const char *GetProperty(const std::string& prop) const;
   bool GetPropertyAsBool(const std::string& prop) const;
   void GetSourceFiles(std::vector<cmSourceFile*>& files,
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 1c4faab..57a2d24 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1412,26 +1412,6 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
 }
 
 //----------------------------------------------------------------------------
-std::string cmTarget::GetExportName() const
-{
-  const char *exportName = this->GetProperty("EXPORT_NAME");
-
-  if (exportName && *exportName)
-    {
-    if (!cmGeneratorExpression::IsValidTargetName(exportName))
-      {
-      std::ostringstream e;
-      e << "EXPORT_NAME property \"" << exportName << "\" for \""
-        << this->GetName() << "\": is not valid.";
-      cmSystemTools::Error(e.str().c_str());
-      return "";
-      }
-    return exportName;
-    }
-  return this->GetName();
-}
-
-//----------------------------------------------------------------------------
 void cmTarget::AppendBuildInterfaceIncludes()
 {
   if(this->GetType() != cmState::SHARED_LIBRARY &&
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 443a2d0..dafe86a 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -96,7 +96,6 @@ public:
 
   ///! Set/Get the name of the target
   const std::string& GetName() const {return this->Name;}
-  std::string GetExportName() const;
 
   ///! Set the cmMakefile that owns this target
   void SetMakefile(cmMakefile *mf);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=52b56835e39b93a42f7c5235b8469178dfc5db12
commit 52b56835e39b93a42f7c5235b8469178dfc5db12
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Oct 17 15:10:32 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Oct 17 15:10:46 2015 +0200

    Export: Port internal API to cmGeneratorTarget.

diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index cf84146..d191e47 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -174,7 +174,7 @@ cmExportBuildFileGenerator
       //                              properties);
 
       // Generate code in the export file.
-      this->GenerateImportPropertyCode(os, config, target->Target,
+      this->GenerateImportPropertyCode(os, config, target,
                                        properties);
       }
     }
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index b597b53..1c3e9fe 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -1108,13 +1108,13 @@ cmExportFileGenerator
 void
 cmExportFileGenerator
 ::GenerateImportPropertyCode(std::ostream& os, const std::string& config,
-                             cmTarget const* target,
+                             cmGeneratorTarget const* target,
                              ImportPropertyMap const& properties)
 {
   // Construct the imported target name.
   std::string targetName = this->Namespace;
 
-  targetName += target->GetExportName();
+  targetName += target->Target->GetExportName();
 
   // Set the import properties.
   os << "# Import target \"" << targetName << "\" for configuration \""
@@ -1228,13 +1228,13 @@ cmExportFileGenerator::GenerateImportedFileCheckLoop(std::ostream& os)
 //----------------------------------------------------------------------------
 void
 cmExportFileGenerator
-::GenerateImportedFileChecksCode(std::ostream& os, cmTarget* target,
+::GenerateImportedFileChecksCode(std::ostream& os, cmGeneratorTarget* target,
                                  ImportPropertyMap const& properties,
                                 const std::set<std::string>& importedLocations)
 {
   // Construct the imported target name.
   std::string targetName = this->Namespace;
-  targetName += target->GetExportName();
+  targetName += target->Target->GetExportName();
 
   os << "list(APPEND _IMPORT_CHECK_TARGETS " << targetName << " )\n"
         "list(APPEND _IMPORT_CHECK_FILES_FOR_" << targetName << " ";
diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h
index be5c6f7..18f0b00 100644
--- a/Source/cmExportFileGenerator.h
+++ b/Source/cmExportFileGenerator.h
@@ -78,9 +78,10 @@ protected:
   void GenerateImportTargetCode(std::ostream& os,
                                 cmGeneratorTarget const* target);
   void GenerateImportPropertyCode(std::ostream& os, const std::string& config,
-                                  cmTarget const* target,
+                                  cmGeneratorTarget const* target,
                                   ImportPropertyMap const& properties);
-  void GenerateImportedFileChecksCode(std::ostream& os, cmTarget* target,
+  void GenerateImportedFileChecksCode(std::ostream& os,
+                                      cmGeneratorTarget* target,
                                       ImportPropertyMap const& properties,
                                const std::set<std::string>& importedLocations);
   void GenerateImportedFileCheckLoop(std::ostream& os);
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index 988b0dc..ea5badc 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -375,8 +375,8 @@ cmExportInstallFileGenerator
       //                              properties);
 
       // Generate code in the export file.
-      this->GenerateImportPropertyCode(os, config, gtgt->Target, properties);
-      this->GenerateImportedFileChecksCode(os, gtgt->Target, properties,
+      this->GenerateImportPropertyCode(os, config, gtgt, properties);
+      this->GenerateImportedFileChecksCode(os, gtgt, properties,
                                            importedLocations);
       }
     }

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4f1135ba712f145edb70299d38ac539d70c13c42
commit 4f1135ba712f145edb70299d38ac539d70c13c42
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Oct 17 15:05:46 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Oct 17 15:05:46 2015 +0200

    Export: Port internal utility to cmGeneratorTarget.

diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index c24138f..cf84146 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -237,14 +237,15 @@ void
 cmExportBuildFileGenerator::HandleMissingTarget(
     std::string& link_libs,
     std::vector<std::string>& missingTargets,
-    cmTarget* depender,
-    cmTarget* dependee)
+    cmGeneratorTarget* depender,
+    cmGeneratorTarget* dependee)
 {
   // The target is not in the export.
   if(!this->AppendMode)
     {
     const std::string name = dependee->GetName();
-    cmGlobalGenerator* gg = dependee->GetMakefile()->GetGlobalGenerator();
+    cmGlobalGenerator* gg =
+        dependee->GetLocalGenerator()->GetGlobalGenerator();
     std::vector<std::string> namespaces = this->FindNamespaces(gg, name);
 
     int targetOccurrences = (int)namespaces.size();
@@ -252,7 +253,7 @@ cmExportBuildFileGenerator::HandleMissingTarget(
       {
       std::string missingTarget = namespaces[0];
 
-      missingTarget += dependee->GetExportName();
+      missingTarget += dependee->Target->GetExportName();
       link_libs += missingTarget;
       missingTargets.push_back(missingTarget);
       return;
@@ -267,7 +268,7 @@ cmExportBuildFileGenerator::HandleMissingTarget(
   // Assume the target will be exported by another command.
   // Append it with the export namespace.
   link_libs += this->Namespace;
-  link_libs += dependee->GetExportName();
+  link_libs += dependee->Target->GetExportName();
 }
 
 //----------------------------------------------------------------------------
@@ -315,8 +316,8 @@ cmExportBuildFileGenerator
 //----------------------------------------------------------------------------
 void
 cmExportBuildFileGenerator
-::ComplainAboutMissingTarget(cmTarget* depender,
-                             cmTarget* dependee,
+::ComplainAboutMissingTarget(cmGeneratorTarget* depender,
+                             cmGeneratorTarget* dependee,
                              int occurrences)
 {
   if(cmSystemTools::GetErrorOccuredFlag())
diff --git a/Source/cmExportBuildFileGenerator.h b/Source/cmExportBuildFileGenerator.h
index c7d317f..85aae2f 100644
--- a/Source/cmExportBuildFileGenerator.h
+++ b/Source/cmExportBuildFileGenerator.h
@@ -54,11 +54,11 @@ protected:
                             std::vector<std::string> &missingTargets);
   virtual void HandleMissingTarget(std::string& link_libs,
                                    std::vector<std::string>& missingTargets,
-                                   cmTarget* depender,
-                                   cmTarget* dependee);
+                                   cmGeneratorTarget* depender,
+                                   cmGeneratorTarget* dependee);
 
-  void ComplainAboutMissingTarget(cmTarget* depender,
-                                  cmTarget* dependee,
+  void ComplainAboutMissingTarget(cmGeneratorTarget* depender,
+                                  cmGeneratorTarget* dependee,
                                   int occurrences);
 
   /** Fill in properties indicating built file locations.  */
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 192a932..b597b53 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -661,7 +661,7 @@ cmExportFileGenerator::AddTargetNamespace(std::string &input,
     {
     std::string namespacedTarget;
     this->HandleMissingTarget(namespacedTarget, missingTargets,
-                              target->Target, tgt->Target);
+                              target, tgt);
     if (!namespacedTarget.empty())
       {
       input = namespacedTarget;
diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h
index e1ff83d..be5c6f7 100644
--- a/Source/cmExportFileGenerator.h
+++ b/Source/cmExportFileGenerator.h
@@ -119,8 +119,8 @@ protected:
    *  export set.  */
   virtual void HandleMissingTarget(std::string& link_libs,
                                    std::vector<std::string>& missingTargets,
-                                   cmTarget* depender,
-                                   cmTarget* dependee) = 0;
+                                   cmGeneratorTarget* depender,
+                                   cmGeneratorTarget* dependee) = 0;
   void PopulateInterfaceProperty(const std::string&,
                                  cmGeneratorTarget *target,
                                  cmGeneratorExpression::PreprocessContext,
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index 48f92b0..988b0dc 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -453,19 +453,19 @@ cmExportInstallFileGenerator
 
 //----------------------------------------------------------------------------
 void
-cmExportInstallFileGenerator::HandleMissingTarget(
-  std::string& link_libs, std::vector<std::string>& missingTargets,
-  cmTarget* depender, cmTarget* dependee)
+cmExportInstallFileGenerator::HandleMissingTarget(std::string& link_libs,
+  std::vector<std::string>& missingTargets,
+  cmGeneratorTarget* depender, cmGeneratorTarget* dependee)
 {
   const std::string name = dependee->GetName();
-  cmGlobalGenerator* gg = dependee->GetMakefile()->GetGlobalGenerator();
+  cmGlobalGenerator* gg = dependee->GetLocalGenerator()->GetGlobalGenerator();
   std::vector<std::string> namespaces = this->FindNamespaces(gg, name);
   int targetOccurrences = (int)namespaces.size();
   if (targetOccurrences == 1)
     {
     std::string missingTarget = namespaces[0];
 
-    missingTarget += dependee->GetExportName();
+    missingTarget += dependee->Target->GetExportName();
     link_libs += missingTarget;
     missingTargets.push_back(missingTarget);
     }
@@ -520,8 +520,8 @@ cmExportInstallFileGenerator
 //----------------------------------------------------------------------------
 void
 cmExportInstallFileGenerator
-::ComplainAboutMissingTarget(cmTarget* depender,
-                             cmTarget* dependee,
+::ComplainAboutMissingTarget(cmGeneratorTarget* depender,
+                             cmGeneratorTarget* dependee,
                              int occurrences)
 {
   std::ostringstream e;
diff --git a/Source/cmExportInstallFileGenerator.h b/Source/cmExportInstallFileGenerator.h
index b1fa70e..13dae89 100644
--- a/Source/cmExportInstallFileGenerator.h
+++ b/Source/cmExportInstallFileGenerator.h
@@ -57,13 +57,13 @@ protected:
                             std::vector<std::string> &missingTargets);
   virtual void HandleMissingTarget(std::string& link_libs,
                                    std::vector<std::string>& missingTargets,
-                                   cmTarget* depender,
-                                   cmTarget* dependee);
+                                   cmGeneratorTarget* depender,
+                                   cmGeneratorTarget* dependee);
 
   virtual void ReplaceInstallPrefix(std::string &input);
 
-  void ComplainAboutMissingTarget(cmTarget* depender,
-                                  cmTarget* dependee,
+  void ComplainAboutMissingTarget(cmGeneratorTarget* depender,
+                                  cmGeneratorTarget* dependee,
                                   int occurrences);
 
   std::vector<std::string> FindNamespaces(cmGlobalGenerator* gg,

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=274d73e8616430028ec1245ba6cdc66f73d7cdba
commit 274d73e8616430028ec1245ba6cdc66f73d7cdba
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Oct 17 15:01:25 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Oct 17 15:02:04 2015 +0200

    Export: Port some API to cmGlobalGenerator.

diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index 194d9a2..c24138f 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -235,14 +235,17 @@ cmExportBuildFileGenerator
 //----------------------------------------------------------------------------
 void
 cmExportBuildFileGenerator::HandleMissingTarget(
-  std::string& link_libs, std::vector<std::string>& missingTargets,
-  cmMakefile* mf, cmTarget* depender, cmTarget* dependee)
+    std::string& link_libs,
+    std::vector<std::string>& missingTargets,
+    cmTarget* depender,
+    cmTarget* dependee)
 {
   // The target is not in the export.
   if(!this->AppendMode)
     {
     const std::string name = dependee->GetName();
-    std::vector<std::string> namespaces = this->FindNamespaces(mf, name);
+    cmGlobalGenerator* gg = dependee->GetMakefile()->GetGlobalGenerator();
+    std::vector<std::string> namespaces = this->FindNamespaces(gg, name);
 
     int targetOccurrences = (int)namespaces.size();
     if (targetOccurrences == 1)
@@ -287,10 +290,9 @@ void cmExportBuildFileGenerator
 //----------------------------------------------------------------------------
 std::vector<std::string>
 cmExportBuildFileGenerator
-::FindNamespaces(cmMakefile* mf, const std::string& name)
+::FindNamespaces(cmGlobalGenerator* gg, const std::string& name)
 {
   std::vector<std::string> namespaces;
-  cmGlobalGenerator* gg = mf->GetGlobalGenerator();
 
   std::map<std::string, cmExportBuildFileGenerator*>& exportSets
                                                   = gg->GetBuildExportSets();
diff --git a/Source/cmExportBuildFileGenerator.h b/Source/cmExportBuildFileGenerator.h
index 16695f1..c7d317f 100644
--- a/Source/cmExportBuildFileGenerator.h
+++ b/Source/cmExportBuildFileGenerator.h
@@ -54,7 +54,6 @@ protected:
                             std::vector<std::string> &missingTargets);
   virtual void HandleMissingTarget(std::string& link_libs,
                                    std::vector<std::string>& missingTargets,
-                                   cmMakefile* mf,
                                    cmTarget* depender,
                                    cmTarget* dependee);
 
@@ -72,7 +71,7 @@ protected:
                              const std::string& config);
 
   std::vector<std::string>
-  FindNamespaces(cmMakefile* mf, const std::string& name);
+  FindNamespaces(cmGlobalGenerator* gg, const std::string& name);
 
   std::vector<std::string> Targets;
   cmExportSet *ExportSet;
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 0985542..192a932 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -661,7 +661,6 @@ cmExportFileGenerator::AddTargetNamespace(std::string &input,
     {
     std::string namespacedTarget;
     this->HandleMissingTarget(namespacedTarget, missingTargets,
-                              target->Target->GetMakefile(),
                               target->Target, tgt->Target);
     if (!namespacedTarget.empty())
       {
diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h
index 3280a03..e1ff83d 100644
--- a/Source/cmExportFileGenerator.h
+++ b/Source/cmExportFileGenerator.h
@@ -119,7 +119,6 @@ protected:
    *  export set.  */
   virtual void HandleMissingTarget(std::string& link_libs,
                                    std::vector<std::string>& missingTargets,
-                                   cmMakefile* mf,
                                    cmTarget* depender,
                                    cmTarget* dependee) = 0;
   void PopulateInterfaceProperty(const std::string&,
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index 67697f8..48f92b0 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -455,10 +455,11 @@ cmExportInstallFileGenerator
 void
 cmExportInstallFileGenerator::HandleMissingTarget(
   std::string& link_libs, std::vector<std::string>& missingTargets,
-  cmMakefile* mf, cmTarget* depender, cmTarget* dependee)
+  cmTarget* depender, cmTarget* dependee)
 {
   const std::string name = dependee->GetName();
-  std::vector<std::string> namespaces = this->FindNamespaces(mf, name);
+  cmGlobalGenerator* gg = dependee->GetMakefile()->GetGlobalGenerator();
+  std::vector<std::string> namespaces = this->FindNamespaces(gg, name);
   int targetOccurrences = (int)namespaces.size();
   if (targetOccurrences == 1)
     {
@@ -479,10 +480,9 @@ cmExportInstallFileGenerator::HandleMissingTarget(
 //----------------------------------------------------------------------------
 std::vector<std::string>
 cmExportInstallFileGenerator
-::FindNamespaces(cmMakefile* mf, const std::string& name)
+::FindNamespaces(cmGlobalGenerator* gg, const std::string& name)
 {
   std::vector<std::string> namespaces;
-  cmGlobalGenerator* gg = mf->GetGlobalGenerator();
   const cmExportSetMap& exportSets = gg->GetExportSets();
 
   for(cmExportSetMap::const_iterator expIt = exportSets.begin();
diff --git a/Source/cmExportInstallFileGenerator.h b/Source/cmExportInstallFileGenerator.h
index b06fee5..b1fa70e 100644
--- a/Source/cmExportInstallFileGenerator.h
+++ b/Source/cmExportInstallFileGenerator.h
@@ -57,7 +57,6 @@ protected:
                             std::vector<std::string> &missingTargets);
   virtual void HandleMissingTarget(std::string& link_libs,
                                    std::vector<std::string>& missingTargets,
-                                   cmMakefile* mf,
                                    cmTarget* depender,
                                    cmTarget* dependee);
 
@@ -67,7 +66,7 @@ protected:
                                   cmTarget* dependee,
                                   int occurrences);
 
-  std::vector<std::string> FindNamespaces(cmMakefile* mf,
+  std::vector<std::string> FindNamespaces(cmGlobalGenerator* gg,
                                           const std::string& name);
 
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=80bfcc17eff2681012a234275f6f9bb60b84142e
commit 80bfcc17eff2681012a234275f6f9bb60b84142e
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Oct 17 14:54:15 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Oct 17 14:54:58 2015 +0200

    cmInstallTargetGenerator: Port GetInstallFilename to cmGeneratorTarget.

diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index da963f3..67697f8 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -399,7 +399,7 @@ cmExportInstallFileGenerator
     }
 
   // Get the target to be installed.
-  cmTarget* target = itgen->GetTarget()->Target;
+  cmGeneratorTarget* target = itgen->GetTarget();
 
   // Construct the installed location of the target.
   std::string dest = itgen->GetDestination(config);
@@ -433,7 +433,7 @@ cmExportInstallFileGenerator
     prop += suffix;
 
     // Append the installed file name.
-    if(target->IsAppBundleOnApple())
+    if(target->Target->IsAppBundleOnApple())
       {
       value += itgen->GetInstallFilename(target, config);
       value += ".app/Contents/MacOS/";
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index 2f08165..c2798b2 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -359,34 +359,31 @@ cmInstallTargetGenerator::GetInstallFilename(const std::string& config) const
 {
   NameType nameType = this->ImportLibrary? NameImplib : NameNormal;
   return
-    cmInstallTargetGenerator::GetInstallFilename(this->Target->Target, config,
+    cmInstallTargetGenerator::GetInstallFilename(this->Target, config,
                                                  nameType);
 }
 
 //----------------------------------------------------------------------------
 std::string
-cmInstallTargetGenerator::GetInstallFilename(cmTarget const* target,
+cmInstallTargetGenerator::GetInstallFilename(cmGeneratorTarget const* target,
                                              const std::string& config,
                                              NameType nameType)
 {
   std::string fname;
   // Compute the name of the library.
-  cmGeneratorTarget *gtgt = target->GetMakefile()
-                                  ->GetGlobalGenerator()
-                                  ->GetGeneratorTarget(target);
   if(target->GetType() == cmState::EXECUTABLE)
     {
     std::string targetName;
     std::string targetNameReal;
     std::string targetNameImport;
     std::string targetNamePDB;
-    gtgt->GetExecutableNames(targetName, targetNameReal,
+    target->GetExecutableNames(targetName, targetNameReal,
                                targetNameImport, targetNamePDB,
                                config);
     if(nameType == NameImplib)
       {
       // Use the import library name.
-      if(!gtgt->GetImplibGNUtoMS(targetNameImport, fname,
+      if(!target->GetImplibGNUtoMS(targetNameImport, fname,
                                    "${CMAKE_IMPORT_LIBRARY_SUFFIX}"))
         {
         fname = targetNameImport;
@@ -410,12 +407,12 @@ cmInstallTargetGenerator::GetInstallFilename(cmTarget const* target,
     std::string targetNameReal;
     std::string targetNameImport;
     std::string targetNamePDB;
-    gtgt->GetLibraryNames(targetName, targetNameSO, targetNameReal,
+    target->GetLibraryNames(targetName, targetNameSO, targetNameReal,
                             targetNameImport, targetNamePDB, config);
     if(nameType == NameImplib)
       {
       // Use the import library name.
-      if(!gtgt->GetImplibGNUtoMS(targetNameImport, fname,
+      if(!target->GetImplibGNUtoMS(targetNameImport, fname,
                                    "${CMAKE_IMPORT_LIBRARY_SUFFIX}"))
         {
         fname = targetNameImport;
@@ -585,7 +582,7 @@ cmInstallTargetGenerator
         // The directory portions differ.  Append the filename to
         // create the mapping.
         std::string fname =
-          this->GetInstallFilename(tgt->Target, config, NameSO);
+          this->GetInstallFilename(tgt, config, NameSO);
 
         // Map from the build-tree install_name.
         for_build += fname;
@@ -622,7 +619,7 @@ cmInstallTargetGenerator
       {
       // Prepare to refer to the install-tree install_name.
       new_id = for_install;
-      new_id += this->GetInstallFilename(this->Target->Target, config, NameSO);
+      new_id += this->GetInstallFilename(this->Target, config, NameSO);
       }
     }
 
diff --git a/Source/cmInstallTargetGenerator.h b/Source/cmInstallTargetGenerator.h
index a8f4a75..ec89c05 100644
--- a/Source/cmInstallTargetGenerator.h
+++ b/Source/cmInstallTargetGenerator.h
@@ -14,7 +14,6 @@
 
 #include "cmInstallGenerator.h"
 
-class cmTarget;
 class cmGeneratorTarget;
 
 /** \class cmInstallTargetGenerator
@@ -54,7 +53,7 @@ public:
     NameReal
   };
 
-  static std::string GetInstallFilename(cmTarget const* target,
+  static std::string GetInstallFilename(const cmGeneratorTarget* target,
                                         const std::string& config,
                                         NameType nameType = NameNormal);
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d693e2fca03d03f12f02c38270543b29b0270600
commit d693e2fca03d03f12f02c38270543b29b0270600
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Oct 17 14:33:51 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Oct 17 14:33:51 2015 +0200

    Export: Port interface to cmGeneratorTarget.

diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index 30a8bf2..194d9a2 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -50,7 +50,7 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
                                 ->FindGeneratorTargetToUse(*tei);
     expectedTargets += sep + this->Namespace + te->Target->GetExportName();
     sep = " ";
-    if(this->ExportedTargets.insert(te->Target).second)
+    if(this->ExportedTargets.insert(te).second)
       {
       this->Exports.push_back(te);
       }
@@ -80,45 +80,44 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
       tei != this->Exports.end(); ++tei)
     {
     cmGeneratorTarget* gte = *tei;
-    cmTarget* te = gte->Target;
-    this->GenerateImportTargetCode(os, te);
+    this->GenerateImportTargetCode(os, gte);
 
-    te->AppendBuildInterfaceIncludes();
+    gte->Target->AppendBuildInterfaceIncludes();
 
     ImportPropertyMap properties;
 
-    this->PopulateInterfaceProperty("INTERFACE_INCLUDE_DIRECTORIES", te,
+    this->PopulateInterfaceProperty("INTERFACE_INCLUDE_DIRECTORIES", gte,
                                     cmGeneratorExpression::BuildInterface,
                                     properties, missingTargets);
-    this->PopulateInterfaceProperty("INTERFACE_SOURCES", te,
+    this->PopulateInterfaceProperty("INTERFACE_SOURCES", gte,
                                     cmGeneratorExpression::BuildInterface,
                                     properties, missingTargets);
-    this->PopulateInterfaceProperty("INTERFACE_COMPILE_DEFINITIONS", te,
+    this->PopulateInterfaceProperty("INTERFACE_COMPILE_DEFINITIONS", gte,
                                     cmGeneratorExpression::BuildInterface,
                                     properties, missingTargets);
-    this->PopulateInterfaceProperty("INTERFACE_COMPILE_OPTIONS", te,
+    this->PopulateInterfaceProperty("INTERFACE_COMPILE_OPTIONS", gte,
                                     cmGeneratorExpression::BuildInterface,
                                     properties, missingTargets);
-    this->PopulateInterfaceProperty("INTERFACE_AUTOUIC_OPTIONS", te,
+    this->PopulateInterfaceProperty("INTERFACE_AUTOUIC_OPTIONS", gte,
                                     cmGeneratorExpression::BuildInterface,
                                     properties, missingTargets);
-    this->PopulateInterfaceProperty("INTERFACE_COMPILE_FEATURES", te,
+    this->PopulateInterfaceProperty("INTERFACE_COMPILE_FEATURES", gte,
                                     cmGeneratorExpression::BuildInterface,
                                     properties, missingTargets);
     this->PopulateInterfaceProperty("INTERFACE_POSITION_INDEPENDENT_CODE",
-                                  te, properties);
+                                  gte, properties);
     const bool newCMP0022Behavior =
-                              te->GetPolicyStatusCMP0022() != cmPolicies::WARN
-                           && te->GetPolicyStatusCMP0022() != cmPolicies::OLD;
+        gte->Target->GetPolicyStatusCMP0022() != cmPolicies::WARN
+        && gte->Target->GetPolicyStatusCMP0022() != cmPolicies::OLD;
     if (newCMP0022Behavior)
       {
-      this->PopulateInterfaceLinkLibrariesProperty(te,
+      this->PopulateInterfaceLinkLibrariesProperty(gte,
                                     cmGeneratorExpression::BuildInterface,
                                     properties, missingTargets);
       }
     this->PopulateCompatibleInterfaceProperties(gte, properties);
 
-    this->GenerateInterfaceProperties(te, os, properties);
+    this->GenerateInterfaceProperties(gte, os, properties);
     }
 
   // Generate import file content for each configuration.
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 4e8bc86..0985542 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -155,7 +155,7 @@ void cmExportFileGenerator::GenerateImportConfig(std::ostream& os,
 //----------------------------------------------------------------------------
 void cmExportFileGenerator::PopulateInterfaceProperty(
                                               const std::string& propName,
-                                              cmTarget *target,
+                                              cmGeneratorTarget *target,
                                               ImportPropertyMap &properties)
 {
   const char *input = target->GetProperty(propName);
@@ -169,7 +169,7 @@ void cmExportFileGenerator::PopulateInterfaceProperty(
 void cmExportFileGenerator::PopulateInterfaceProperty(
                       const std::string& propName,
                       const std::string& outputName,
-                      cmTarget *target,
+                      cmGeneratorTarget *target,
                       cmGeneratorExpression::PreprocessContext preprocessRule,
                       ImportPropertyMap &properties,
                       std::vector<std::string> &missingTargets)
@@ -206,12 +206,12 @@ void cmExportFileGenerator::GenerateRequiredCMakeVersion(std::ostream& os,
 
 //----------------------------------------------------------------------------
 bool cmExportFileGenerator::PopulateInterfaceLinkLibrariesProperty(
-                      cmTarget *target,
+                      cmGeneratorTarget *target,
                       cmGeneratorExpression::PreprocessContext preprocessRule,
                       ImportPropertyMap &properties,
                       std::vector<std::string> &missingTargets)
 {
-  if(!target->IsLinkable())
+  if(!target->Target->IsLinkable())
     {
     return false;
     }
@@ -420,7 +420,7 @@ void cmExportFileGenerator::PopulateSourcesInterface(
                                                          true);
   if (!prepro.empty())
     {
-    this->ResolveTargetsInGeneratorExpressions(prepro, gt->Target,
+    this->ResolveTargetsInGeneratorExpressions(prepro, gt,
                                                 missingTargets);
 
     if (!checkInterfaceDirs(prepro, gt, propName))
@@ -488,7 +488,7 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface(
                                                          true);
   if (!prepro.empty())
     {
-    this->ResolveTargetsInGeneratorExpressions(prepro, target->Target,
+    this->ResolveTargetsInGeneratorExpressions(prepro, target,
                                                 missingTargets);
 
     if (!checkInterfaceDirs(prepro, target, propName))
@@ -502,7 +502,7 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface(
 //----------------------------------------------------------------------------
 void cmExportFileGenerator::PopulateInterfaceProperty(
                       const std::string& propName,
-                      cmTarget *target,
+                      cmGeneratorTarget* target,
                       cmGeneratorExpression::PreprocessContext preprocessRule,
                       ImportPropertyMap &properties,
                       std::vector<std::string> &missingTargets)
@@ -574,15 +574,14 @@ void cmExportFileGenerator::PopulateCompatibleInterfaceProperties(
                                 cmGeneratorTarget *gtarget,
                                 ImportPropertyMap &properties)
 {
-  cmTarget *target = gtarget->Target;
   this->PopulateInterfaceProperty("COMPATIBLE_INTERFACE_BOOL",
-                                target, properties);
+                                gtarget, properties);
   this->PopulateInterfaceProperty("COMPATIBLE_INTERFACE_STRING",
-                                target, properties);
+                                gtarget, properties);
   this->PopulateInterfaceProperty("COMPATIBLE_INTERFACE_NUMBER_MIN",
-                                target, properties);
+                                gtarget, properties);
   this->PopulateInterfaceProperty("COMPATIBLE_INTERFACE_NUMBER_MAX",
-                                target, properties);
+                                gtarget, properties);
 
   std::set<std::string> ifaceProperties;
 
@@ -593,12 +592,12 @@ void cmExportFileGenerator::PopulateCompatibleInterfaceProperties(
   getPropertyContents(gtarget, "COMPATIBLE_INTERFACE_NUMBER_MAX",
                       ifaceProperties);
 
-  if (target->GetType() != cmState::INTERFACE_LIBRARY)
+  if (gtarget->GetType() != cmState::INTERFACE_LIBRARY)
     {
     getCompatibleInterfaceProperties(gtarget, ifaceProperties, "");
 
     std::vector<std::string> configNames;
-    target->GetMakefile()->GetConfigurations(configNames);
+    gtarget->Target->GetMakefile()->GetConfigurations(configNames);
 
     for (std::vector<std::string>::const_iterator ci = configNames.begin();
       ci != configNames.end(); ++ci)
@@ -611,19 +610,20 @@ void cmExportFileGenerator::PopulateCompatibleInterfaceProperties(
     it != ifaceProperties.end(); ++it)
     {
     this->PopulateInterfaceProperty("INTERFACE_" + *it,
-                                    target, properties);
+                                    gtarget, properties);
     }
 }
 
 //----------------------------------------------------------------------------
-void cmExportFileGenerator::GenerateInterfaceProperties(cmTarget const* target,
+void cmExportFileGenerator::GenerateInterfaceProperties(
+                                        const cmGeneratorTarget* target,
                                         std::ostream& os,
                                         const ImportPropertyMap &properties)
 {
   if (!properties.empty())
     {
     std::string targetName = this->Namespace;
-    targetName += target->GetExportName();
+    targetName += target->Target->GetExportName();
     os << "set_target_properties(" << targetName << " PROPERTIES\n";
     for(ImportPropertyMap::const_iterator pi = properties.begin();
         pi != properties.end(); ++pi)
@@ -638,12 +638,12 @@ void cmExportFileGenerator::GenerateInterfaceProperties(cmTarget const* target,
 //----------------------------------------------------------------------------
 bool
 cmExportFileGenerator::AddTargetNamespace(std::string &input,
-                                    cmTarget* target,
+                                    cmGeneratorTarget* target,
                                     std::vector<std::string> &missingTargets)
 {
-  cmMakefile *mf = target->GetMakefile();
+  cmLocalGenerator *lg = target->GetLocalGenerator();
 
-  cmTarget *tgt = mf->FindTargetToUse(input);
+  cmGeneratorTarget *tgt = lg->FindGeneratorTargetToUse(input);
   if (!tgt)
     {
     return false;
@@ -655,13 +655,14 @@ cmExportFileGenerator::AddTargetNamespace(std::string &input,
     }
   if(this->ExportedTargets.find(tgt) != this->ExportedTargets.end())
     {
-    input = this->Namespace + tgt->GetExportName();
+    input = this->Namespace + tgt->Target->GetExportName();
     }
   else
     {
     std::string namespacedTarget;
     this->HandleMissingTarget(namespacedTarget, missingTargets,
-                              mf, target, tgt);
+                              target->Target->GetMakefile(),
+                              target->Target, tgt->Target);
     if (!namespacedTarget.empty())
       {
       input = namespacedTarget;
@@ -674,7 +675,7 @@ cmExportFileGenerator::AddTargetNamespace(std::string &input,
 void
 cmExportFileGenerator::ResolveTargetsInGeneratorExpressions(
                                     std::string &input,
-                                    cmTarget* target,
+                                    cmGeneratorTarget* target,
                                     std::vector<std::string> &missingTargets,
                                     FreeTargetsReplace replace)
 {
@@ -711,14 +712,12 @@ cmExportFileGenerator::ResolveTargetsInGeneratorExpressions(
 void
 cmExportFileGenerator::ResolveTargetsInGeneratorExpression(
                                     std::string &input,
-                                    cmTarget* target,
+                                    cmGeneratorTarget* target,
                                     std::vector<std::string> &missingTargets)
 {
   std::string::size_type pos = 0;
   std::string::size_type lastPos = pos;
 
-  cmMakefile *mf = target->GetMakefile();
-
   while((pos = input.find("$<TARGET_PROPERTY:", lastPos)) != input.npos)
     {
     std::string::size_type nameStartPos = pos +
@@ -779,7 +778,7 @@ cmExportFileGenerator::ResolveTargetsInGeneratorExpression(
 
   if (!errorString.empty())
     {
-    mf->IssueMessage(cmake::FATAL_ERROR, errorString);
+    target->GetLocalGenerator()->IssueMessage(cmake::FATAL_ERROR, errorString);
     }
 }
 
@@ -860,7 +859,7 @@ cmExportFileGenerator
                                                          preprocessRule);
   if (!prepro.empty())
     {
-    this->ResolveTargetsInGeneratorExpressions(prepro, target->Target,
+    this->ResolveTargetsInGeneratorExpressions(prepro, target,
                                                missingTargets,
                                                ReplaceFreeTargets);
     properties["IMPORTED_LINK_INTERFACE_LIBRARIES" + suffix] = prepro;
@@ -962,7 +961,7 @@ cmExportFileGenerator
     sep = ";";
 
     std::string temp = *li;
-    this->AddTargetNamespace(temp, target->Target, missingTargets);
+    this->AddTargetNamespace(temp, target, missingTargets);
     link_entries += temp;
     }
 
@@ -1044,12 +1043,12 @@ void cmExportFileGenerator::GenerateExpectedTargetsCode(std::ostream& os,
 //----------------------------------------------------------------------------
 void
 cmExportFileGenerator
-::GenerateImportTargetCode(std::ostream& os, cmTarget const* target)
+::GenerateImportTargetCode(std::ostream& os, const cmGeneratorTarget* target)
 {
   // Construct the imported target name.
   std::string targetName = this->Namespace;
 
-  targetName += target->GetExportName();
+  targetName += target->Target->GetExportName();
 
   // Create the imported target.
   os << "# Create imported target " << targetName << "\n";
@@ -1078,27 +1077,27 @@ cmExportFileGenerator
     }
 
   // Mark the imported executable if it has exports.
-  if(target->IsExecutableWithExports())
+  if(target->Target->IsExecutableWithExports())
     {
     os << "set_property(TARGET " << targetName
        << " PROPERTY ENABLE_EXPORTS 1)\n";
     }
 
   // Mark the imported library if it is a framework.
-  if(target->IsFrameworkOnApple())
+  if(target->Target->IsFrameworkOnApple())
     {
     os << "set_property(TARGET " << targetName
        << " PROPERTY FRAMEWORK 1)\n";
     }
 
   // Mark the imported executable if it is an application bundle.
-  if(target->IsAppBundleOnApple())
+  if(target->Target->IsAppBundleOnApple())
     {
     os << "set_property(TARGET " << targetName
        << " PROPERTY MACOSX_BUNDLE 1)\n";
     }
 
-  if (target->IsCFBundleOnApple())
+  if (target->Target->IsCFBundleOnApple())
     {
     os << "set_property(TARGET " << targetName
        << " PROPERTY BUNDLE 1)\n";
diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h
index 44f779b..3280a03 100644
--- a/Source/cmExportFileGenerator.h
+++ b/Source/cmExportFileGenerator.h
@@ -75,7 +75,8 @@ protected:
                                 const std::string& config = "");
   void GenerateImportFooterCode(std::ostream& os);
   void GenerateImportVersionCode(std::ostream& os);
-  void GenerateImportTargetCode(std::ostream& os, cmTarget const* target);
+  void GenerateImportTargetCode(std::ostream& os,
+                                cmGeneratorTarget const* target);
   void GenerateImportPropertyCode(std::ostream& os, const std::string& config,
                                   cmTarget const* target,
                                   ImportPropertyMap const& properties);
@@ -122,19 +123,21 @@ protected:
                                    cmTarget* depender,
                                    cmTarget* dependee) = 0;
   void PopulateInterfaceProperty(const std::string&,
-                                 cmTarget *target,
+                                 cmGeneratorTarget *target,
                                  cmGeneratorExpression::PreprocessContext,
                                  ImportPropertyMap &properties,
                                  std::vector<std::string> &missingTargets);
-  bool PopulateInterfaceLinkLibrariesProperty(cmTarget *target,
+  bool PopulateInterfaceLinkLibrariesProperty(cmGeneratorTarget* target,
                                  cmGeneratorExpression::PreprocessContext,
                                  ImportPropertyMap &properties,
                                  std::vector<std::string> &missingTargets);
-  void PopulateInterfaceProperty(const std::string& propName, cmTarget *target,
+  void PopulateInterfaceProperty(const std::string& propName,
+                                 cmGeneratorTarget* target,
                                  ImportPropertyMap &properties);
   void PopulateCompatibleInterfaceProperties(cmGeneratorTarget *target,
                                  ImportPropertyMap &properties);
-  void GenerateInterfaceProperties(cmTarget const* target, std::ostream& os,
+  void GenerateInterfaceProperties(cmGeneratorTarget const* target,
+                                   std::ostream& os,
                                    const ImportPropertyMap &properties);
   void PopulateIncludeDirectoriesInterface(
                       cmTargetExport *target,
@@ -159,7 +162,7 @@ protected:
   };
 
   void ResolveTargetsInGeneratorExpressions(std::string &input,
-                          cmTarget* target,
+                          cmGeneratorTarget* target,
                           std::vector<std::string> &missingTargets,
                           FreeTargetsReplace replace = NoReplaceFreeTargets);
 
@@ -182,20 +185,20 @@ protected:
   bool AppendMode;
 
   // The set of targets included in the export.
-  std::set<cmTarget*> ExportedTargets;
+  std::set<cmGeneratorTarget*> ExportedTargets;
 
 private:
   void PopulateInterfaceProperty(const std::string&, const std::string&,
-                                 cmTarget *target,
+                                 cmGeneratorTarget* target,
                                  cmGeneratorExpression::PreprocessContext,
                                  ImportPropertyMap &properties,
                                  std::vector<std::string> &missingTargets);
 
-  bool AddTargetNamespace(std::string &input, cmTarget* target,
+  bool AddTargetNamespace(std::string &input, cmGeneratorTarget* target,
                           std::vector<std::string> &missingTargets);
 
   void ResolveTargetsInGeneratorExpression(std::string &input,
-                                    cmTarget* target,
+                                    cmGeneratorTarget* target,
                                     std::vector<std::string> &missingTargets);
 
   virtual void ReplaceInstallPrefix(std::string &input);
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index d7ca6d5..da963f3 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -52,7 +52,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
         sep + this->Namespace + (*tei)->Target->Target->GetExportName();
     sep = " ";
     cmTargetExport * te = *tei;
-    if(this->ExportedTargets.insert(te->Target->Target).second)
+    if(this->ExportedTargets.insert(te->Target).second)
       {
       allTargets.push_back(te);
       }
@@ -133,12 +133,11 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
       tei != allTargets.end(); ++tei)
     {
     cmGeneratorTarget* gt = (*tei)->Target;
-    cmTarget* te = gt->Target;
 
     requiresConfigFiles = requiresConfigFiles
-                              || te->GetType() != cmState::INTERFACE_LIBRARY;
+                              || gt->GetType() != cmState::INTERFACE_LIBRARY;
 
-    this->GenerateImportTargetCode(os, te);
+    this->GenerateImportTargetCode(os, gt);
 
     ImportPropertyMap properties;
 
@@ -149,32 +148,32 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
                                   cmGeneratorExpression::InstallInterface,
                                   properties, missingTargets);
     this->PopulateInterfaceProperty("INTERFACE_SYSTEM_INCLUDE_DIRECTORIES",
-                                  te,
+                                  gt,
                                   cmGeneratorExpression::InstallInterface,
                                   properties, missingTargets);
     this->PopulateInterfaceProperty("INTERFACE_COMPILE_DEFINITIONS",
-                                  te,
+                                  gt,
                                   cmGeneratorExpression::InstallInterface,
                                   properties, missingTargets);
     this->PopulateInterfaceProperty("INTERFACE_COMPILE_OPTIONS",
-                                  te,
+                                  gt,
                                   cmGeneratorExpression::InstallInterface,
                                   properties, missingTargets);
     this->PopulateInterfaceProperty("INTERFACE_AUTOUIC_OPTIONS",
-                                  te,
+                                  gt,
                                   cmGeneratorExpression::InstallInterface,
                                   properties, missingTargets);
     this->PopulateInterfaceProperty("INTERFACE_COMPILE_FEATURES",
-                                  te,
+                                  gt,
                                   cmGeneratorExpression::InstallInterface,
                                   properties, missingTargets);
 
     const bool newCMP0022Behavior =
-                              te->GetPolicyStatusCMP0022() != cmPolicies::WARN
-                           && te->GetPolicyStatusCMP0022() != cmPolicies::OLD;
+        gt->Target->GetPolicyStatusCMP0022() != cmPolicies::WARN
+        && gt->Target->GetPolicyStatusCMP0022() != cmPolicies::OLD;
     if (newCMP0022Behavior)
       {
-      if (this->PopulateInterfaceLinkLibrariesProperty(te,
+      if (this->PopulateInterfaceLinkLibrariesProperty(gt,
                                     cmGeneratorExpression::InstallInterface,
                                     properties, missingTargets)
           && !this->ExportOld)
@@ -182,11 +181,11 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
         require2_8_12 = true;
         }
       }
-    if (te->GetType() == cmState::INTERFACE_LIBRARY)
+    if (gt->GetType() == cmState::INTERFACE_LIBRARY)
       {
       require3_0_0 = true;
       }
-    if(te->GetProperty("INTERFACE_SOURCES"))
+    if(gt->GetProperty("INTERFACE_SOURCES"))
       {
       // We can only generate INTERFACE_SOURCES in CMake 3.3, but CMake 3.1
       // can consume them.
@@ -194,11 +193,11 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
       }
 
     this->PopulateInterfaceProperty("INTERFACE_POSITION_INDEPENDENT_CODE",
-                                  te, properties);
+                                  gt, properties);
 
     this->PopulateCompatibleInterfaceProperties(gt, properties);
 
-    this->GenerateInterfaceProperties(gt->Target, os, properties);
+    this->GenerateInterfaceProperties(gt, os, properties);
     }
 
   if (require3_1_0)
diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx
index 0fafa86..1daa67e 100644
--- a/Source/cmExportTryCompileFileGenerator.cxx
+++ b/Source/cmExportTryCompileFileGenerator.cxx
@@ -28,38 +28,38 @@ cmExportTryCompileFileGenerator::cmExportTryCompileFileGenerator(
 
 bool cmExportTryCompileFileGenerator::GenerateMainFile(std::ostream& os)
 {
-  std::set<cmTarget const*> emitted;
-  std::set<cmTarget const*> emittedDeps;
+  std::set<cmGeneratorTarget const*> emitted;
+  std::set<cmGeneratorTarget const*> emittedDeps;
   while(!this->Exports.empty())
     {
     cmGeneratorTarget const* te = this->Exports.back();
     this->Exports.pop_back();
-    if (emitted.insert(te->Target).second)
+    if (emitted.insert(te).second)
       {
-      emittedDeps.insert(te->Target);
-      this->GenerateImportTargetCode(os, te->Target);
+      emittedDeps.insert(te);
+      this->GenerateImportTargetCode(os, te);
 
       ImportPropertyMap properties;
 
 #define FIND_TARGETS(PROPERTY) \
-      this->FindTargets("INTERFACE_" #PROPERTY, te->Target, emittedDeps);
+      this->FindTargets("INTERFACE_" #PROPERTY, te, emittedDeps);
 
       CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(FIND_TARGETS)
 
 #undef FIND_TARGETS
 
-      this->PopulateProperties(te->Target, properties, emittedDeps);
+      this->PopulateProperties(te, properties, emittedDeps);
 
-      this->GenerateInterfaceProperties(te->Target, os, properties);
+      this->GenerateInterfaceProperties(te, os, properties);
       }
     }
   return true;
 }
 
 std::string cmExportTryCompileFileGenerator::FindTargets(
-                                          const std::string& propName,
-                                          cmTarget const* tgt,
-                                          std::set<cmTarget const*> &emitted)
+                                  const std::string& propName,
+                                  cmGeneratorTarget const* tgt,
+                                  std::set<cmGeneratorTarget const*> &emitted)
 {
   const char *prop = tgt->GetProperty(propName);
   if(!prop)
@@ -77,24 +77,22 @@ std::string cmExportTryCompileFileGenerator::FindTargets(
 
   cmTarget dummyHead;
   dummyHead.SetType(cmState::EXECUTABLE, "try_compile_dummy_exe");
-  dummyHead.SetMakefile(tgt->GetMakefile());
+  dummyHead.SetMakefile(tgt->Target->GetMakefile());
 
-  cmGeneratorTarget* gtgt =
-      tgt->GetMakefile()->GetGlobalGenerator()->GetGeneratorTarget(tgt);
-  cmGeneratorTarget gDummyHead(&dummyHead, gtgt->GetLocalGenerator());
+  cmGeneratorTarget gDummyHead(&dummyHead, tgt->GetLocalGenerator());
 
-  std::string result = cge->Evaluate(gtgt->GetLocalGenerator(), this->Config,
+  std::string result = cge->Evaluate(tgt->GetLocalGenerator(), this->Config,
                                      false, &gDummyHead,
-                                     gtgt, &dagChecker);
+                                     tgt, &dagChecker);
 
   const std::set<cmGeneratorTarget const*> &allTargets =
       cge->GetAllTargetsSeen();
   for(std::set<cmGeneratorTarget const*>::const_iterator li =
       allTargets.begin(); li != allTargets.end(); ++li)
     {
-    if(emitted.insert((*li)->Target).second)
+    if(emitted.insert(*li).second)
       {
-      this->Exports.push_back((*li));
+      this->Exports.push_back(*li);
       }
     }
   return result;
@@ -102,13 +100,12 @@ std::string cmExportTryCompileFileGenerator::FindTargets(
 
 //----------------------------------------------------------------------------
 void
-cmExportTryCompileFileGenerator::PopulateProperties(cmTarget const* target,
-                                                ImportPropertyMap& properties,
-                                          std::set<cmTarget const*> &emitted)
+cmExportTryCompileFileGenerator::PopulateProperties(
+                                 const cmGeneratorTarget* target,
+                                 ImportPropertyMap& properties,
+                                 std::set<cmGeneratorTarget const*> &emitted)
 {
-  cmPropertyMap props = target->GetProperties();
-  cmGeneratorTarget* gt =
-      target->GetMakefile()->GetGlobalGenerator()->GetGeneratorTarget(target);
+  cmPropertyMap props = target->Target->GetProperties();
   for(cmPropertyMap::const_iterator i = props.begin(); i != props.end(); ++i)
     {
     properties[i->first] = i->second.GetValue();
@@ -126,8 +123,8 @@ cmExportTryCompileFileGenerator::PopulateProperties(cmTarget const* target,
           li != depends.end(); ++li)
         {
         cmGeneratorTarget *tgt =
-            gt->GetLocalGenerator()->FindGeneratorTargetToUse(*li);
-        if(tgt && emitted.insert(tgt->Target).second)
+            target->GetLocalGenerator()->FindGeneratorTargetToUse(*li);
+        if(tgt && emitted.insert(tgt).second)
           {
           this->Exports.push_back(tgt);
           }
diff --git a/Source/cmExportTryCompileFileGenerator.h b/Source/cmExportTryCompileFileGenerator.h
index 4507787..19d8024 100644
--- a/Source/cmExportTryCompileFileGenerator.h
+++ b/Source/cmExportTryCompileFileGenerator.h
@@ -41,15 +41,16 @@ protected:
                                    cmTarget*,
                                    cmTarget*) {}
 
-  void PopulateProperties(cmTarget const* target,
+  void PopulateProperties(cmGeneratorTarget const* target,
                           ImportPropertyMap& properties,
-                          std::set<cmTarget const*> &emitted);
+                          std::set<const cmGeneratorTarget*>& emitted);
 
   std::string InstallNameDir(cmGeneratorTarget* target,
                              const std::string& config);
 private:
-  std::string FindTargets(const std::string& prop, cmTarget const* tgt,
-                   std::set<cmTarget const*> &emitted);
+  std::string FindTargets(const std::string& prop,
+                          const cmGeneratorTarget* tgt,
+                          std::set<const cmGeneratorTarget*>& emitted);
 
 
   std::vector<cmGeneratorTarget const*> Exports;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bf32afb11df8ca3e03c418a9073941dd3e12fb5c
commit bf32afb11df8ca3e03c418a9073941dd3e12fb5c
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Oct 17 14:27:59 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Oct 17 14:27:59 2015 +0200

    cmExportTryCompileFileGenerator: Port to cmGeneratorTarget.

diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 5bb0f99..4a1f770 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -34,7 +34,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
   std::string outputVariable;
   std::string copyFile;
   std::string copyFileError;
-  std::vector<cmTarget const*> targets;
+  std::vector<std::string> targets;
   std::string libsToLink = " ";
   bool useOldLinkLibs = true;
   char targetNameBuf[64];
@@ -112,7 +112,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
           }
         if (tgt->IsImported())
           {
-          targets.push_back(tgt);
+          targets.push_back(argv[i]);
           }
         }
       }
@@ -375,9 +375,8 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
     if (!targets.empty())
       {
       std::string fname = "/" + std::string(targetName) + "Targets.cmake";
-      cmExportTryCompileFileGenerator tcfg(gg);
+      cmExportTryCompileFileGenerator tcfg(gg, targets, this->Makefile);
       tcfg.SetExportFile((this->BinaryDirectory + fname).c_str());
-      tcfg.SetExports(targets);
       tcfg.SetConfig(this->Makefile->GetSafeDefinition(
                                           "CMAKE_TRY_COMPILE_CONFIGURATION"));
 
diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx
index d0e65e1..0fafa86 100644
--- a/Source/cmExportTryCompileFileGenerator.cxx
+++ b/Source/cmExportTryCompileFileGenerator.cxx
@@ -14,13 +14,16 @@
 
 #include "cmGeneratedFileStream.h"
 #include "cmGlobalGenerator.h"
+#include "cmLocalGenerator.h"
 #include "cmGeneratorExpressionDAGChecker.h"
 
 //----------------------------------------------------------------------------
 cmExportTryCompileFileGenerator::cmExportTryCompileFileGenerator(
-    cmGlobalGenerator* gg)
+    cmGlobalGenerator* gg,
+    const std::vector<std::string>& targets,
+    cmMakefile* mf)
 {
-  gg->CreateGenerationObjects(cmGlobalGenerator::ImportedOnly);
+  gg->CreateImportedGenerationObjects(mf, targets, this->Exports);
 }
 
 bool cmExportTryCompileFileGenerator::GenerateMainFile(std::ostream& os)
@@ -29,25 +32,25 @@ bool cmExportTryCompileFileGenerator::GenerateMainFile(std::ostream& os)
   std::set<cmTarget const*> emittedDeps;
   while(!this->Exports.empty())
     {
-    cmTarget const* te = this->Exports.back();
+    cmGeneratorTarget const* te = this->Exports.back();
     this->Exports.pop_back();
-    if (emitted.insert(te).second)
+    if (emitted.insert(te->Target).second)
       {
-      emittedDeps.insert(te);
-      this->GenerateImportTargetCode(os, te);
+      emittedDeps.insert(te->Target);
+      this->GenerateImportTargetCode(os, te->Target);
 
       ImportPropertyMap properties;
 
 #define FIND_TARGETS(PROPERTY) \
-      this->FindTargets("INTERFACE_" #PROPERTY, te, emittedDeps);
+      this->FindTargets("INTERFACE_" #PROPERTY, te->Target, emittedDeps);
 
       CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(FIND_TARGETS)
 
 #undef FIND_TARGETS
 
-      this->PopulateProperties(te, properties, emittedDeps);
+      this->PopulateProperties(te->Target, properties, emittedDeps);
 
-      this->GenerateInterfaceProperties(te, os, properties);
+      this->GenerateInterfaceProperties(te->Target, os, properties);
       }
     }
   return true;
@@ -91,7 +94,7 @@ std::string cmExportTryCompileFileGenerator::FindTargets(
     {
     if(emitted.insert((*li)->Target).second)
       {
-      this->Exports.push_back((*li)->Target);
+      this->Exports.push_back((*li));
       }
     }
   return result;
@@ -104,6 +107,8 @@ cmExportTryCompileFileGenerator::PopulateProperties(cmTarget const* target,
                                           std::set<cmTarget const*> &emitted)
 {
   cmPropertyMap props = target->GetProperties();
+  cmGeneratorTarget* gt =
+      target->GetMakefile()->GetGlobalGenerator()->GetGeneratorTarget(target);
   for(cmPropertyMap::const_iterator i = props.begin(); i != props.end(); ++i)
     {
     properties[i->first] = i->second.GetValue();
@@ -120,8 +125,9 @@ cmExportTryCompileFileGenerator::PopulateProperties(cmTarget const* target,
       for(std::vector<std::string>::const_iterator li = depends.begin();
           li != depends.end(); ++li)
         {
-        cmTarget *tgt = target->GetMakefile()->FindTargetToUse(*li);
-        if(tgt && emitted.insert(tgt).second)
+        cmGeneratorTarget *tgt =
+            gt->GetLocalGenerator()->FindGeneratorTargetToUse(*li);
+        if(tgt && emitted.insert(tgt->Target).second)
           {
           this->Exports.push_back(tgt);
           }
diff --git a/Source/cmExportTryCompileFileGenerator.h b/Source/cmExportTryCompileFileGenerator.h
index 8838eca..4507787 100644
--- a/Source/cmExportTryCompileFileGenerator.h
+++ b/Source/cmExportTryCompileFileGenerator.h
@@ -20,11 +20,11 @@ class cmInstallTargetGenerator;
 class cmExportTryCompileFileGenerator: public cmExportFileGenerator
 {
 public:
-  cmExportTryCompileFileGenerator(cmGlobalGenerator* gg);
+  cmExportTryCompileFileGenerator(cmGlobalGenerator* gg,
+                                  std::vector<std::string> const& targets,
+                                  cmMakefile* mf);
 
   /** Set the list of targets to export.  */
-  void SetExports(const std::vector<cmTarget const*> &exports)
-    { this->Exports = exports; }
   void SetConfig(const std::string& config) { this->Config = config; }
 protected:
 
@@ -52,7 +52,7 @@ private:
                    std::set<cmTarget const*> &emitted);
 
 
-  std::vector<cmTarget const*> Exports;
+  std::vector<cmGeneratorTarget const*> Exports;
   std::string Config;
 };
 
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 9d54f6f..f54f936 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1202,6 +1202,26 @@ void cmGlobalGenerator::CreateGenerationObjects(TargetTypes targetTypes)
   this->ComputeBuildFileGenerators();
 }
 
+void cmGlobalGenerator::CreateImportedGenerationObjects(cmMakefile* mf,
+    const std::vector<std::string>& targets,
+    std::vector<const cmGeneratorTarget*>& exports)
+{
+  this->CreateGenerationObjects(ImportedOnly);
+  std::vector<cmMakefile*>::iterator mfit =
+      std::find(this->Makefiles.begin(), this->Makefiles.end(), mf);
+  cmLocalGenerator* lg =
+      this->LocalGenerators[std::distance(this->Makefiles.begin(), mfit)];
+  for (std::vector<std::string>::const_iterator it = targets.begin();
+       it != targets.end(); ++it)
+    {
+    cmGeneratorTarget* gt = lg->FindGeneratorTargetToUse(*it);
+    if (gt)
+      {
+      exports.push_back(gt);
+      }
+    }
+}
+
 cmExportBuildFileGenerator*
 cmGlobalGenerator::GetExportedTargetsFile(const std::string &filename) const
 {
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index ad8992f..4e6b11d 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -91,6 +91,9 @@ public:
     ImportedOnly
   };
 
+  void CreateImportedGenerationObjects(cmMakefile* mf,
+                             std::vector<std::string> const& targets,
+                             std::vector<cmGeneratorTarget const*>& exports);
   void CreateGenerationObjects(TargetTypes targetTypes = AllTargets);
 
   /**

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a4d256a66132604486d047aa019de58f398b408d
commit a4d256a66132604486d047aa019de58f398b408d
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Oct 17 13:31:33 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Oct 17 13:48:02 2015 +0200

    cmExportSet: Store a cmGeneratorTarget.
    
    Set the member at compute time from the stored name.

diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index 72b101f..30a8bf2 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -27,6 +27,10 @@ cmExportBuildFileGenerator::cmExportBuildFileGenerator()
 void cmExportBuildFileGenerator::Compute(cmLocalGenerator* lg)
 {
   this->LG = lg;
+  if (this->ExportSet)
+    {
+    this->ExportSet->Compute(lg);
+    }
 }
 
 //----------------------------------------------------------------------------
@@ -274,7 +278,7 @@ void cmExportBuildFileGenerator
           tei = this->ExportSet->GetTargetExports()->begin();
           tei != this->ExportSet->GetTargetExports()->end(); ++tei)
       {
-      targets.push_back((*tei)->GetName());
+      targets.push_back((*tei)->TargetName);
       }
     return;
     }
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 6127626..4e8bc86 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -398,11 +398,11 @@ void cmExportFileGenerator::PopulateSourcesInterface(
                       ImportPropertyMap &properties,
                       std::vector<std::string> &missingTargets)
 {
-  cmTarget *target = tei->Target;
+  cmGeneratorTarget* gt = tei->Target;
   assert(preprocessRule == cmGeneratorExpression::InstallInterface);
 
   const char *propName = "INTERFACE_SOURCES";
-  const char *input = target->GetProperty(propName);
+  const char *input = gt->GetProperty(propName);
 
   if (!input)
     {
@@ -420,11 +420,9 @@ void cmExportFileGenerator::PopulateSourcesInterface(
                                                          true);
   if (!prepro.empty())
     {
-    this->ResolveTargetsInGeneratorExpressions(prepro, target,
+    this->ResolveTargetsInGeneratorExpressions(prepro, gt->Target,
                                                 missingTargets);
 
-    cmGeneratorTarget* gt = target->GetMakefile()
-        ->GetGlobalGenerator()->GetGeneratorTarget(target);
     if (!checkInterfaceDirs(prepro, gt, propName))
       {
       return;
@@ -440,9 +438,7 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface(
                       ImportPropertyMap &properties,
                       std::vector<std::string> &missingTargets)
 {
-  cmGeneratorTarget *target = tei->Target->GetMakefile()
-                                 ->GetGlobalGenerator()
-                                 ->GetGeneratorTarget(tei->Target);
+  cmGeneratorTarget *target = tei->Target;
   assert(preprocessRule == cmGeneratorExpression::InstallInterface);
 
   const char *propName = "INTERFACE_INCLUDE_DIRECTORIES";
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index 5a51442..d7ca6d5 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -48,10 +48,11 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
         tei = this->IEGen->GetExportSet()->GetTargetExports()->begin();
       tei != this->IEGen->GetExportSet()->GetTargetExports()->end(); ++tei)
     {
-    expectedTargets += sep + this->Namespace + (*tei)->Target->GetExportName();
+    expectedTargets +=
+        sep + this->Namespace + (*tei)->Target->Target->GetExportName();
     sep = " ";
     cmTargetExport * te = *tei;
-    if(this->ExportedTargets.insert(te->Target).second)
+    if(this->ExportedTargets.insert(te->Target->Target).second)
       {
       allTargets.push_back(te);
       }
@@ -131,7 +132,8 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
         tei = allTargets.begin();
       tei != allTargets.end(); ++tei)
     {
-    cmTarget* te = (*tei)->Target;
+    cmGeneratorTarget* gt = (*tei)->Target;
+    cmTarget* te = gt->Target;
 
     requiresConfigFiles = requiresConfigFiles
                               || te->GetType() != cmState::INTERFACE_LIBRARY;
@@ -193,13 +195,10 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
 
     this->PopulateInterfaceProperty("INTERFACE_POSITION_INDEPENDENT_CODE",
                                   te, properties);
-    cmGeneratorTarget *gtgt = te->GetMakefile()
-                                ->GetGlobalGenerator()
-                                ->GetGeneratorTarget(te);
 
-    this->PopulateCompatibleInterfaceProperties(gtgt, properties);
+    this->PopulateCompatibleInterfaceProperties(gt, properties);
 
-    this->GenerateInterfaceProperties(te, os, properties);
+    this->GenerateInterfaceProperties(gt->Target, os, properties);
     }
 
   if (require3_1_0)
@@ -362,8 +361,7 @@ cmExportInstallFileGenerator
     if(!properties.empty())
       {
       // Get the rest of the target details.
-      cmGeneratorTarget *gtgt = te->Target->GetMakefile()
-                    ->GetGlobalGenerator()->GetGeneratorTarget(te->Target);
+      cmGeneratorTarget *gtgt = te->Target;
       this->SetImportDetailProperties(config, suffix,
                                       gtgt, properties, missingTargets);
 
@@ -378,8 +376,8 @@ cmExportInstallFileGenerator
       //                              properties);
 
       // Generate code in the export file.
-      this->GenerateImportPropertyCode(os, config, te->Target, properties);
-      this->GenerateImportedFileChecksCode(os, te->Target, properties,
+      this->GenerateImportPropertyCode(os, config, gtgt->Target, properties);
+      this->GenerateImportedFileChecksCode(os, gtgt->Target, properties,
                                            importedLocations);
       }
     }
diff --git a/Source/cmExportSet.cxx b/Source/cmExportSet.cxx
index 4148fb5..0059b64 100644
--- a/Source/cmExportSet.cxx
+++ b/Source/cmExportSet.cxx
@@ -13,12 +13,22 @@
 #include "cmExportSet.h"
 #include "cmTargetExport.h"
 #include "cmAlgorithms.h"
+#include "cmLocalGenerator.h"
 
 cmExportSet::~cmExportSet()
 {
   cmDeleteAll(this->TargetExports);
 }
 
+void cmExportSet::Compute(cmLocalGenerator* lg)
+{
+  for (std::vector<cmTargetExport*>::iterator it = this->TargetExports.begin();
+       it != this->TargetExports.end(); ++it)
+    {
+    (*it)->Target = lg->FindGeneratorTargetToUse((*it)->TargetName);
+    }
+}
+
 void cmExportSet::AddTargetExport(cmTargetExport* te)
 {
   this->TargetExports.push_back(te);
diff --git a/Source/cmExportSet.h b/Source/cmExportSet.h
index a57aa12..d780a22 100644
--- a/Source/cmExportSet.h
+++ b/Source/cmExportSet.h
@@ -15,6 +15,7 @@
 #include "cmSystemTools.h"
 class cmTargetExport;
 class cmInstallExportGenerator;
+class cmLocalGenerator;
 
 /// A set of targets that were installed with the same EXPORT parameter.
 class cmExportSet
@@ -25,6 +26,8 @@ public:
   /// Destructor
   ~cmExportSet();
 
+  void Compute(cmLocalGenerator* lg);
+
   void AddTargetExport(cmTargetExport* tgt);
 
   void AddInstallation(cmInstallExportGenerator const* installation);
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index c22edf3..6b06fce 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -773,7 +773,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
     if(!exports.GetString().empty() && !namelinkOnly)
       {
       cmTargetExport *te = new cmTargetExport;
-      te->Target = ⌖
+      te->TargetName = target.GetName();
       te->ArchiveGenerator = archiveGenerator;
       te->BundleGenerator = bundleGenerator;
       te->FrameworkGenerator = frameworkGenerator;
@@ -1379,16 +1379,17 @@ bool cmInstallCommand::HandleExportMode(std::vector<std::string> const& args)
         tei != exportSet->GetTargetExports()->end(); ++tei)
       {
       cmTargetExport const* te = *tei;
+      cmTarget* tgt = this->Makefile->FindTarget(te->TargetName);
       const bool newCMP0022Behavior =
-                      te->Target->GetPolicyStatusCMP0022() != cmPolicies::WARN
-                   && te->Target->GetPolicyStatusCMP0022() != cmPolicies::OLD;
+                      tgt->GetPolicyStatusCMP0022() != cmPolicies::WARN
+                   && tgt->GetPolicyStatusCMP0022() != cmPolicies::OLD;
 
       if(!newCMP0022Behavior)
         {
         std::ostringstream e;
         e << "INSTALL(EXPORT) given keyword \""
           << "EXPORT_LINK_INTERFACE_LIBRARIES" << "\", but target \""
-          << te->Target->GetName()
+          << te->TargetName
           << "\" does not have policy CMP0022 set to NEW.";
         this->SetError(e.str());
         return false;
diff --git a/Source/cmInstallExportGenerator.cxx b/Source/cmInstallExportGenerator.cxx
index f7c9cc2..9570ba3 100644
--- a/Source/cmInstallExportGenerator.cxx
+++ b/Source/cmInstallExportGenerator.cxx
@@ -56,6 +56,7 @@ cmInstallExportGenerator::~cmInstallExportGenerator()
 void cmInstallExportGenerator::Compute(cmLocalGenerator* lg)
 {
   this->LocalGenerator = lg;
+  this->ExportSet->Compute(lg);
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmTargetExport.h b/Source/cmTargetExport.h
index 7665888..2781337 100644
--- a/Source/cmTargetExport.h
+++ b/Source/cmTargetExport.h
@@ -14,7 +14,7 @@
 
 #include "cmStandardIncludes.h"
 
-class cmTarget;
+class cmGeneratorTarget;
 class cmInstallTargetGenerator;
 class cmInstallFilesGenerator;
 
@@ -25,7 +25,8 @@ class cmInstallFilesGenerator;
 class cmTargetExport
 {
 public:
-  cmTarget* Target; ///< The target
+  std::string TargetName;
+  cmGeneratorTarget* Target;
 
   ///@name Generators
   ///@{

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=772e91eba562f466e9ce11dfc7b61a8c716f7afb
commit 772e91eba562f466e9ce11dfc7b61a8c716f7afb
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Oct 17 13:29:46 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Oct 17 13:30:48 2015 +0200

    cmGlobalGenerator: Compute export() related classes early.
    
    Simplify CMP0024 handling.

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index a42ea22..9d54f6f 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1199,6 +1199,7 @@ void cmGlobalGenerator::CreateGenerationObjects(TargetTypes targetTypes)
   cmDeleteAll(this->GeneratorTargets);
   this->GeneratorTargets.clear();
   this->CreateGeneratorTargets(targetTypes);
+  this->ComputeBuildFileGenerators();
 }
 
 cmExportBuildFileGenerator*
@@ -1279,8 +1280,6 @@ bool cmGlobalGenerator::Compute()
       this->CreateQtAutoGeneratorsTargets();
 #endif
 
-  this->ComputeBuildFileGenerators();
-
   unsigned int i;
 
   // Add generator specific helper commands
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 6887409..ad8992f 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -365,8 +365,6 @@ public:
   bool GetConfigureDoneCMP0026() const
   { return this->ConfigureDoneCMP0026AndCMP0024; }
 
-  void ComputeBuildFileGenerators();
-
   std::string MakeSilentFlag;
 protected:
   typedef std::vector<cmLocalGenerator*> GeneratorVector;
@@ -471,6 +469,8 @@ private:
   void CheckCompilerIdCompatibility(cmMakefile* mf,
                                     std::string const& lang) const;
 
+  void ComputeBuildFileGenerators();
+
   cmExternalMakefileProjectGenerator* ExtraGenerator;
 
   // track files replaced during a Generate
diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx
index 97d4d56..8890e2b 100644
--- a/Source/cmIncludeCommand.cxx
+++ b/Source/cmIncludeCommand.cxx
@@ -126,7 +126,6 @@ bool cmIncludeCommand
         }
       }
     gg->CreateGenerationObjects();
-    gg->ComputeBuildFileGenerators();
     gg->GenerateImportFile(fname_abs);
     }
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=10902e4a6c66162c165cf804e46c8879290244a3
commit 10902e4a6c66162c165cf804e46c8879290244a3
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Oct 17 12:52:16 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Oct 17 12:52:16 2015 +0200

    fixup! Use GetName from cmGeneratorTarget.

diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index 2d74b97..72b101f 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -274,7 +274,7 @@ void cmExportBuildFileGenerator
           tei = this->ExportSet->GetTargetExports()->begin();
           tei != this->ExportSet->GetTargetExports()->end(); ++tei)
       {
-      targets.push_back((*tei)->Target->GetName());
+      targets.push_back((*tei)->GetName());
       }
     return;
     }

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

Summary of changes:
 Source/cmComputeLinkInformation.cxx            |    4 +-
 Source/cmCoreTryCompile.cxx                    |    7 +-
 Source/cmExportBuildFileGenerator.cxx          |   58 ++++++++-------
 Source/cmExportBuildFileGenerator.h            |   11 ++-
 Source/cmExportFileGenerator.cxx               |   69 ++++++++----------
 Source/cmExportFileGenerator.h                 |   33 +++++----
 Source/cmExportInstallFileGenerator.cxx        |   63 ++++++++--------
 Source/cmExportInstallFileGenerator.h          |   11 ++-
 Source/cmExportSet.cxx                         |   10 +++
 Source/cmExportSet.h                           |    3 +
 Source/cmExportTryCompileFileGenerator.cxx     |   45 ++++++------
 Source/cmExportTryCompileFileGenerator.h       |   17 +++--
 Source/cmGeneratorExpressionNode.cxx           |    2 +-
 Source/cmGeneratorTarget.cxx                   |   93 ++++++++++++++++++++----
 Source/cmGeneratorTarget.h                     |   18 +++++
 Source/cmGlobalGenerator.cxx                   |   26 ++++++-
 Source/cmGlobalGenerator.h                     |    7 +-
 Source/cmGlobalNinjaGenerator.cxx              |    5 +-
 Source/cmGlobalVisualStudioGenerator.cxx       |    5 +-
 Source/cmGlobalXCodeGenerator.cxx              |   54 ++++++++------
 Source/cmGlobalXCodeGenerator.h                |    4 +-
 Source/cmIncludeCommand.cxx                    |    1 -
 Source/cmInstallCommand.cxx                    |    9 ++-
 Source/cmInstallExportGenerator.cxx            |    1 +
 Source/cmInstallTargetGenerator.cxx            |   27 +++----
 Source/cmInstallTargetGenerator.h              |    3 +-
 Source/cmMakefileExecutableTargetGenerator.cxx |    2 +-
 Source/cmMakefileLibraryTargetGenerator.cxx    |   11 +--
 Source/cmNinjaNormalTargetGenerator.cxx        |   12 +--
 Source/cmTarget.cxx                            |   46 ------------
 Source/cmTarget.h                              |   10 ---
 Source/cmTargetExport.h                        |    5 +-
 32 files changed, 369 insertions(+), 303 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list