[Cmake-commits] CMake branch, next, updated. v3.5.2-1016-gc6ab628

Rolf Eike Beer eike at sf-mail.de
Tue Apr 19 17:08:26 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  c6ab628a0bbcd23229537a00fddbbc7bd9c617e9 (commit)
       via  06a0fa869dd7acdba36695b708fd9afb84ce9bc2 (commit)
       via  d92e01128fd94fea7c3a978ffc1d63d9921c4253 (commit)
      from  7915a626cf12b63db199f34834f743b8724de8ad (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=c6ab628a0bbcd23229537a00fddbbc7bd9c617e9
commit c6ab628a0bbcd23229537a00fddbbc7bd9c617e9
Merge: 7915a62 06a0fa8
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Tue Apr 19 17:08:24 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Apr 19 17:08:24 2016 -0400

    Merge topic 'addcachedefinition-string' into next
    
    06a0fa86 port to new version of cmMakefile::AddCacheDefinition() where possible
    d92e0112 add an overload of cmMakefile::AddCacheDefinition() that takes a std::string


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=06a0fa869dd7acdba36695b708fd9afb84ce9bc2
commit 06a0fa869dd7acdba36695b708fd9afb84ce9bc2
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Tue Apr 19 21:59:23 2016 +0200
Commit:     Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Tue Apr 19 22:54:22 2016 +0200

    port to new version of cmMakefile::AddCacheDefinition() where possible

diff --git a/Source/cmBuildCommand.cxx b/Source/cmBuildCommand.cxx
index 64d4fca..f1b326d 100644
--- a/Source/cmBuildCommand.cxx
+++ b/Source/cmBuildCommand.cxx
@@ -143,7 +143,7 @@ bool cmBuildCommand
     return true;
     }
   this->Makefile->AddCacheDefinition(define,
-                                 makecommand.c_str(),
+                                 makecommand,
                                  "Command used to build entire project "
                                  "from the command line.",
                                  cmState::STRING);
diff --git a/Source/cmBuildNameCommand.cxx b/Source/cmBuildNameCommand.cxx
index 2733d76..86b8ef2 100644
--- a/Source/cmBuildNameCommand.cxx
+++ b/Source/cmBuildNameCommand.cxx
@@ -37,7 +37,7 @@ bool cmBuildNameCommand
       cmSystemTools::ReplaceString(cv,"(", "_");
       cmSystemTools::ReplaceString(cv,")", "_");
       this->Makefile->AddCacheDefinition(args[0],
-                                     cv.c_str(),
+                                     cv,
                                      "Name of build.",
                                      cmState::STRING);
       }
