[Cmake-commits] CMake branch, next, updated. v3.8.0-rc2-583-g4ea507d

Kitware Robot kwrobot at kitware.com
Wed Mar 22 12:45:03 EDT 2017


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  4ea507d989fed7a3bc8fa762419f4e8b13a0ea50 (commit)
       via  8285ad511a92416f0e99fcda27de98435316173b (commit)
      from  31004b59ed1dd444582ce5948ee151247ae3fb6c (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=4ea507d989fed7a3bc8fa762419f4e8b13a0ea50
commit 4ea507d989fed7a3bc8fa762419f4e8b13a0ea50
Merge: 31004b5 8285ad5
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Mar 22 16:37:14 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed Mar 22 12:37:18 2017 -0400

    Stage topic 'fix/16736'
    
    Topic-id: 23186
    Topic-url: https://gitlab.kitware.com/cmake/cmake/merge_requests/611


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8285ad511a92416f0e99fcda27de98435316173b
commit 8285ad511a92416f0e99fcda27de98435316173b
Author:     Tobias Hunger <tobias.hunger at qt.io>
AuthorDate: Wed Mar 22 16:52:08 2017 +0100
Commit:     Tobias Hunger <tobias.hunger at qt.io>
CommitDate: Wed Mar 22 17:31:02 2017 +0100

    server-mode: Make CMAKE_HOME_DIRECTORY more reliable
    
    Make CMAKE_HOME_DIRECTORY detection work more reliably in the face
    of symlinks.
    
    Closes #16736

diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx
index e159c8f..8317018 100644
--- a/Source/cmServerProtocol.cxx
+++ b/Source/cmServerProtocol.cxx
@@ -251,6 +251,27 @@ static void setErrorMessage(std::string* errorMessage, const std::string& text)
   }
 }
 
+static bool testHomeDirectory(cmState* state, std::string& value,
+                              std::string* errorMessage)
+{
+  const std::string cachedValue =
+    std::string(state->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"));
+  const std::string suffix = "/CMakeLists.txt";
+  const std::string cachedValueCML = cachedValue + suffix;
+  const std::string valueCML = value + suffix;
+  if (!cmSystemTools::SameFile(valueCML, cachedValueCML)) {
+    setErrorMessage(errorMessage,
+                    std::string("\"CMAKE_HOME_DIRECTORY\" is set but "
+                                "incompatible with configured "
+                                "source directory value."));
+    return false;
+  }
+  if (value.empty()) {
+    value = cachedValue;
+  }
+  return true;
+}
+
 static bool testValue(cmState* state, const std::string& key,
                       std::string& value, const std::string& keyDescription,
                       std::string* errorMessage)
@@ -310,8 +331,7 @@ bool cmServerProtocol1_0::DoActivate(const cmServerRequest& request,
       }
 
       // check sourcedir:
-      if (!testValue(state, "CMAKE_HOME_DIRECTORY", sourceDirectory,
-                     "source directory", errorMessage)) {
+      if (!testHomeDirectory(state, sourceDirectory, errorMessage)) {
         return false;
       }
 

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

Summary of changes:
 Source/cmServerProtocol.cxx |   24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list