[Cmake-commits] CMake branch, next, updated. v3.6.0-rc1-182-g937e6f4

Brad King brad.king at kitware.com
Thu Jun 9 11:06:12 EDT 2016


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  937e6f484223ebe17fb729a01b5494c3ed1f6cd2 (commit)
       via  d9613b962e2ed5c908850c8a083630f753dac113 (commit)
       via  70d3bf85808d17dba8ec90e2975f2741383ef260 (commit)
       via  de4ee088e7ab60213b551ecf98bc9e1b512ee393 (commit)
      from  cc1cbdb4f8647f55712abc2a1f74c43c9fe8f083 (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=937e6f484223ebe17fb729a01b5494c3ed1f6cd2
commit 937e6f484223ebe17fb729a01b5494c3ed1f6cd2
Merge: cc1cbdb d9613b9
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Jun 9 11:06:11 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Jun 9 11:06:11 2016 -0400

    Merge topic 'refactor-cmLocalGenerator-flags' into next
    
    d9613b96 cmLocalGenerator: Move GetFrameworkFlags implementation to private helper
    70d3bf85 cmLocalGenerator: Adopt GetFrameworkFlags method
    de4ee088 cmCommonTargetGenerator: De-duplicate CMAKE_BUILD_TYPE lookup


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d9613b962e2ed5c908850c8a083630f753dac113
commit d9613b962e2ed5c908850c8a083630f753dac113
Author:     Tobias Hunger <tobias.hunger at qt.io>
AuthorDate: Wed Jun 8 11:29:35 2016 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Jun 9 10:41:42 2016 -0400

    cmLocalGenerator: Move GetFrameworkFlags implementation to private helper

diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 9c503c2..f543ec4 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1271,16 +1271,19 @@ void cmLocalGenerator::GetTargetFlags(
   }
 }
 