@@ -72,7 +72,7 @@ bool cmBuildNameCommand
                                ")", "_");
 
   this->Makefile->AddCacheDefinition(args[0],
-                                 buildname.c_str(),
+                                 buildname,
                                  "Name of build.",
                                  cmState::STRING);
   return true;
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 9e67301..ec5f296 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -241,7 +241,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(std::ostream& out,
     // The variable is in the env, but not in the cache. Use it and put it
     // in the cache
     valueToUse = envVarValue;
-    mf->AddCacheDefinition(cacheEntryName, valueToUse.c_str(),
+    mf->AddCacheDefinition(cacheEntryName, valueToUse,
                            cacheEntryName.c_str(), cmState::STRING,
                            true);
     mf->GetCMakeInstance()->SaveCache(lg->GetBinaryDirectory());
@@ -262,7 +262,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(std::ostream& out,
     if (valueToUse.find(envVarValue) == std::string::npos)
       {
       valueToUse = envVarValue;
-      mf->AddCacheDefinition(cacheEntryName, valueToUse.c_str(),
+      mf->AddCacheDefinition(cacheEntryName, valueToUse,
                              cacheEntryName.c_str(), cmState::STRING,
                              true);
       mf->GetCMakeInstance()->SaveCache(lg->GetBinaryDirectory());
diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx
index e7696af..9e74efc 100644
--- a/Source/cmFindLibraryCommand.cxx
+++ b/Source/cmFindLibraryCommand.cxx
@@ -68,14 +68,14 @@ bool cmFindLibraryCommand
     {
     // Save the value in the cache
     this->Makefile->AddCacheDefinition(this->VariableName,
-                                       library.c_str(),
+                                       library,
                                        this->VariableDocumentation.c_str(),
                                        cmState::FILEPATH);
     return true;
     }
   std::string notfound = this->VariableName + "-NOTFOUND";
   this->Makefile->AddCacheDefinition(this->VariableName,
-                                     notfound.c_str(),
+                                     notfound,
                                      this->VariableDocumentation.c_str(),
                                      cmState::FILEPATH);
   return true;
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 64176e7..b08bc72 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -945,7 +945,7 @@ bool cmFindPackageCommand::FindConfig()
   help += ".";
   // We force the value since we do not get here if it was already set.
   this->Makefile->AddCacheDefinition(this->Variable,
-                                     init.c_str(), help.c_str(),
+                                     init, help.c_str(),
                                      cmState::PATH, true);
   return found;
 }
diff --git a/Source/cmFindPathCommand.cxx b/Source/cmFindPathCommand.cxx
index 1f3d1a4..392b806 100644
--- a/Source/cmFindPathCommand.cxx
+++ b/Source/cmFindPathCommand.cxx
@@ -50,7 +50,7 @@ bool cmFindPathCommand
   if(!result.empty())
     {
     this->Makefile->AddCacheDefinition
-      (this->VariableName, result.c_str(),
+      (this->VariableName, result,
        this->VariableDocumentation.c_str(),
        (this->IncludeFileInPath) ?
        cmState::FILEPATH :cmState::PATH);
@@ -58,7 +58,7 @@ bool cmFindPathCommand
     }
   this->Makefile->AddCacheDefinition
     (this->VariableName,
-     (this->VariableName + "-NOTFOUND").c_str(),
+     this->VariableName + "-NOTFOUND",
      this->VariableDocumentation.c_str(),
      (this->IncludeFileInPath) ?
      cmState::FILEPATH :cmState::PATH);
diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx
index 219ad48..59e5243 100644
--- a/Source/cmFindProgramCommand.cxx
+++ b/Source/cmFindProgramCommand.cxx
@@ -120,14 +120,14 @@ bool cmFindProgramCommand
     {
     // Save the value in the cache
     this->Makefile->AddCacheDefinition(this->VariableName,
-                                       result.c_str(),
+                                       result,
                                        this->VariableDocumentation.c_str(),
                                        cmState::FILEPATH);
 
     return true;
     }
   this->Makefile->AddCacheDefinition(this->VariableName,
-                                 (this->VariableName + "-NOTFOUND").c_str(),
+                                 this->VariableName + "-NOTFOUND",
                                  this->VariableDocumentation.c_str(),
                                  cmState::FILEPATH);
   return true;
diff --git a/Source/cmGetFilenameComponentCommand.cxx b/Source/cmGetFilenameComponentCommand.cxx
index 0f56c8e..018455a 100644
--- a/Source/cmGetFilenameComponentCommand.cxx
+++ b/Source/cmGetFilenameComponentCommand.cxx
@@ -128,14 +128,12 @@ bool cmGetFilenameComponentCommand
     if(!programArgs.empty() && !storeArgs.empty())
       {
       this->Makefile->AddCacheDefinition
-        (storeArgs, programArgs.c_str(),
-         "", args[2] == "PATH" ? cmState::FILEPATH
-         : cmState::STRING);
+        (storeArgs, programArgs, "",
+         args[2] == "PATH" ? cmState::FILEPATH : cmState::STRING);
       }
     this->Makefile->AddCacheDefinition
-      (args[0], result.c_str(), "",
-       args[2] == "PATH" ? cmState::FILEPATH
-       : cmState::STRING);
+      (args[0], result, "",
+       args[2] == "PATH" ? cmState::FILEPATH : cmState::STRING);
     }
   else
     {
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 1d0ade4..25c1684 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -336,7 +336,7 @@ void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf)
     makeProgram = dir;
     makeProgram += "/";
     makeProgram += saveFile;
-    mf->AddCacheDefinition("CMAKE_MAKE_PROGRAM", makeProgram.c_str(),
+    mf->AddCacheDefinition("CMAKE_MAKE_PROGRAM", makeProgram,
                            "make program",
                            cmState::FILEPATH);
     }
diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx
index 7123125..03a3542 100644
--- a/Source/cmProjectCommand.cxx
+++ b/Source/cmProjectCommand.cxx
@@ -58,7 +58,7 @@ bool cmProjectCommand
     this->Makefile->AddDefinition("CMAKE_PROJECT_NAME", args[0].c_str());
     this->Makefile->AddCacheDefinition
       ("CMAKE_PROJECT_NAME",
-       args[0].c_str(),
+       args[0],
        "Value Computed by CMake", cmState::STATIC);
     }
 
diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx
index 1d70ad6..2e19a7f 100644
--- a/Source/cmSetCommand.cxx
+++ b/Source/cmSetCommand.cxx
@@ -155,7 +155,7 @@ bool cmSetCommand
   if(cache)
     {
     this->Makefile->AddCacheDefinition(variable,
-                                   value.c_str(),
+                                   value,
                                    docstring,
                                    type, force);
     }
diff --git a/Source/cmSiteNameCommand.cxx b/Source/cmSiteNameCommand.cxx
index e2970e5..0e38d7f 100644
--- a/Source/cmSiteNameCommand.cxx
+++ b/Source/cmSiteNameCommand.cxx
@@ -86,7 +86,7 @@ bool cmSiteNameCommand
 #endif
   this->Makefile->
     AddCacheDefinition(args[0],
-                       siteName.c_str(),
+                       siteName,
                        "Name of the computer/site where compile is being run",
                        cmState::STRING);
 
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index e118356..eca5c25 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -733,7 +733,7 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf,
     dependencies += ";";
     dependencies += lib;
     dependencies += ";";
-    mf.AddCacheDefinition( targetEntry, dependencies.c_str(),
+    mf.AddCacheDefinition( targetEntry, dependencies,
                            "Dependencies for the target",
                            cmState::STATIC );
     }
diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx
index 3f1e333..0226306 100644
--- a/Source/cmUtilitySourceCommand.cxx
+++ b/Source/cmUtilitySourceCommand.cxx
@@ -116,14 +116,14 @@ bool cmUtilitySourceCommand
 
   // Enter the value into the cache.
   this->Makefile->AddCacheDefinition(cacheEntry,
-                                 utilityExecutable.c_str(),
+                                 utilityExecutable,
                                  "Path to an internal program.",
                                  cmState::FILEPATH);
   // add a value into the cache that maps from the
   // full path to the name of the project
   cmSystemTools::ConvertToUnixSlashes(utilityExecutable);
   this->Makefile->AddCacheDefinition(utilityExecutable,
-                                 utilityName.c_str(),
+                                 utilityName,
                                  "Executable to project name.",
                                  cmState::INTERNAL);
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d92e01128fd94fea7c3a978ffc1d63d9921c4253
commit d92e01128fd94fea7c3a978ffc1d63d9921c4253
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Tue Apr 19 21:49:49 2016 +0200
Commit:     Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Tue Apr 19 22:54:16 2016 +0200

    add an overload of cmMakefile::AddCacheDefinition() that takes a std::string

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 3a56c2a..2f3b0b2 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1818,14 +1818,13 @@ void cmMakefile::AddDefinition(const std::string& name, const char* value)
 #endif
 }
 
-
-void cmMakefile::AddCacheDefinition(const std::string& name, const char* value,
+void cmMakefile::AddCacheDefinitionHelper(const std::string& name,
+                                    const std::string &value,
                                     const char* doc,
                                     cmState::CacheEntryType type,
-                                    bool force)
+                                    bool force, bool haveVal)
 {
-  bool haveVal = value ? true : false;
-  std::string val = haveVal ? value : "";
+  std::string val = value;
   const char* existingValue =
     this->GetState()->GetInitializedCacheValue(name);
   if(existingValue
@@ -1870,6 +1869,24 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value,
   this->StateSnapshot.RemoveDefinition(name);
 }
 
+void cmMakefile::AddCacheDefinition(const std::string& name, const char* value,
+                                    const char* doc,
+                                    cmState::CacheEntryType type,
+                                    bool force)
+{
+  bool haveVal = value ? true : false;
+  std::string val = haveVal ? value : "";
+  AddCacheDefinitionHelper(name, val, doc, type, force, haveVal);
+}
+
+void cmMakefile::AddCacheDefinition(const std::string& name,
+                                    const std::string& value,
+                                    const char* doc,
+                                    cmState::CacheEntryType type,
+                                    bool force)
+{
+  AddCacheDefinitionHelper(name, value, doc, type, force, true);
+}
 
 void cmMakefile::AddDefinition(const std::string& name, bool value)
 {
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 089a83d..e335b8a 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -254,6 +254,11 @@ public:
                           const char* doc,
                           cmState::CacheEntryType type,
                           bool force = false);
+  ///! Add a definition to this makefile and the global cmake cache.
+  void AddCacheDefinition(const std::string& name, const std::string& value,
+                          const char* doc,
+                          cmState::CacheEntryType type,
+                          bool force = false);
 
   /**
    * Add bool variable definition to the build.
@@ -951,6 +956,12 @@ private:
 
   void CheckForUnusedVariables() const;
 
+  void AddCacheDefinitionHelper(const std::string& name,
+                                    const std::string &value,
+                                    const char* doc,
+                                    cmState::CacheEntryType type,
+                                    bool force, bool haveVal);
+
   // Unused variable flags
   bool WarnUnused;
   bool CheckSystemVars;

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

Summary of changes:
 Source/cmBuildCommand.cxx                |    2 +-
 Source/cmBuildNameCommand.cxx            |    4 ++--
 Source/cmExtraEclipseCDT4Generator.cxx   |    4 ++--
 Source/cmFindLibraryCommand.cxx          |    4 ++--
 Source/cmFindPackageCommand.cxx          |    2 +-
 Source/cmFindPathCommand.cxx             |    4 ++--
 Source/cmFindProgramCommand.cxx          |    4 ++--
 Source/cmGetFilenameComponentCommand.cxx |   10 ++++------
 Source/cmGlobalGenerator.cxx             |    2 +-
 Source/cmMakefile.cxx                    |   27 ++++++++++++++++++++++-----
 Source/cmMakefile.h                      |   11 +++++++++++
 Source/cmProjectCommand.cxx              |    2 +-
 Source/cmSetCommand.cxx                  |    2 +-
 Source/cmSiteNameCommand.cxx             |    2 +-
 Source/cmTarget.cxx                      |    2 +-
 Source/cmUtilitySourceCommand.cxx        |    4 ++--
 16 files changed, 56 insertions(+), 30 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list