[Cmake-commits] CMake branch, next, updated. v3.6.0-rc2-473-g8773905

Daniel Pfeifer daniel at pfeifer-mail.de
Mon Jun 20 17:23:54 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  8773905db61f266558ec0c949e0e05e11b7dd496 (commit)
       via  8ddbd4c2806f3064f734377b48ec77131f6836dc (commit)
       via  bdaadbdc2b6f7cb9eea1392043f225da85f51b5b (commit)
       via  191fc3a0f373d262e2f2e5a2ccb07979e227d683 (commit)
       via  b86007e385fc0f4cc45149b68cafebad749bf6e8 (commit)
       via  cde127b08441b23f7210bfe987812f8d253e960b (commit)
       via  c23f89bc7651609865164c95ce3655ebd369c11e (commit)
      from  3ee00ccc05b5b967e1a7e5c60789b1f4621ea4bd (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=8773905db61f266558ec0c949e0e05e11b7dd496
commit 8773905db61f266558ec0c949e0e05e11b7dd496
Merge: 3ee00cc 8ddbd4c
Author:     Daniel Pfeifer <daniel at pfeifer-mail.de>
AuthorDate: Mon Jun 20 17:23:50 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Jun 20 17:23:50 2016 -0400

    Merge topic 'output-converter' into next
    
    8ddbd4c2 cmOutputConverter: remove unnecessary conversion
    bdaadbdc cmOutputConverter: collapse ConvertToOutputForExisting functions
    191fc3a0 cmOutputConverter: remove unused 'local' argument
    b86007e3 cmOutputConverter: remove 'optional' argument
    cde127b0 cmOutputConverter::Convert: invert condition
    c23f89bc cmOutputConverter::Convert: make precondition explicit


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8ddbd4c2806f3064f734377b48ec77131f6836dc
commit 8ddbd4c2806f3064f734377b48ec77131f6836dc
Author:     Daniel Pfeifer <daniel at pfeifer-mail.de>
AuthorDate: Mon Jun 20 23:18:59 2016 +0200
Commit:     Daniel Pfeifer <daniel at pfeifer-mail.de>
CommitDate: Mon Jun 20 23:18:59 2016 +0200

    cmOutputConverter: remove unnecessary conversion

diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx
index 03d8376..b92c074 100644
--- a/Source/cmOutputConverter.cxx
+++ b/Source/cmOutputConverter.cxx
@@ -30,13 +30,11 @@ cmOutputConverter::cmOutputConverter(cmState::Snapshot snapshot)
 std::string cmOutputConverter::ConvertToOutputForExisting(
   const std::string& remote, OutputFormat format) const
 {
-  // Perform standard conversion.
-  std::string result = this->ConvertToOutputFormat(remote, format);
-
   // If this is a windows shell, the result has a space, and the path
   // already exists, we can use a short-path to reference it without a
   // space.
-  if (this->GetState()->UseWindowsShell() && result.find(' ') != result.npos &&
+  if (this->GetState()->UseWindowsShell() &&
+      remote.find(' ') != std::string::npos &&
       cmSystemTools::FileExists(remote.c_str())) {
     std::string tmp;
     if (cmSystemTools::GetShortPath(remote, tmp)) {
@@ -44,8 +42,8 @@ std::string cmOutputConverter::ConvertToOutputForExisting(
     }
   }
 
-  // Otherwise, leave it unchanged.
-  return result;
+  // Otherwise, perform standard conversion.
+  return this->ConvertToOutputFormat(remote, format);
 }
 
 std::string cmOutputConverter::ConvertToOutputForExisting(

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bdaadbdc2b6f7cb9eea1392043f225da85f51b5b
commit bdaadbdc2b6f7cb9eea1392043f225da85f51b5b
Author:     Daniel Pfeifer <daniel at pfeifer-mail.de>
AuthorDate: Mon Jun 20 23:11:05 2016 +0200
Commit:     Daniel Pfeifer <daniel at pfeifer-mail.de>
CommitDate: Mon Jun 20 23:11:05 2016 +0200

    cmOutputConverter: collapse ConvertToOutputForExisting functions

diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx
index e66158e..03d8376 100644
--- a/Source/cmOutputConverter.cxx
+++ b/Source/cmOutputConverter.cxx
@@ -27,10 +27,12 @@ cmOutputConverter::cmOutputConverter(cmState::Snapshot snapshot)
   assert(this->StateSnapshot.IsValid());
 }
 
-std::string cmOutputConverter::ConvertToOutputForExistingCommon(
-  const std::string& remote, std::string const& result,
-  OutputFormat format) const
+std::string cmOutputConverter::ConvertToOutputForExisting(
+  const std::string& remote, OutputFormat format) const
 {
+  // Perform standard conversion.
+  std::string result = this->ConvertToOutputFormat(remote, format);
+
   // If this is a windows shell, the result has a space, and the path
   // already exists, we can use a short-path to reference it without a
   // space.
@@ -47,16 +49,6 @@ std::string cmOutputConverter::ConvertToOutputForExistingCommon(
 }
 
 std::string cmOutputConverter::ConvertToOutputForExisting(
-  const std::string& remote, OutputFormat format) const
-{
-  // Perform standard conversion.
-  std::string result = this->ConvertToOutputFormat(remote, format);
-
-  // Consider short-path.
-  return this->ConvertToOutputForExistingCommon(remote, result, format);
-}
-
-std::string cmOutputConverter::ConvertToOutputForExisting(
   RelativeRoot remote, OutputFormat format) const
 {
   // The relative root must have a path (i.e. not FULL or NONE)
@@ -66,11 +58,7 @@ std::string cmOutputConverter::ConvertToOutputForExisting(
   const char* remotePath = this->GetRelativeRootPath(remote);
   assert(remotePath != 0);
 
-  // Perform standard conversion.
-  std::string result = this->ConvertToOutputFormat(remotePath, format);
-
-  // Consider short-path.
-  return this->ConvertToOutputForExistingCommon(remotePath, result, format);
+  return this->ConvertToOutputForExisting(remotePath, format);
 }
 
 const char* cmOutputConverter::GetRelativeRootPath(RelativeRoot relroot) const
diff --git a/Source/cmOutputConverter.h b/Source/cmOutputConverter.h
index 3d7d493..23f2e62 100644
--- a/Source/cmOutputConverter.h
+++ b/Source/cmOutputConverter.h
@@ -159,10 +159,6 @@ public:
 private:
   cmState* GetState() const;
 
-  std::string ConvertToOutputForExistingCommon(const std::string& remote,
-                                               std::string const& result,
-                                               OutputFormat format) const;
-
   static int Shell__CharIsWhitespace(char c);
   static int Shell__CharNeedsQuotesOnUnix(char c);
   static int Shell__CharNeedsQuotesOnWindows(char c);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=191fc3a0f373d262e2f2e5a2ccb07979e227d683
commit 191fc3a0f373d262e2f2e5a2ccb07979e227d683
Author:     Daniel Pfeifer <daniel at pfeifer-mail.de>
AuthorDate: Mon Jun 20 23:03:28 2016 +0200
Commit:     Daniel Pfeifer <daniel at pfeifer-mail.de>
CommitDate: Mon Jun 20 23:03:28 2016 +0200

    cmOutputConverter: remove unused 'local' argument

diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index e2e7aa1..0de9895 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -832,8 +832,8 @@ void cmLocalGenerator::InsertRuleLauncher(std::string& s,
 std::string cmLocalGenerator::ConvertToIncludeReference(
   std::string const& path, OutputFormat format, bool forceFullPaths)
 {
-  return this->ConvertToOutputForExisting(
-    path, forceFullPaths ? FULL : START_OUTPUT, format);
+  static_cast<void>(forceFullPaths);
+  return this->ConvertToOutputForExisting(path, format);
 }
 
 std::string cmLocalGenerator::GetIncludeFlags(
@@ -1503,7 +1503,7 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries,
   for (std::vector<std::string>::const_iterator libDir = libDirs.begin();
        libDir != libDirs.end(); ++libDir) {
     std::string libpath =
-      this->ConvertToOutputForExisting(*libDir, START_OUTPUT, shellFormat);
+      this->ConvertToOutputForExisting(*libDir, shellFormat);
     linkPath += " " + libPathFlag;
     linkPath += libpath;
     linkPath += libPathTerminator;
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 460f0e2..0478a3a 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -2068,19 +2068,18 @@ void cmLocalUnixMakefileGenerator3::CreateCDCommand(
     // back because the shell keeps the working directory between
     // commands.
     std::string cmd = cd_cmd;
-    cmd += this->ConvertToOutputForExisting(tgtDir, relRetDir);
+    cmd += this->ConvertToOutputForExisting(tgtDir);
     commands.insert(commands.begin(), cmd);
 
     // Change back to the starting directory.
     cmd = cd_cmd;
-    cmd += this->ConvertToOutputForExisting(relRetDir, tgtDir);
+    cmd += this->ConvertToOutputForExisting(relRetDir);
     commands.push_back(cmd);
   } else {
     // On UNIX we must construct a single shell command to change
     // directory and build because make resets the directory between
     // each command.
-    std::string outputForExisting =
-      this->ConvertToOutputForExisting(tgtDir, relRetDir);
+    std::string outputForExisting = this->ConvertToOutputForExisting(tgtDir);
     std::string prefix = cd_cmd + outputForExisting + " && ";
     std::transform(commands.begin(), commands.end(), commands.begin(),
                    std::bind1st(std::plus<std::string>(), prefix));
diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx
index 8f1e3af..e66158e 100644
--- a/Source/cmOutputConverter.cxx
+++ b/Source/cmOutputConverter.cxx
@@ -47,10 +47,8 @@ std::string cmOutputConverter::ConvertToOutputForExistingCommon(
 }
 
 std::string cmOutputConverter::ConvertToOutputForExisting(
-  const std::string& remote, RelativeRoot local, OutputFormat format) const
+  const std::string& remote, OutputFormat format) const
 {
-  static_cast<void>(local);
-
   // Perform standard conversion.
   std::string result = this->ConvertToOutputFormat(remote, format);
 
@@ -59,10 +57,8 @@ std::string cmOutputConverter::ConvertToOutputForExisting(
 }
 
 std::string cmOutputConverter::ConvertToOutputForExisting(
-  RelativeRoot remote, const std::string& local, OutputFormat format) const
+  RelativeRoot remote, OutputFormat format) const
 {
-  static_cast<void>(local);
-
   // The relative root must have a path (i.e. not FULL or NONE)
   assert(remote != FULL);
   assert(remote != NONE);
diff --git a/Source/cmOutputConverter.h b/Source/cmOutputConverter.h
index f661572..3d7d493 100644
--- a/Source/cmOutputConverter.h
+++ b/Source/cmOutputConverter.h
@@ -69,13 +69,11 @@ public:
 
   ///! for existing files convert to output path and short path if spaces
   std::string ConvertToOutputForExisting(const std::string& remote,
-                                         RelativeRoot local = START_OUTPUT,
                                          OutputFormat format = SHELL) const;
 
   /** For existing path identified by RelativeRoot convert to output
       path and short path if spaces.  */
   std::string ConvertToOutputForExisting(RelativeRoot remote,
-                                         const std::string& local = "",
                                          OutputFormat format = SHELL) const;
 
   void SetLinkScriptShell(bool linkScriptShell);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b86007e385fc0f4cc45149b68cafebad749bf6e8
commit b86007e385fc0f4cc45149b68cafebad749bf6e8
Author:     Daniel Pfeifer <daniel at pfeifer-mail.de>
AuthorDate: Mon Jun 20 22:31:57 2016 +0200
Commit:     Daniel Pfeifer <daniel at pfeifer-mail.de>
CommitDate: Mon Jun 20 22:32:02 2016 +0200

    cmOutputConverter: remove 'optional' argument
    
    Remove the 'optional' paramenter from the second overload of the Convert
    function.  This parameter is used from one single location.  Inline the
    codepath for which the argument is true to the callsite.

diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx
index a45e37b..8f1e3af 100644
--- a/Source/cmOutputConverter.cxx
+++ b/Source/cmOutputConverter.cxx
@@ -61,11 +61,19 @@ std::string cmOutputConverter::ConvertToOutputForExisting(
 std::string cmOutputConverter::ConvertToOutputForExisting(
   RelativeRoot remote, const std::string& local, OutputFormat format) const
 {
+  static_cast<void>(local);
+
+  // The relative root must have a path (i.e. not FULL or NONE)
+  assert(remote != FULL);
+  assert(remote != NONE);
+
+  const char* remotePath = this->GetRelativeRootPath(remote);
+  assert(remotePath != 0);
+
   // Perform standard conversion.
-  std::string result = this->Convert(remote, local, format, true);
+  std::string result = this->ConvertToOutputFormat(remotePath, format);
 
   // Consider short-path.
-  const char* remotePath = this->GetRelativeRootPath(remote);
   return this->ConvertToOutputForExistingCommon(remotePath, result, format);
 }
 
@@ -158,8 +166,7 @@ std::string cmOutputConverter::ConvertDirectorySeparatorsForShell(
 
 std::string cmOutputConverter::Convert(RelativeRoot remote,
                                        const std::string& local,
-                                       OutputFormat output,
-                                       bool optional) const
+                                       OutputFormat output) const
 {
   // The relative root must have a path (i.e. not FULL or NONE)
   assert(remote != FULL);
@@ -168,7 +175,7 @@ std::string cmOutputConverter::Convert(RelativeRoot remote,
   const char* remotePath = this->GetRelativeRootPath(remote);
   assert(remotePath != 0);
 
-  if (local.empty() || optional) {
+  if (local.empty()) {
     return this->ConvertToOutputFormat(remotePath, output);
   }
 
diff --git a/Source/cmOutputConverter.h b/Source/cmOutputConverter.h
index f138d0e..f661572 100644
--- a/Source/cmOutputConverter.h
+++ b/Source/cmOutputConverter.h
@@ -58,8 +58,7 @@ public:
   std::string Convert(const std::string& remote, RelativeRoot local,
                       OutputFormat output = UNCHANGED) const;
   std::string Convert(RelativeRoot remote, const std::string& local,
-                      OutputFormat output = UNCHANGED,
-                      bool optional = false) const;
+                      OutputFormat output = UNCHANGED) const;
   std::string ConvertDirectorySeparatorsForShell(
     const std::string& source) const;
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cde127b08441b23f7210bfe987812f8d253e960b
commit cde127b08441b23f7210bfe987812f8d253e960b
Author:     Daniel Pfeifer <daniel at pfeifer-mail.de>
AuthorDate: Mon Jun 20 22:12:21 2016 +0200
Commit:     Daniel Pfeifer <daniel at pfeifer-mail.de>
CommitDate: Mon Jun 20 22:12:36 2016 +0200

    cmOutputConverter::Convert: invert condition
    
    Make the control flow of the 'optional' argument more explicit.

diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx
index a23478b..a45e37b 100644
--- a/Source/cmOutputConverter.cxx
+++ b/Source/cmOutputConverter.cxx
@@ -168,14 +168,14 @@ std::string cmOutputConverter::Convert(RelativeRoot remote,
   const char* remotePath = this->GetRelativeRootPath(remote);
   assert(remotePath != 0);
 
-  if (!local.empty() && !optional) {
-    std::vector<std::string> components;
-    cmSystemTools::SplitPath(local, components);
-    std::string result = this->ConvertToRelativePath(components, remotePath);
-    return this->ConvertToOutputFormat(result, output);
+  if (local.empty() || optional) {
+    return this->ConvertToOutputFormat(remotePath, output);
   }
 
-  return this->ConvertToOutputFormat(remotePath, output);
+  std::vector<std::string> components;
+  cmSystemTools::SplitPath(local, components);
+  std::string result = this->ConvertToRelativePath(components, remotePath);
+  return this->ConvertToOutputFormat(result, output);
 }
 
 static bool cmOutputConverterNotAbove(const char* a, const char* b)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c23f89bc7651609865164c95ce3655ebd369c11e
commit c23f89bc7651609865164c95ce3655ebd369c11e
Author:     Daniel Pfeifer <daniel at pfeifer-mail.de>
AuthorDate: Mon Jun 20 22:11:20 2016 +0200
Commit:     Daniel Pfeifer <daniel at pfeifer-mail.de>
CommitDate: Mon Jun 20 22:11:20 2016 +0200

    cmOutputConverter::Convert: make precondition explicit

diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx
index da43a11..a23478b 100644
--- a/Source/cmOutputConverter.cxx
+++ b/Source/cmOutputConverter.cxx
@@ -161,9 +161,11 @@ std::string cmOutputConverter::Convert(RelativeRoot remote,
                                        OutputFormat output,
                                        bool optional) const
 {
-  const char* remotePath = this->GetRelativeRootPath(remote);
-
   // The relative root must have a path (i.e. not FULL or NONE)
+  assert(remote != FULL);
+  assert(remote != NONE);
+
+  const char* remotePath = this->GetRelativeRootPath(remote);
   assert(remotePath != 0);
 
   if (!local.empty() && !optional) {

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

Summary of changes:
 Source/cmLocalGenerator.cxx              |    6 ++--
 Source/cmLocalUnixMakefileGenerator3.cxx |    7 ++--
 Source/cmOutputConverter.cxx             |   57 +++++++++++++-----------------
 Source/cmOutputConverter.h               |    9 +----
 4 files changed, 31 insertions(+), 48 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list