-std::string cmLocalGenerator::GetFrameworkFlags(std::string const& l,
-                                                std::string const& config,
-                                                cmGeneratorTarget* target)
+static std::string GetFrameworkFlags(const std::string& lang,
+                                     const std::string& config,
+                                     cmGeneratorTarget* target)
 {
-  if (!this->Makefile->IsOn("APPLE")) {
+  cmLocalGenerator* lg = target->GetLocalGenerator();
+  cmMakefile* mf = lg->GetMakefile();
+
+  if (!mf->IsOn("APPLE")) {
     return std::string();
   }
 
-  std::string fwSearchFlagVar = "CMAKE_" + l + "_FRAMEWORK_SEARCH_FLAG";
-  const char* fwSearchFlag = this->Makefile->GetDefinition(fwSearchFlagVar);
+  std::string fwSearchFlagVar = "CMAKE_" + lang + "_FRAMEWORK_SEARCH_FLAG";
+  const char* fwSearchFlag = mf->GetDefinition(fwSearchFlagVar);
   if (!(fwSearchFlag && *fwSearchFlag)) {
     return std::string();
   }
@@ -1291,12 +1294,12 @@ std::string cmLocalGenerator::GetFrameworkFlags(std::string const& l,
 #endif
   std::vector<std::string> includes;
 
-  this->GetIncludeDirectories(includes, target, "C", config);
+  lg->GetIncludeDirectories(includes, target, "C", config);
   // check all include directories for frameworks as this
   // will already have added a -F for the framework
   for (std::vector<std::string>::iterator i = includes.begin();
        i != includes.end(); ++i) {
-    if (this->GlobalGenerator->NameResolvesToFramework(*i)) {
+    if (lg->GetGlobalGenerator()->NameResolvesToFramework(*i)) {
       std::string frameworkDir = *i;
       frameworkDir += "/../";
       frameworkDir = cmSystemTools::CollapseFullPath(frameworkDir);
@@ -1311,7 +1314,7 @@ std::string cmLocalGenerator::GetFrameworkFlags(std::string const& l,
          i != frameworks.end(); ++i) {
       if (emitted.insert(*i).second) {
         flags += fwSearchFlag;
-        flags += this->ConvertToOutputFormat(*i, cmOutputConverter::SHELL);
+        flags += lg->ConvertToOutputFormat(*i, cmOutputConverter::SHELL);
         flags += " ";
       }
     }
@@ -1319,6 +1322,13 @@ std::string cmLocalGenerator::GetFrameworkFlags(std::string const& l,
   return flags;
 }
 
+std::string cmLocalGenerator::GetFrameworkFlags(std::string const& l,
+                                                std::string const& config,
+                                                cmGeneratorTarget* target)
+{
+  return ::GetFrameworkFlags(l, config, target);
+}
+
 std::string cmLocalGenerator::ConvertToLinkReference(std::string const& lib,
                                                      OutputFormat format)
 {

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=70d3bf85808d17dba8ec90e2975f2741383ef260
commit 70d3bf85808d17dba8ec90e2975f2741383ef260
Author:     Tobias Hunger <tobias.hunger at qt.io>
AuthorDate: Wed Jun 8 11:29:35 2016 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Jun 9 10:39:57 2016 -0400

    cmLocalGenerator: Adopt GetFrameworkFlags method
    
    Move it from cmCommonTargetGenerator.

diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index cb62bde..131b490 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -199,56 +199,6 @@ void cmCommonTargetGenerator::AppendFortranFormatFlags(
   }
 }
 
-std::string cmCommonTargetGenerator::GetFrameworkFlags(std::string const& l)
-{
-  std::string const& config = this->ConfigName;
-  if (!this->Makefile->IsOn("APPLE")) {
-    return std::string();
-  }
-
-  std::string fwSearchFlagVar = "CMAKE_" + l + "_FRAMEWORK_SEARCH_FLAG";
-  const char* fwSearchFlag = this->Makefile->GetDefinition(fwSearchFlagVar);
-  if (!(fwSearchFlag && *fwSearchFlag)) {
-    return std::string();
-  }
-
-  std::set<std::string> emitted;
-#ifdef __APPLE__ /* don't insert this when crosscompiling e.g. to iphone */
-  emitted.insert("/System/Library/Frameworks");
-#endif
-  std::vector<std::string> includes;
-
-  this->LocalGenerator->GetIncludeDirectories(includes, this->GeneratorTarget,
-                                              "C", config);
-  // check all include directories for frameworks as this
-  // will already have added a -F for the framework
-  for (std::vector<std::string>::iterator i = includes.begin();
-       i != includes.end(); ++i) {
-    if (this->GlobalGenerator->NameResolvesToFramework(*i)) {
-      std::string frameworkDir = *i;
-      frameworkDir += "/../";
-      frameworkDir = cmSystemTools::CollapseFullPath(frameworkDir);
-      emitted.insert(frameworkDir);
-    }
-  }
-
-  std::string flags;
-  if (cmComputeLinkInformation* cli =
-        this->GeneratorTarget->GetLinkInformation(config)) {
-    std::vector<std::string> const& frameworks = cli->GetFrameworkPaths();
-    for (std::vector<std::string>::const_iterator i = frameworks.begin();
-         i != frameworks.end(); ++i) {
-      if (emitted.insert(*i).second) {
-        flags += fwSearchFlag;
-        flags += this->LocalGenerator->ConvertToOutputFormat(
-          *i, cmOutputConverter::SHELL);
-        flags += " ";
-      }
-    }
-  }
-  return flags;
-}
-
 std::string cmCommonTargetGenerator::GetFlags(const std::string& l)
 {
   ByLanguageMap::iterator i = this->FlagsByLanguage.find(l);
@@ -277,7 +227,9 @@ std::string cmCommonTargetGenerator::GetFlags(const std::string& l)
     this->LocalGenerator->AppendFlags(flags, this->Makefile->GetDefineFlags());
 
     // Add framework directory flags.
-    this->LocalGenerator->AppendFlags(flags, this->GetFrameworkFlags(l));
+    this->LocalGenerator->AppendFlags(
+      flags, this->LocalGenerator->GetFrameworkFlags(l, this->ConfigName,
+                                                     this->GeneratorTarget));
 
     // Add target-specific flags.
     this->LocalGenerator->AddCompileOptions(flags, this->GeneratorTarget, lang,
diff --git a/Source/cmCommonTargetGenerator.h b/Source/cmCommonTargetGenerator.h
index c9645e7..ace5351 100644
--- a/Source/cmCommonTargetGenerator.h
+++ b/Source/cmCommonTargetGenerator.h
@@ -71,9 +71,6 @@ protected:
   void AppendFortranFormatFlags(std::string& flags,
                                 cmSourceFile const& source);
 
-  // Return the a string with -F flags on apple
-  std::string GetFrameworkFlags(std::string const& l);
-
   virtual void AddIncludeFlags(std::string& flags,
                                std::string const& lang) = 0;
 
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index b369420..9c503c2 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1271,6 +1271,54 @@ void cmLocalGenerator::GetTargetFlags(
   }
 }
 
+std::string cmLocalGenerator::GetFrameworkFlags(std::string const& l,
+                                                std::string const& config,
+                                                cmGeneratorTarget* target)
+{
+  if (!this->Makefile->IsOn("APPLE")) {
+    return std::string();
+  }
+
+  std::string fwSearchFlagVar = "CMAKE_" + l + "_FRAMEWORK_SEARCH_FLAG";
+  const char* fwSearchFlag = this->Makefile->GetDefinition(fwSearchFlagVar);
+  if (!(fwSearchFlag && *fwSearchFlag)) {
+    return std::string();
+  }
+
+  std::set<std::string> emitted;
+#ifdef __APPLE__ /* don't insert this when crosscompiling e.g. to iphone */
+  emitted.insert("/System/Library/Frameworks");
+#endif
+  std::vector<std::string> includes;
+
+  this->GetIncludeDirectories(includes, target, "C", config);
+  // check all include directories for frameworks as this
+  // will already have added a -F for the framework
+  for (std::vector<std::string>::iterator i = includes.begin();
+       i != includes.end(); ++i) {
+    if (this->GlobalGenerator->NameResolvesToFramework(*i)) {
+      std::string frameworkDir = *i;
+      frameworkDir += "/../";
+      frameworkDir = cmSystemTools::CollapseFullPath(frameworkDir);
+      emitted.insert(frameworkDir);
+    }
+  }
+
+  std::string flags;
+  if (cmComputeLinkInformation* cli = target->GetLinkInformation(config)) {
+    std::vector<std::string> const& frameworks = cli->GetFrameworkPaths();
+    for (std::vector<std::string>::const_iterator i = frameworks.begin();
+         i != frameworks.end(); ++i) {
+      if (emitted.insert(*i).second) {
+        flags += fwSearchFlag;
+        flags += this->ConvertToOutputFormat(*i, cmOutputConverter::SHELL);
+        flags += " ";
+      }
+    }
+  }
+  return flags;
+}
+
 std::string cmLocalGenerator::ConvertToLinkReference(std::string const& lib,
                                                      OutputFormat format)
 {
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 5ced648..ac2ebce 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -313,6 +313,10 @@ public:
                       std::string& frameworkPath, std::string& linkPath,
                       cmGeneratorTarget* target, bool useWatcomQuote);
 
+  std::string GetFrameworkFlags(std::string const& l,
+                                std::string const& config,
+                                cmGeneratorTarget* target);
+
   virtual void ComputeObjectFilenames(
     std::map<cmSourceFile const*, std::string>& mapping,
     cmGeneratorTarget const* gt = 0);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=de4ee088e7ab60213b551ecf98bc9e1b512ee393
commit de4ee088e7ab60213b551ecf98bc9e1b512ee393
Author:     Tobias Hunger <tobias.hunger at qt.io>
AuthorDate: Wed Jun 8 11:29:35 2016 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Jun 8 16:41:41 2016 -0400

    cmCommonTargetGenerator: De-duplicate CMAKE_BUILD_TYPE lookup

diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index a6f2a2e..cb62bde 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -159,8 +159,7 @@ void cmCommonTargetGenerator::AddFortranFlags(std::string& flags)
   if (const char* modpath_flag =
         this->Makefile->GetDefinition("CMAKE_Fortran_MODPATH_FLAG")) {
     std::vector<std::string> includes;
-    const std::string& config =
-      this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
+    const std::string& config = this->ConfigName;
     this->LocalGenerator->GetIncludeDirectories(
       includes, this->GeneratorTarget, "C", config);
     for (std::vector<std::string>::const_iterator idi = includes.begin();
@@ -202,6 +201,7 @@ void cmCommonTargetGenerator::AppendFortranFormatFlags(
 
 std::string cmCommonTargetGenerator::GetFrameworkFlags(std::string const& l)
 {
+  std::string const& config = this->ConfigName;
   if (!this->Makefile->IsOn("APPLE")) {
     return std::string();
   }
@@ -218,8 +218,6 @@ std::string cmCommonTargetGenerator::GetFrameworkFlags(std::string const& l)
 #endif
   std::vector<std::string> includes;
 
-  const std::string& config =
-    this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
   this->LocalGenerator->GetIncludeDirectories(includes, this->GeneratorTarget,
                                               "C", config);
   // check all include directories for frameworks as this
@@ -235,9 +233,8 @@ std::string cmCommonTargetGenerator::GetFrameworkFlags(std::string const& l)
   }
 
   std::string flags;
-  const char* cfg = this->LocalGenerator->GetConfigName().c_str();
   if (cmComputeLinkInformation* cli =
-        this->GeneratorTarget->GetLinkInformation(cfg)) {
+        this->GeneratorTarget->GetLinkInformation(config)) {
     std::vector<std::string> const& frameworks = cli->GetFrameworkPaths();
     for (std::vector<std::string>::const_iterator i = frameworks.begin();
          i != frameworks.end(); ++i) {

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

Summary of changes:
 Source/cmCommonTargetGenerator.cxx |   59 +++---------------------------------
 Source/cmCommonTargetGenerator.h   |    3 --
 Source/cmLocalGenerator.cxx        |   58 +++++++++++++++++++++++++++++++++++
 Source/cmLocalGenerator.h          |    4 +++
 4 files changed, 66 insertions(+), 58 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list