[Cmake-commits] CMake branch, next, updated. v3.4.0-rc1-330-gd4508aa

Stephen Kelly steveire at gmail.com
Sat Oct 10 06:12:36 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  d4508aa255bf74773774cf685f6b60b7c683df01 (commit)
       via  eb30ccd427e00974c561e5f3ecf8881368678609 (commit)
       via  ad54856827f8a11ffbf764ad9fa7ee92211a6eae (commit)
       via  265136cc0531171803b63c5c2868f30eed4cf71e (commit)
       via  9e7c41bf54e943bb370d32fd1a2065c570eb4149 (commit)
      from  c9c13c26f36a68e0c9d6d7a35055bc156ef6aea9 (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=d4508aa255bf74773774cf685f6b60b7c683df01
commit d4508aa255bf74773774cf685f6b60b7c683df01
Merge: c9c13c2 eb30ccd
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Oct 10 06:12:35 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sat Oct 10 06:12:35 2015 -0400

    Merge topic 'use-generator-target' into next
    
    eb30ccd4 Genex: Port implementation detail to cmGeneratorTarget.
    ad548568 cmGeneratorTarget: Move GetSupportDirectory from cmTarget.
    265136cc cmGeneratorTarget: Move HasImportLibrary from cmTarget.
    9e7c41bf cmGeneratorTarget: Move HasImplibGNUtoMS from cmTarget.


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=eb30ccd427e00974c561e5f3ecf8881368678609
commit eb30ccd427e00974c561e5f3ecf8881368678609
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Oct 8 01:12:25 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Oct 10 12:10:53 2015 +0200

    Genex: Port implementation detail to cmGeneratorTarget.

diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index 2d9025e..88d10aa 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -831,8 +831,8 @@ template <typename T>
 std::string
 getLinkedTargetsContent(
   std::vector<T> const &libraries,
-  cmTarget const* target,
-  cmTarget const* headTarget,
+  cmGeneratorTarget const* target,
+  cmGeneratorTarget const* headTarget,
   cmGeneratorExpressionContext *context,
   cmGeneratorExpressionDAGChecker *dagChecker,
   const std::string &interfacePropertyName)
@@ -846,7 +846,7 @@ getLinkedTargetsContent(
     // Broken code can have a target in its own link interface.
     // Don't follow such link interface entries so as not to create a
     // self-referencing loop.
-    if (it->Target && it->Target->Target != target)
+    if (it->Target && it->Target != target)
       {
       depString +=
         sep + "$<TARGET_PROPERTY:" +
@@ -858,8 +858,10 @@ getLinkedTargetsContent(
     {
     linkedTargetsContent =
         cmGeneratorExpressionNode::EvaluateDependentExpression(depString,
-                                        target->GetMakefile(), context,
-                                        headTarget, target, dagChecker);
+                                        target->Target->GetMakefile(),
+                                        context,
+                                        headTarget->Target,
+                                        target->Target, dagChecker);
     }
   linkedTargetsContent =
     cmGeneratorExpression::StripEmptyListElements(linkedTargetsContent);
@@ -1116,8 +1118,8 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
          gtgt->GetLinkInterfaceLibraries(context->Config, gHeadTarget, true))
         {
         linkedTargetsContent =
-          getLinkedTargetsContent(iface->Libraries, target,
-                                  headTarget,
+          getLinkedTargetsContent(iface->Libraries, gtgt,
+                                  gHeadTarget,
                                   context, &dagChecker,
                                   interfacePropertyName);
         }
@@ -1128,8 +1130,8 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
          gtgt->GetLinkImplementationLibraries(context->Config))
         {
         linkedTargetsContent =
-          getLinkedTargetsContent(impl->Libraries, target,
-                                  target,
+          getLinkedTargetsContent(impl->Libraries, gtgt,
+                                  gtgt,
                                   context, &dagChecker,
                                   interfacePropertyName);
         }

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ad54856827f8a11ffbf764ad9fa7ee92211a6eae
commit ad54856827f8a11ffbf764ad9fa7ee92211a6eae
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Oct 10 00:29:47 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Oct 10 12:05:41 2015 +0200

    cmGeneratorTarget: Move GetSupportDirectory from cmTarget.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index cc79bb6..8b8ef0f 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -5479,3 +5479,18 @@ bool cmGeneratorTarget::HasImportLibrary() const
           (this->GetType() == cmTarget::SHARED_LIBRARY ||
            this->Target->IsExecutableWithExports()));
 }
+
+//----------------------------------------------------------------------------
+std::string cmGeneratorTarget::GetSupportDirectory() const
+{
+  std::string dir = this->Makefile->GetCurrentBinaryDirectory();
+  dir += cmake::GetCMakeFilesDirectory();
+  dir += "/";
+  dir += this->GetName();
+#if defined(__VMS)
+  dir += "_dir";
+#else
+  dir += ".dir";
+#endif
+  return dir;
+}
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index e26b246..23ec7b1 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -399,6 +399,9 @@ public:
   /** Return whether or not the target has a DLL import library.  */
   bool HasImportLibrary() const;
 
+  /** Get a build-tree directory in which to place target support files.  */
+  std::string GetSupportDirectory() const;
+
   struct SourceFileFlags
   GetTargetSourceFileFlags(const cmSourceFile* sf) const;
 
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index eb4dfee..8f69acd 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2895,13 +2895,14 @@ void cmGlobalGenerator::WriteSummary()
       {
       continue;
       }
-    this->WriteSummary(ti->second);
-    fout << ti->second->GetSupportDirectory() << "\n";
+    cmGeneratorTarget* gt = this->GetGeneratorTarget(ti->second);
+    this->WriteSummary(gt);
+    fout << gt->GetSupportDirectory() << "\n";
     }
 }
 
 //----------------------------------------------------------------------------
