[Cmake-commits] CMake branch, next, updated. v3.5.0-451-g4d73f53

Brad King brad.king at kitware.com
Mon Mar 14 10:51:00 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  4d73f5367364a9104fa4a8b9d053a5ed2e48b748 (commit)
       via  fc3ba0ca3a231dd742a9e155e29074b8401c3a13 (commit)
      from  dc2cf2a6b1de9eea8154f1fb159a7da0a5b43b03 (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=4d73f5367364a9104fa4a8b9d053a5ed2e48b748
commit 4d73f5367364a9104fa4a8b9d053a5ed2e48b748
Merge: dc2cf2a fc3ba0c
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Mar 14 10:50:59 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Mar 14 10:50:59 2016 -0400

    Merge topic 'use-GetCMakeRoot' into next
    
    fc3ba0ca Avoid depending on CMAKE_ROOT cache entry internally (#16015)


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fc3ba0ca3a231dd742a9e155e29074b8401c3a13
commit fc3ba0ca3a231dd742a9e155e29074b8401c3a13
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Mar 14 10:38:19 2016 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Mar 14 10:38:19 2016 -0400

    Avoid depending on CMAKE_ROOT cache entry internally (#16015)
    
    Use cmSystemTools::GetCMakeRoot() which always knows the location of our
    resources.  Do not depend on CMAKE_ROOT because the user could unset it
    from the cache.

diff --git a/Source/cmCreateTestSourceList.cxx b/Source/cmCreateTestSourceList.cxx
index 54c27d6..e670991 100644
--- a/Source/cmCreateTestSourceList.cxx
+++ b/Source/cmCreateTestSourceList.cxx
@@ -78,8 +78,7 @@ bool cmCreateTestSourceList
   driver += *i;
   ++i;
 
-  std::string configFile =
-    this->Makefile->GetRequiredDefinition("CMAKE_ROOT");
+  std::string configFile = cmSystemTools::GetCMakeRoot();
 
   configFile += "/Templates/TestDriver.cxx.in";
   // Create the test driver file
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index ed0c69c..476d3ac 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -259,13 +259,12 @@ void cmExtraCodeBlocksGenerator
       }
 
     // Convert
-    const char* cmakeRoot = mf->GetDefinition("CMAKE_ROOT");
     for (std::vector<std::string>::const_iterator jt = listFiles.begin();
          jt != listFiles.end();
          ++jt)
       {
       // don't put cmake's own files into the project (#12110):
-      if (jt->find(cmakeRoot) == 0)
+      if (jt->find(cmSystemTools::GetCMakeRoot()) == 0)
         {
         continue;
         }
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index ff12320..d7c2782 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -3909,8 +3909,7 @@ void checkPropertyConsistency(cmGeneratorTarget const* depender,
 
   std::vector<std::string> props;
   cmSystemTools::ExpandListArgument(prop, props);
-  std::string pdir =
-    dependee->Target->GetMakefile()->GetRequiredDefinition("CMAKE_ROOT");
+  std::string pdir = cmSystemTools::GetCMakeRoot();
   pdir += "/Help/prop_tgt/";
 
   for(std::vector<std::string>::iterator pi = props.begin();
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index c628406..1d0ade4 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -820,7 +820,7 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
   // Now load files that can override any settings on the platform or for
   // the project First load the project compatibility file if it is in
   // cmake
-  std::string projectCompatibility = mf->GetDefinition("CMAKE_ROOT");
+  std::string projectCompatibility = cmSystemTools::GetCMakeRoot();
   projectCompatibility += "/Modules/";
   projectCompatibility += mf->GetSafeDefinition("PROJECT_NAME");
   projectCompatibility += "Compatibility.cmake";
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index 6a1aa29..14e9a88 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -189,7 +189,7 @@ void cmGlobalVisualStudioGenerator::ConfigureCMakeVisualStudioMacros()
 
   if (dir != "")
     {
-    std::string src = mf->GetRequiredDefinition("CMAKE_ROOT");
+    std::string src = cmSystemTools::GetCMakeRoot();
     src += "/Templates/" CMAKE_VSMACROS_FILENAME;
 
     std::string dst = dir + "/CMakeMacros/" CMAKE_VSMACROS_FILENAME;
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 8f59e2c..1df5cec 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -3738,17 +3738,13 @@ std::string cmMakefile::GetModulesFile(const char* filename) const
     }
 
   // Always search in the standard modules location.
-  const char* cmakeRoot = this->GetDefinition("CMAKE_ROOT");
-  if(cmakeRoot)
-    {
-    moduleInCMakeRoot = cmakeRoot;
-    moduleInCMakeRoot += "/Modules/";
-    moduleInCMakeRoot += filename;
-    cmSystemTools::ConvertToUnixSlashes(moduleInCMakeRoot);
-    if(!cmSystemTools::FileExists(moduleInCMakeRoot.c_str()))
-      {
-      moduleInCMakeRoot = "";
-      }
+  moduleInCMakeRoot = cmSystemTools::GetCMakeRoot();
+  moduleInCMakeRoot += "/Modules/";
+  moduleInCMakeRoot += filename;
+  cmSystemTools::ConvertToUnixSlashes(moduleInCMakeRoot);
+  if(!cmSystemTools::FileExists(moduleInCMakeRoot.c_str()))
+    {
+    moduleInCMakeRoot = "";
     }
 
   // Normally, prefer the files found in CMAKE_MODULE_PATH. Only when the file
@@ -3763,7 +3759,7 @@ std::string cmMakefile::GetModulesFile(const char* filename) const
   if (!moduleInCMakeModulePath.empty() && !moduleInCMakeRoot.empty())
     {
     const char* currentFile = this->GetDefinition("CMAKE_CURRENT_LIST_FILE");
-    std::string mods = cmakeRoot + std::string("/Modules/");
+    std::string mods = cmSystemTools::GetCMakeRoot() + "/Modules/";
     if (currentFile && strncmp(currentFile, mods.c_str(), mods.size()) == 0)
       {
       switch (this->GetPolicyStatus(cmPolicies::CMP0017))
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index 08caea3..4cab81f 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -1003,8 +1003,7 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget(
     SetupAutoRccTarget(target);
     }
 
-  const char* cmakeRoot = makefile->GetSafeDefinition("CMAKE_ROOT");
-  std::string inputFile = cmakeRoot;
+  std::string inputFile = cmSystemTools::GetCMakeRoot();
   inputFile += "/Modules/AutogenInfo.cmake.in";
   std::string outputFile = targetDir;
   outputFile += "/AutogenInfo.cmake";
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 74364f7..dcc95af 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -2409,8 +2409,7 @@ int cmake::GetSystemInformation(std::vector<std::string>& args)
 
   // we have to find the module directory, so we can copy the files
   this->AddCMakePaths();
-  std::string modulesPath =
-    this->State->GetInitializedCacheValue("CMAKE_ROOT");
+  std::string modulesPath = cmSystemTools::GetCMakeRoot();
   modulesPath += "/Modules";
   std::string inFile = modulesPath;
   inFile += "/SystemInformation.cmake";

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

Summary of changes:
 Source/cmCreateTestSourceList.cxx        |    3 +--
 Source/cmExtraCodeBlocksGenerator.cxx    |    3 +--
 Source/cmGeneratorTarget.cxx             |    3 +--
 Source/cmGlobalGenerator.cxx             |    2 +-
 Source/cmGlobalVisualStudioGenerator.cxx |    2 +-
 Source/cmMakefile.cxx                    |   20 ++++++++------------
 Source/cmQtAutoGeneratorInitializer.cxx  |    3 +--
 Source/cmake.cxx                         |    3 +--
 8 files changed, 15 insertions(+), 24 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list