[Cmake-commits] CMake branch, next, updated. v3.7.0-rc1-113-gf38d2ed

Stephen Kelly steveire at gmail.com
Thu Oct 6 12:42:08 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  f38d2ed7d391c788baec7e215ee0c1b1d95982d1 (commit)
       via  c8c24d8dd52fd3e79f6019f605161024d35082b8 (commit)
       via  f59e87792943904dcb11e16380883e87395d115f (commit)
      from  6a0843d3b684ff3dd57f9e29aaf9947dcc81c253 (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=f38d2ed7d391c788baec7e215ee0c1b1d95982d1
commit f38d2ed7d391c788baec7e215ee0c1b1d95982d1
Merge: 6a0843d c8c24d8d
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Oct 6 12:42:08 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Oct 6 12:42:08 2016 -0400

    Merge topic 'codelite-global-setting' into next
    
    c8c24d8d Codelite: Consume the CMAKE_CODELITE_USE_TARGETS setting globally
    f59e8779 cmGlobalGenerator: Add API to get settings from top-level cmMakefile


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c8c24d8dd52fd3e79f6019f605161024d35082b8
commit c8c24d8dd52fd3e79f6019f605161024d35082b8
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Oct 6 18:35:02 2016 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 6 18:41:07 2016 +0200

    Codelite: Consume the CMAKE_CODELITE_USE_TARGETS setting globally

diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx
index 629c5b6..360c852 100644
--- a/Source/cmExtraCodeLiteGenerator.cxx
+++ b/Source/cmExtraCodeLiteGenerator.cxx
@@ -60,7 +60,6 @@ void cmExtraCodeLiteGenerator::Generate()
   // loop projects and locate the root project.
   // and extract the information for creating the worspace
   // root makefile
-  const cmMakefile* rmf = CM_NULLPTR;
   for (std::map<std::string, std::vector<cmLocalGenerator*> >::const_iterator
          it = projectMap.begin();
        it != projectMap.end(); ++it) {
@@ -75,7 +74,6 @@ void cmExtraCodeLiteGenerator::Generate()
       workspaceFileName = workspaceOutputDir + "/";
       workspaceFileName += workspaceProjectName + ".workspace";
       this->WorkspacePath = it->second[0]->GetCurrentBinaryDirectory();
-      rmf = it->second[0]->GetMakefile();
       ;
       break;
     }
@@ -89,7 +87,7 @@ void cmExtraCodeLiteGenerator::Generate()
   xml.Attribute("Name", workspaceProjectName);
 
   bool const targetsAreProjects =
-    rmf && rmf->IsOn("CMAKE_CODELITE_USE_TARGETS");
+    this->GlobalGenerator->GlobalSettingIsOn("CMAKE_CODELITE_USE_TARGETS");
 
   std::vector<std::string> ProjectNames;
   if (targetsAreProjects) {

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f59e87792943904dcb11e16380883e87395d115f
commit f59e87792943904dcb11e16380883e87395d115f
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Oct 6 18:01:36 2016 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 6 18:41:06 2016 +0200

    cmGlobalGenerator: Add API to get settings from top-level cmMakefile
    
    At generate-time, definitions are sometimes read from a nearby cmMakefile,
    making the value directory-specific because they are read once per
    directory.  Often however, the intention is more
    often to create a 'global' setting, such that the user writes for
    example:
    
     set(CMAKE_IMPORT_LIBRARY_SUFFIX something)
    
    once at the top level of their project.
    
    Many of these are also set by internal platform files, such as
    CMAKE_EXTRA_LINK_EXTENSIONS.
    
    The set() definitions are not really suitable for 'global' settings
    because they can be different for each directory, and code consuming the
    settings must assume they are different for each directory, and read it
    freshly each time with new allocations.
    
    CMake has other variable types which are global in scope, such as global
    properties, and cache variables.  These are less convenient to populate
    for users, so establish a convention and API using the value as it is at
    the end of the top-level CMakeLists file.

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index a446862..7132ade 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1007,6 +1007,25 @@ void cmGlobalGenerator::FillExtensionToLanguageMap(const std::string& l,
   }
 }
 
+const char* cmGlobalGenerator::GetGlobalSetting(std::string const& name) const
+{
+  assert(!this->Makefiles.empty());
+  return this->Makefiles[0]->GetDefinition(name);
+}
+
+bool cmGlobalGenerator::GlobalSettingIsOn(std::string const& name) const
+{
+  assert(!this->Makefiles.empty());
+  return this->Makefiles[0]->IsOn(name);
+}
+
+const char* cmGlobalGenerator::GetSafeGlobalSetting(
+  std::string const& name) const
+{
+  assert(!this->Makefiles.empty());
+  return this->Makefiles[0]->GetSafeDefinition(name);
+}
+
 bool cmGlobalGenerator::IgnoreFile(const char* ext) const
 {
   if (!this->GetLanguageFromExtension(ext).empty()) {
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 4120b52..add2b92 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -194,6 +194,10 @@ public:
 
   cmExportSetMap& GetExportSets() { return this->ExportSets; }
 
+  const char* GetGlobalSetting(std::string const& name) const;
+  bool GlobalSettingIsOn(std::string const& name) const;
+  const char* GetSafeGlobalSetting(std::string const& name) const;
+
   /** Add a file to the manifest of generated targets for a configuration.  */
   void AddToManifest(std::string const& f);
 

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

Summary of changes:
 Source/cmExtraCodeLiteGenerator.cxx |    4 +---
 Source/cmGlobalGenerator.cxx        |   19 +++++++++++++++++++
 Source/cmGlobalGenerator.h          |    4 ++++
 3 files changed, 24 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list