-void cmGlobalGenerator::WriteSummary(cmTarget* target)
+void cmGlobalGenerator::WriteSummary(cmGeneratorTarget* target)
 {
   // Place the labels file in a per-target support directory.
   std::string dir = target->GetSupportDirectory();
@@ -2944,17 +2945,15 @@ void cmGlobalGenerator::WriteSummary(cmTarget* target)
     fout << "# Source files and their labels\n";
     std::vector<cmSourceFile*> sources;
     std::vector<std::string> configs;
-    target->GetMakefile()->GetConfigurations(configs);
+    target->Target->GetMakefile()->GetConfigurations(configs);
     if (configs.empty())
       {
       configs.push_back("");
       }
-    cmGeneratorTarget* gt =
-        this->GetGeneratorTarget(target);
     for(std::vector<std::string>::const_iterator ci = configs.begin();
         ci != configs.end(); ++ci)
       {
-      gt->GetSourceFiles(sources, *ci);
+      target->GetSourceFiles(sources, *ci);
       }
     std::vector<cmSourceFile*>::const_iterator sourcesEnd
         = cmRemoveDuplicates(sources);
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index b22c695..55e3766 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -458,7 +458,7 @@ private:
   void WriteRuleHashes(std::string const& pfile);
 
   void WriteSummary();
-  void WriteSummary(cmTarget* target);
+  void WriteSummary(cmGeneratorTarget* target);
   void FinalizeTargetCompileInfo();
 
   virtual void ForceLinkerLanguages();
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index de84f89..2d2de5f 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -361,7 +361,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
   vars.CMTarget = this->Target;
   vars.Language = linkLanguage.c_str();
   vars.Objects = buildObjs.c_str();
-  std::string objectDir = this->Target->GetSupportDirectory();
+  std::string objectDir = this->GeneratorTarget->GetSupportDirectory();
   objectDir = this->Convert(objectDir,
                             cmLocalGenerator::START_OUTPUT,
                             cmLocalGenerator::SHELL);
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 2b019be..8b60a23 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -572,7 +572,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
     if(this->Target->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
       {
       std::string name_of_def_file =
-        this->Target->GetSupportDirectory();
+        this->GeneratorTarget->GetSupportDirectory();
       name_of_def_file += std::string("/") +
         this->Target->GetName();
       name_of_def_file += ".def";
@@ -643,7 +643,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
   vars.CMTarget = this->Target;
   vars.Language = linkLanguage.c_str();
   vars.Objects = buildObjs.c_str();
-  std::string objectDir = this->Target->GetSupportDirectory();
+  std::string objectDir = this->GeneratorTarget->GetSupportDirectory();
   objectDir = this->Convert(objectDir,
                             cmLocalGenerator::START_OUTPUT,
                             cmLocalGenerator::SHELL);
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 185c234..0ce13c3 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -557,7 +557,8 @@ cmMakefileTargetGenerator
       this->GeneratorTarget->GetCompilePDBPath(this->ConfigName);
     if(targetFullPathCompilePDB.empty())
       {
-      targetFullPathCompilePDB = this->Target->GetSupportDirectory() + "/";
+      targetFullPathCompilePDB =
+          this->GeneratorTarget->GetSupportDirectory() + "/";
       }
     }
 
@@ -594,7 +595,7 @@ cmMakefileTargetGenerator
                   cmLocalGenerator::NONE,
                   cmLocalGenerator::SHELL);
   vars.Object = shellObj.c_str();
-  std::string objectDir = this->Target->GetSupportDirectory();
+  std::string objectDir = this->GeneratorTarget->GetSupportDirectory();
   objectDir = this->Convert(objectDir,
                             cmLocalGenerator::START_OUTPUT,
                             cmLocalGenerator::SHELL);
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 00c00a5..0dc53f3 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -492,9 +492,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
     {
     if(target.GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
       {
-      std::string dllname = targetOutput;
       std::string name_of_def_file
-        = target.GetSupportDirectory();
+        = gt.GetSupportDirectory();
       name_of_def_file += "/" + target.GetName();
       name_of_def_file += ".def ";
       vars["LINK_FLAGS"] += " /DEF:";
@@ -582,7 +581,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
     vars["TARGET_PDB"] = base + suffix + dbg_suffix;
     }
 
-  const std::string objPath = GetTarget()->GetSupportDirectory();
+  const std::string objPath = GetGeneratorTarget()->GetSupportDirectory();
   vars["OBJECT_DIR"] =
     this->GetLocalGenerator()->ConvertToOutputFormat(
       this->ConvertToNinjaPath(objPath), cmLocalGenerator::SHELL);
@@ -634,7 +633,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
       this->GetLocalGenerator()->ConvertToOutputFormat(
         cmSystemTools::GetCMakeCommand(), cmLocalGenerator::SHELL);
       std::string name_of_def_file
-        = target.GetSupportDirectory();
+        = gt.GetSupportDirectory();
       name_of_def_file += "/" + target.GetName();
       name_of_def_file += ".def";
       std::string cmd = cmakeCommand;
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index c2daa63..db7cd7d 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -299,7 +299,7 @@ bool cmNinjaTargetGenerator::SetMsvcTargetPdbVariable(cmNinjaVars& vars) const
               this->GeneratorTarget->GetCompilePDBPath(this->GetConfigName());
       if(compilePdbPath.empty())
         {
-        compilePdbPath = this->Target->GetSupportDirectory() + "/";
+        compilePdbPath = this->GeneratorTarget->GetSupportDirectory() + "/";
         }
       }
 
@@ -568,7 +568,7 @@ cmNinjaTargetGenerator
   std::string const language = source->GetLanguage();
   std::string const sourceFileName =
     language=="RC" ? source->GetFullPath() : this->GetSourceFilePath(source);
-  std::string const objectDir = this->Target->GetSupportDirectory();
+  std::string const objectDir = this->GeneratorTarget->GetSupportDirectory();
   std::string const objectFileName = this->GetObjectFilePath(source);
   std::string const objectFileDir =
     cmSystemTools::GetFilenamePath(objectFileName);
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index 378f132..6e3f65f 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -64,7 +64,7 @@ static void SetupSourceFiles(cmGeneratorTarget const* target,
         std::string basename = cmsys::SystemTools::
                                       GetFilenameWithoutLastExtension(absFile);
 
-        std::string rcc_output_dir = target->Target->GetSupportDirectory();
+        std::string rcc_output_dir = target->GetSupportDirectory();
         cmSystemTools::MakeDirectory(rcc_output_dir.c_str());
         std::string rcc_output_file = rcc_output_dir;
         rcc_output_file += "/qrc_" + basename + ".cpp";
@@ -833,7 +833,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
           std::string basename = cmsys::SystemTools::
                                   GetFilenameWithoutLastExtension(absFile);
 
-          std::string rcc_output_dir = target->Target->GetSupportDirectory();
+          std::string rcc_output_dir = target->GetSupportDirectory();
           cmSystemTools::MakeDirectory(rcc_output_dir.c_str());
           std::string rcc_output_file = rcc_output_dir;
           rcc_output_file += "/qrc_" + basename + ".cpp";
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index b063e84..56bf1e9 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -382,21 +382,6 @@ cmListFileBacktrace const& cmTarget::GetBacktrace() const
 }
 
 //----------------------------------------------------------------------------
-std::string cmTarget::GetSupportDirectory() const
-{
-  std::string dir = this->Makefile->GetCurrentBinaryDirectory();
-  dir += cmake::GetCMakeFilesDirectory();
-  dir += "/";
-  dir += this->Name;
-#if defined(__VMS)
-  dir += "_dir";
-#else
-  dir += ".dir";
-#endif
-  return dir;
-}
-
-//----------------------------------------------------------------------------
 bool cmTarget::IsExecutableWithExports() const
 {
   return (this->GetType() == cmTarget::EXECUTABLE &&
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index c8904e6..c159cb2 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -284,9 +284,6 @@ public:
   /** Get a backtrace from the creation of the target.  */
   cmListFileBacktrace const& GetBacktrace() const;
 
-  /** Get a build-tree directory in which to place target support files.  */
-  std::string GetSupportDirectory() const;
-
   /** @return whether this target have a well defined output file name. */
   bool HaveWellDefinedOutputFiles() const;
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=265136cc0531171803b63c5c2868f30eed4cf71e
commit 265136cc0531171803b63c5c2868f30eed4cf71e
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 9 23:45:55 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Oct 10 12:05:39 2015 +0200

    cmGeneratorTarget: Move HasImportLibrary from cmTarget.

diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index 7e47261..2d9025e 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -1658,7 +1658,7 @@ struct TargetFilesystemArtifactResultCreator<ArtifactLinkerTag>
       return std::string();
       }
     return target->GetFullPath(context->Config,
-                               target->Target->HasImportLibrary());
+                               target->HasImportLibrary());
   }
 };
 
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 5dabcbd..cc79bb6 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -5454,7 +5454,7 @@ cmGeneratorTarget::GetPDBDirectory(const std::string& config) const
 //----------------------------------------------------------------------------
 bool cmGeneratorTarget::HasImplibGNUtoMS() const
 {
-  return this->Target->HasImportLibrary()
+  return this->HasImportLibrary()
       && this->GetPropertyAsBool("GNUtoMS");
 }
 
