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  f30abe68b13c3bdd7f4a44f1e4173156eefc8c99 (commit)
       via  4f54dea307cded078e980241738ff6e988e035a2 (commit)
      from  5155d7b2854231156b66e2359742585ce7b38973 (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=f30abe68b13c3bdd7f4a44f1e4173156eefc8c99
commit f30abe68b13c3bdd7f4a44f1e4173156eefc8c99
Merge: 5155d7b 4f54dea
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Wed Apr 20 09:41:32 2016 -0400
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Wed Apr 20 09:41:32 2016 -0400

    Merge topic 'addcachedefinition-string' into next
    
    4f54dea3 Revert topic 'addcachedefinition-string'


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4f54dea307cded078e980241738ff6e988e035a2
commit 4f54dea307cded078e980241738ff6e988e035a2
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Wed Apr 20 09:41:12 2016 -0400
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Wed Apr 20 09:41:12 2016 -0400

    Revert topic 'addcachedefinition-string'
    
    An altnerative approach will be used instead.

diff --git a/Source/cmBuildCommand.cxx b/Source/cmBuildCommand.cxx
index f1b326d..64d4fca 100644
--- a/Source/cmBuildCommand.cxx
+++ b/Source/cmBuildCommand.cxx
@@ -143,7 +143,7 @@ bool cmBuildCommand
     return true;
     }
   this->Makefile->AddCacheDefinition(define,
-                                 makecommand,
+                                 makecommand.c_str(),
                                  "Command used to build entire project "
                                  "from the command line.",
                                  cmState::STRING);
diff --git a/Source/cmBuildNameCommand.cxx b/Source/cmBuildNameCommand.cxx
index 86b8ef2..2733d76 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,
+                                     cv.c_str(),
                                      "Name of build.",
                                      cmState::STRING);
       }
@@ -72,7 +72,7 @@ bool cmBuildNameCommand
                                ")", "_");
 
   this->Makefile->AddCacheDefinition(args[0],
-                                 buildname,
+                                 buildname.c_str(),
                                  "Name of build.",
                                  cmState::STRING);
   return true;
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx 
b/Source/cmExtraEclipseCDT4Generator.cxx
index ec5f296..9e67301 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,
+    mf->AddCacheDefinition(cacheEntryName, valueToUse.c_str(),
                            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,
+      mf->AddCacheDefinition(cacheEntryName, valueToUse.c_str(),
                              cacheEntryName.c_str(), cmState::STRING,
                              true);
       mf->GetCMakeInstance()->SaveCache(lg->GetBinaryDirectory());
diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx
index 9e74efc..e7696af 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,
+                                       library.c_str(),
                                        this->VariableDocumentation.c_str(),
                                        cmState::FILEPATH);
     return true;
     }
   std::string notfound = this->VariableName + "-NOTFOUND";
   this->Makefile->AddCacheDefinition(this->VariableName,
-                                     notfound,
+                                     notfound.c_str(),
                                      this->VariableDocumentation.c_str(),
                                      cmState::FILEPATH);
   return true;
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index b08bc72..64176e7 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, help.c_str(),
+                                     init.c_str(), help.c_str(),
                                      cmState::PATH, true);
   return found;
 }
diff --git a/Source/cmFindPathCommand.cxx b/Source/cmFindPathCommand.cxx
index 392b806..1f3d1a4 100644
--- a/Source/cmFindPathCommand.cxx
+++ b/Source/cmFindPathCommand.cxx
@@ -50,7 +50,7 @@ bool cmFindPathCommand
   if(!result.empty())
     {
     this->Makefile->AddCacheDefinition
-      (this->VariableName, result,
+      (this->VariableName, result.c_str(),
        this->VariableDocumentation.c_str(),
        (this->IncludeFileInPath) ?
        cmState::FILEPATH :cmState::PATH);
@@ -58,7 +58,7 @@ bool cmFindPathCommand
     }
   this->Makefile->AddCacheDefinition
     (this->VariableName,
-     this->VariableName + "-NOTFOUND",
+     (this->VariableName + "-NOTFOUND").c_str(),
      this->VariableDocumentation.c_str(),
      (this->IncludeFileInPath) ?
      cmState::FILEPATH :cmState::PATH);
diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx
index 59e5243..219ad48 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,
+                                       result.c_str(),
                                        this->VariableDocumentation.c_str(),
                                        cmState::FILEPATH);
 
     return true;
     }
   this->Makefile->AddCacheDefinition(this->VariableName,
-                                 this->VariableName + "-NOTFOUND",
+                                 (this->VariableName + "-NOTFOUND").c_str(),
                                  this->VariableDocumentation.c_str(),
                                  cmState::FILEPATH);
   return true;
