[Cmake-commits] CMake branch, next, updated. v3.6.2-1969-gaed1d8b

Brad King brad.king at kitware.com
Mon Sep 12 16:03: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  aed1d8b3c44fb6e1eced38b8d568dd36a0103eb0 (commit)
       via  3e58b9af57074ded65566330c33999bdfac191a8 (commit)
       via  c73967cb4a0217b2d0825f67d6fd56af2b4d6b7f (commit)
       via  366e38284d0a111542a5c87ded6ad21fa641cb2c (commit)
      from  ca930ba20f364bd9613a2df1da0074b1260ddf0b (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=aed1d8b3c44fb6e1eced38b8d568dd36a0103eb0
commit aed1d8b3c44fb6e1eced38b8d568dd36a0103eb0
Merge: ca930ba 3e58b9a
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Sep 12 16:03:25 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Sep 12 16:03:25 2016 -0400

    Merge topic 'cmake-server-prepare' into next
    
    3e58b9af cmake: Factor out method to find the CMakeCache.txt file
    c73967cb cmake: Introduce ReportCapabilitiesJson
    366e3828 Update .gitignore


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3e58b9af57074ded65566330c33999bdfac191a8
commit 3e58b9af57074ded65566330c33999bdfac191a8
Author:     Tobias Hunger <tobias.hunger at qt.io>
AuthorDate: Fri Sep 9 14:49:30 2016 +0200
Commit:     Tobias Hunger <tobias.hunger at qt.io>
CommitDate: Mon Sep 12 22:00:22 2016 +0200

    cmake: Factor out method to find the CMakeCache.txt file

diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 4edf228..0d61a3d 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -1046,6 +1046,28 @@ const char* cmake::GetHomeOutputDirectory() const
   return this->State->GetBinaryDirectory();
 }
 