@@ -5471,3 +5471,11 @@ bool cmGeneratorTarget::GetImplibGNUtoMS(std::string const& gnuName,
     }
   return false;
 }
+
+//----------------------------------------------------------------------------
+bool cmGeneratorTarget::HasImportLibrary() const
+{
+  return (this->Target->IsDLLPlatform() &&
+          (this->GetType() == cmTarget::SHARED_LIBRARY ||
+           this->Target->IsExecutableWithExports()));
+}
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 05cb91a..e26b246 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -396,6 +396,9 @@ public:
   bool GetImplibGNUtoMS(std::string const& gnuName, std::string& out,
                         const char* newExt = 0) const;
 
+  /** Return whether or not the target has a DLL import library.  */
+  bool HasImportLibrary() const;
+
   struct SourceFileFlags
   GetTargetSourceFileFlags(const cmSourceFile* sf) const;
 
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index f8743d9..00c00a5 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -559,7 +559,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
                                               cmLocalGenerator::SHELL);
     vars["TARGET_IMPLIB"] = impLibPath;
     EnsureParentDirectoryExists(impLibPath);
-    if(target.HasImportLibrary())
+    if(genTarget.HasImportLibrary())
       {
       byproducts.push_back(targetOutputImplib);
       }
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 5f92b5b..c8904e6 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -264,9 +264,6 @@ public:
   /** Return whether or not the target is for a DLL platform.  */
   bool IsDLLPlatform() const { return this->DLLPlatform; }
 