diff --git a/Source/cmGetFilenameComponentCommand.cxx 
b/Source/cmGetFilenameComponentCommand.cxx
index 018455a..0f56c8e 100644
--- a/Source/cmGetFilenameComponentCommand.cxx
+++ b/Source/cmGetFilenameComponentCommand.cxx
@@ -128,12 +128,14 @@ bool cmGetFilenameComponentCommand
     if(!programArgs.empty() && !storeArgs.empty())
       {
       this->Makefile->AddCacheDefinition
-        (storeArgs, programArgs, "",
-         args[2] == "PATH" ? cmState::FILEPATH : cmState::STRING);
+        (storeArgs, programArgs.c_str(),
+         "", args[2] == "PATH" ? cmState::FILEPATH
+         : cmState::STRING);
       }
     this->Makefile->AddCacheDefinition
-      (args[0], result, "",
-       args[2] == "PATH" ? cmState::FILEPATH : cmState::STRING);
+      (args[0], result.c_str(), "",
+       args[2] == "PATH" ? cmState::FILEPATH
+       : cmState::STRING);
     }
   else
     {
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 25c1684..1d0ade4 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,
+    mf->AddCacheDefinition("CMAKE_MAKE_PROGRAM", makeProgram.c_str(),
                            "make program",
                            cmState::FILEPATH);
     }
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 2f3b0b2..3a56c2a 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1818,13 +1818,14 @@ void cmMakefile::AddDefinition(const std::string& name, 
const char* value)
 #endif
 }
 
-void cmMakefile::AddCacheDefinitionHelper(const std::string& name,
-                                    const std::string &value,
+
+void cmMakefile::AddCacheDefinition(const std::string& name, const char* value,
                                     const char* doc,
                                     cmState::CacheEntryType type,
-                                    bool force, bool haveVal)
+                                    bool force)
 {
-  std::string val = value;
+  bool haveVal = value ? true : false;
+  std::string val = haveVal ? value : "";
   const char* existingValue =
     this->GetState()->GetInitializedCacheValue(name);
   if(existingValue
@@ -1869,24 +1870,6 @@ void cmMakefile::AddCacheDefinitionHelper(const 
std::string& name,
   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 e335b8a..089a83d 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -254,11 +254,6 @@ 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.
@@ -956,12 +951,6 @@ 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;
diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx
index 03a3542..7123125 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],
+       args[0].c_str(),
        "Value Computed by CMake", cmState::STATIC);
     }
 
diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx
index 2e19a7f..1d70ad6 100644
--- a/Source/cmSetCommand.cxx
+++ b/Source/cmSetCommand.cxx
@@ -155,7 +155,7 @@ bool cmSetCommand
   if(cache)
     {
     this->Makefile->AddCacheDefinition(variable,
-                                   value,
+                                   value.c_str(),
                                    docstring,
                                    type, force);
     }
diff --git a/Source/cmSiteNameCommand.cxx b/Source/cmSiteNameCommand.cxx
index 0e38d7f..e2970e5 100644
--- a/Source/cmSiteNameCommand.cxx
+++ b/Source/cmSiteNameCommand.cxx
@@ -86,7 +86,7 @@ bool cmSiteNameCommand
 #endif
   this->Makefile->
     AddCacheDefinition(args[0],
-                       siteName,
+                       siteName.c_str(),
                        "Name of the computer/site where compile is being run",
                        cmState::STRING);
 
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index eca5c25..e118356 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,
+    mf.AddCacheDefinition( targetEntry, dependencies.c_str(),
                            "Dependencies for the target",
                            cmState::STATIC );
     }
diff --git a/Source/cmUtilitySourceCommand.cxx 
b/Source/cmUtilitySourceCommand.cxx
index 0226306..3f1e333 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,
+                                 utilityExecutable.c_str(),
                                  "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,
+                                 utilityName.c_str(),
                                  "Executable to project name.",
                                  cmState::INTERNAL);
 

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

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, 30 insertions(+), 56 deletions(-)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits

Reply via email to