+std::string cmake::FindCacheFile(const std::string& binaryDir) const
+{
+  std::string cachePath = binaryDir;
+  cmSystemTools::ConvertToUnixSlashes(cachePath);
+  std::string cacheFile = cachePath;
+  cacheFile += "/CMakeCache.txt";
+  if (!cmSystemTools::FileExists(cacheFile.c_str())) {
+    // search in parent directories for cache
+    std::string cmakeFiles = cachePath;
+    cmakeFiles += "/CMakeFiles";
+    if (cmSystemTools::FileExists(cmakeFiles.c_str())) {
+      std::string cachePathFound =
+        cmSystemTools::FileExistsInParentDirectories("CMakeCache.txt",
+                                                     cachePath.c_str(), "/");
+      if (!cachePathFound.empty()) {
+        cachePath = cmSystemTools::GetFilenamePath(cachePathFound);
+      }
+    }
+  }
+  return cachePath;
+}
+
 void cmake::SetGlobalGenerator(cmGlobalGenerator* gg)
 {
   if (!gg) {
@@ -2344,24 +2366,8 @@ int cmake::Build(const std::string& dir, const std::string& target,
     std::cerr << "Error: " << dir << " is not a directory\n";
     return 1;
   }
-  std::string cachePath = dir;
-  cmSystemTools::ConvertToUnixSlashes(cachePath);
-  std::string cacheFile = cachePath;
-  cacheFile += "/CMakeCache.txt";
-  if (!cmSystemTools::FileExists(cacheFile.c_str())) {
-    // search in parent directories for cache
-    std::string cmakeFiles = cachePath;
-    cmakeFiles += "/CMakeFiles";
-    if (cmSystemTools::FileExists(cmakeFiles.c_str())) {
-      std::string cachePathFound =
-        cmSystemTools::FileExistsInParentDirectories("CMakeCache.txt",
-                                                     cachePath.c_str(), "/");
-      if (!cachePathFound.empty()) {
-        cachePath = cmSystemTools::GetFilenamePath(cachePathFound);
-      }
-    }
-  }
 
+  std::string cachePath = FindCacheFile(dir);
   if (!this->LoadCache(cachePath)) {
     std::cerr << "Error: could not load cache\n";
     return 1;
diff --git a/Source/cmake.h b/Source/cmake.h
index 8dd0128..30661d9 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -193,6 +193,9 @@ public:
     return this->GlobalGenerator;
   }
 
+  ///! Return the full path to where the CMakeCache.txt file should be.
+  std::string FindCacheFile(const std::string& binaryDir) const;
+
   ///! Return the global generator assigned to this instance of cmake
   void SetGlobalGenerator(cmGlobalGenerator*);
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c73967cb4a0217b2d0825f67d6fd56af2b4d6b7f
commit c73967cb4a0217b2d0825f67d6fd56af2b4d6b7f
Author:     Tobias Hunger <tobias.hunger at qt.io>
AuthorDate: Fri Sep 9 10:01:43 2016 +0200
Commit:     Tobias Hunger <tobias.hunger at qt.io>
CommitDate: Mon Sep 12 17:24:06 2016 +0200

    cmake: Introduce ReportCapabilitiesJson
    
    Introduce cmake::ReportCapabilitiesJson which returns a the Json object
    that is serialized in cmake::ReportCapabilities.
    
    This allows to re-use the information in cmake-server.

diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index d6bea3d..4edf228 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -35,7 +35,7 @@
 #if defined(CMAKE_BUILD_WITH_CMAKE)
 #include "cmGraphVizWriter.h"
 #include "cmVariableWatch.h"
-#include <cm_jsoncpp_value.h>
+
 #include <cm_jsoncpp_writer.h>
 #endif
 
@@ -233,10 +233,9 @@ cmake::~cmake()
   delete this->FileComparison;
 }
 
-std::string cmake::ReportCapabilities() const
-{
-  std::string result;
 #if defined(CMAKE_BUILD_WITH_CMAKE)
+Json::Value cmake::ReportCapabilitiesJson() const
+{
   Json::Value obj = Json::objectValue;
   // Version information:
   Json::Value version = Json::objectValue;
@@ -287,8 +286,16 @@ std::string cmake::ReportCapabilities() const
 #else
   obj["serverMode"] = false;
 #endif
+  return obj;
+}
+#endif
+
+std::string cmake::ReportCapabilities() const
+{
+  std::string result;
+#if defined(CMAKE_BUILD_WITH_CMAKE)
   Json::FastWriter writer;
-  result = writer.write(obj);
+  result = writer.write(this->ReportCapabilitiesJson());
 #else
   result = "Not supported";
 #endif
diff --git a/Source/cmake.h b/Source/cmake.h
index 9dc429d..8dd0128 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -24,6 +24,10 @@
 #include <string>
 #include <vector>
 
+#if defined(CMAKE_BUILD_WITH_CMAKE)
+#include "cm_jsoncpp_value.h"
+#endif
+
 class cmExternalMakefileProjectGeneratorFactory;
 class cmFileTimeComparison;
 class cmGlobalGenerator;
@@ -118,6 +122,9 @@ public:
   /// Destructor
   ~cmake();
 
+#if defined(CMAKE_BUILD_WITH_CMAKE)
+  Json::Value ReportCapabilitiesJson() const;
+#endif
   std::string ReportCapabilities() const;
 
   static const char* GetCMakeFilesDirectory() { return "/CMakeFiles"; }

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=366e38284d0a111542a5c87ded6ad21fa641cb2c
commit 366e38284d0a111542a5c87ded6ad21fa641cb2c
Author:     Tobias Hunger <tobias.hunger at qt.io>
AuthorDate: Fri Sep 9 10:01:43 2016 +0200
Commit:     Tobias Hunger <tobias.hunger at qt.io>
CommitDate: Mon Sep 12 17:23:50 2016 +0200

    Update .gitignore
    
    Ignore *.user* files from QtCreator and *.pyc files.

diff --git a/.gitignore b/.gitignore
index 0d09cdc..5d1732d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,7 @@
 # Exclude MacOS Finder files.
 .DS_Store
+
+*.user*
+
+*.pyc
+Testing

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

Summary of changes:
 .gitignore       |    5 +++++
 Source/cmake.cxx |   57 +++++++++++++++++++++++++++++++++---------------------
 Source/cmake.h   |   10 ++++++++++
 3 files changed, 50 insertions(+), 22 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list