-  /** Return whether or not the target has a DLL import library.  */
-  bool HasImportLibrary() const;
-
   /** Return whether this target is a shared library Framework on
       Apple.  */
   bool IsFrameworkOnApple() const;
@@ -465,6 +462,9 @@ private:
 
   void MaybeInvalidatePropertyCache(const std::string& prop);
 
+  /** Return whether or not the target has a DLL import library.  */
+  bool HasImportLibrary() const;
+
   // Internal representation details.
   friend class cmTargetInternals;
   friend class cmGeneratorTarget;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9e7c41bf54e943bb370d32fd1a2065c570eb4149
commit 9e7c41bf54e943bb370d32fd1a2065c570eb4149
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 9 23:50:36 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Oct 10 12:00:51 2015 +0200

    cmGeneratorTarget: Move HasImplibGNUtoMS from cmTarget.

diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index fed0dbc..400fa17 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -217,7 +217,7 @@ cmExportBuildFileGenerator
     std::string prop = "IMPORTED_IMPLIB";
     prop += suffix;
     std::string value = target->GetFullPath(config, true);
-    target->Target->GetImplibGNUtoMS(value, value,
+    target->GetImplibGNUtoMS(value, value,
                              "${CMAKE_IMPORT_LIBRARY_SUFFIX}");
     properties[prop] = value;
     }
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 9eef514..5dabcbd 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -5450,3 +5450,24 @@ cmGeneratorTarget::GetPDBDirectory(const std::string& config) const
     }
   return "";
 }
+
+//----------------------------------------------------------------------------
+bool cmGeneratorTarget::HasImplibGNUtoMS() const
+{
+  return this->Target->HasImportLibrary()
+      && this->GetPropertyAsBool("GNUtoMS");
+}
+
+//----------------------------------------------------------------------------
+bool cmGeneratorTarget::GetImplibGNUtoMS(std::string const& gnuName,
+                                std::string& out, const char* newExt) const
+{
+  if(this->HasImplibGNUtoMS() &&
+     gnuName.size() > 6 && gnuName.substr(gnuName.size()-6) == ".dll.a")
+    {
+    out = gnuName.substr(0, gnuName.size()-6);
+    out += newExt? newExt : ".lib";
+    return true;
+    }
+  return false;
+}
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index a278b53..05cb91a 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -388,6 +388,14 @@ public:
   ///! Return the preferred linker language for this target
   std::string GetLinkerLanguage(const std::string& config = "") const;
 
+  /** Does this target have a GNU implib to convert to MS format?  */
+  bool HasImplibGNUtoMS() const;
+
+  /** Convert the given GNU import library name (.dll.a) to a name with a new
+      extension (.lib or ${CMAKE_IMPORT_LIBRARY_SUFFIX}).  */
+  bool GetImplibGNUtoMS(std::string const& gnuName, std::string& out,
+                        const char* newExt = 0) const;
+
   struct SourceFileFlags
   GetTargetSourceFileFlags(const cmSourceFile* sf) const;
 
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index 8c50b36..7a0c06b 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -135,7 +135,7 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os,
       filesFrom.push_back(from1);
       filesTo.push_back(to1);
       std::string targetNameImportLib;
-      if(this->Target->Target->GetImplibGNUtoMS(targetNameImport,
+      if(this->Target->GetImplibGNUtoMS(targetNameImport,
                                         targetNameImportLib))
         {
         filesFrom.push_back(fromDirConfig + targetNameImportLib);
@@ -199,7 +199,7 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os,
       filesFrom.push_back(from1);
       filesTo.push_back(to1);
       std::string targetNameImportLib;
-      if(this->Target->Target->GetImplibGNUtoMS(targetNameImport,
+      if(this->Target->GetImplibGNUtoMS(targetNameImport,
                                         targetNameImportLib))
         {
         filesFrom.push_back(fromDirConfig + targetNameImportLib);
@@ -387,7 +387,7 @@ cmInstallTargetGenerator::GetInstallFilename(cmTarget const* target,
     if(nameType == NameImplib)
       {
       // Use the import library name.
-      if(!target->GetImplibGNUtoMS(targetNameImport, fname,
+      if(!gtgt->GetImplibGNUtoMS(targetNameImport, fname,
                                    "${CMAKE_IMPORT_LIBRARY_SUFFIX}"))
         {
         fname = targetNameImport;
@@ -416,7 +416,7 @@ cmInstallTargetGenerator::GetInstallFilename(cmTarget const* target,
     if(nameType == NameImplib)
       {
       // Use the import library name.
-      if(!target->GetImplibGNUtoMS(targetNameImport, fname,
+      if(!gtgt->GetImplibGNUtoMS(targetNameImport, fname,
                                    "${CMAKE_IMPORT_LIBRARY_SUFFIX}"))
         {
         fname = targetNameImport;
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index f6b907e..de84f89 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -259,7 +259,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
                                           cmLocalGenerator::START_OUTPUT,
                                           cmLocalGenerator::UNCHANGED));
     std::string implib;
-    if(this->Target->GetImplibGNUtoMS(targetFullPathImport, implib))
+    if(this->GeneratorTarget->GetImplibGNUtoMS(targetFullPathImport, implib))
       {
       exeCleanFiles.push_back(this->Convert(implib,
                                             cmLocalGenerator::START_OUTPUT,
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 3b3f63e..2b019be 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -410,7 +410,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
         cmLocalGenerator::START_OUTPUT,
         cmLocalGenerator::UNCHANGED));
     std::string implib;
-    if(this->Target->GetImplibGNUtoMS(targetFullPathImport, implib))
+    if(this->GeneratorTarget->GetImplibGNUtoMS(targetFullPathImport, implib))
       {
       libCleanFiles.push_back(this->Convert(implib,
                                             cmLocalGenerator::START_OUTPUT,
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 6eafeae..185c234 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1516,7 +1516,7 @@ std::string cmMakefileTargetGenerator::GetLinkRule(
                                               const std::string& linkRuleVar)
 {
   std::string linkRule = this->Makefile->GetRequiredDefinition(linkRuleVar);
-  if(this->Target->HasImplibGNUtoMS())
+  if(this->GeneratorTarget->HasImplibGNUtoMS())
     {
     std::string ruleVar = "CMAKE_";
     ruleVar += this->GeneratorTarget->GetLinkerLanguage(this->ConfigName);
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 31a9aa7..b063e84 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2199,26 +2199,6 @@ void cmTarget::ComputeVersionedName(std::string& vName,
 }
 
 //----------------------------------------------------------------------------
-bool cmTarget::HasImplibGNUtoMS() const
-{
-  return this->HasImportLibrary() && this->GetPropertyAsBool("GNUtoMS");
-}
-
-//----------------------------------------------------------------------------
-bool cmTarget::GetImplibGNUtoMS(std::string const& gnuName,
-                                std::string& out, const char* newExt) const
-{
-  if(this->HasImplibGNUtoMS() &&
-     gnuName.size() > 6 && gnuName.substr(gnuName.size()-6) == ".dll.a")
-    {
-    out = gnuName.substr(0, gnuName.size()-6);
-    out += newExt? newExt : ".lib";
-    return true;
-    }
-  return false;
-}
-
-//----------------------------------------------------------------------------
 void cmTarget::SetPropertyDefault(const std::string& property,
                                   const char* default_value)
 {
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 0c1bbd2..5f92b5b 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -242,14 +242,6 @@ public:
   void
   GetTargetVersion(bool soversion, int& major, int& minor, int& patch) const;
 
-  /** Does this target have a GNU implib to convert to MS format?  */
-  bool HasImplibGNUtoMS() const;
-
-  /** Convert the given GNU import library name (.dll.a) to a name with a new
-      extension (.lib or ${CMAKE_IMPORT_LIBRARY_SUFFIX}).  */
-  bool GetImplibGNUtoMS(std::string const& gnuName, std::string& out,
-                        const char* newExt = 0) const;
-
   // Get the properties
   cmPropertyMap &GetProperties() const { return this->Properties; }
 

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

Summary of changes:
 Source/cmExportBuildFileGenerator.cxx          |    2 +-
 Source/cmGeneratorExpressionNode.cxx           |   22 ++++++------
 Source/cmGeneratorTarget.cxx                   |   44 ++++++++++++++++++++++++
 Source/cmGeneratorTarget.h                     |   14 ++++++++
 Source/cmGlobalGenerator.cxx                   |   13 ++++---
 Source/cmGlobalGenerator.h                     |    2 +-
 Source/cmInstallTargetGenerator.cxx            |    8 ++---
 Source/cmMakefileExecutableTargetGenerator.cxx |    4 +--
 Source/cmMakefileLibraryTargetGenerator.cxx    |    6 ++--
 Source/cmMakefileTargetGenerator.cxx           |    7 ++--
 Source/cmNinjaNormalTargetGenerator.cxx        |    9 +++--
 Source/cmNinjaTargetGenerator.cxx              |    4 +--
 Source/cmQtAutoGeneratorInitializer.cxx        |    4 +--
 Source/cmTarget.cxx                            |   35 -------------------
 Source/cmTarget.h                              |   17 ++-------
 15 files changed, 102 insertions(+), 89 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list