[Cmake-commits] CMake branch, next, updated. v2.8.6-1787-gf836441

Brad King brad.king at kitware.com
Thu Nov 3 09:39:12 EDT 2011


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  f83644187bcb776e4f416d7ddcd2a0cc19d1e6a9 (commit)
       via  23381d83d8d8399eea372e3f2407beac39e55b98 (commit)
       via  22bf096474dbd819e4a10cc3b45fa54ba50213d0 (commit)
      from  d0df59b5b746d747ba930086f73652045382c0c3 (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 -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f83644187bcb776e4f416d7ddcd2a0cc19d1e6a9
commit f83644187bcb776e4f416d7ddcd2a0cc19d1e6a9
Merge: d0df59b 23381d8
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Nov 3 09:38:50 2011 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Nov 3 09:38:50 2011 -0400

    Merge topic 'watcom-cmake-shortpath-issue-12548' into next
    
    23381d8 Watcom: Use shortpath to CMake if full path has parens (#12548)
    22bf096 KWSys Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=23381d83d8d8399eea372e3f2407beac39e55b98
commit 23381d83d8d8399eea372e3f2407beac39e55b98
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Nov 3 08:59:50 2011 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Nov 3 09:23:55 2011 -0400

    Watcom: Use shortpath to CMake if full path has parens (#12548)
    
    The Watcom WMake tool has trouble running commands in paths that have
    parentheses.  We already convert most commands to a shortpath for Watcom
    if the path contains a space, but the use of $(CMAKE_COMMAND) hides the
    true path from that conversion.  Factor the shortpath conversion code
    out into a new ConvertShellCommand method.  Teach it to convert paths
    that contain parentheses as well as spaces.  Use the new method to
    convert the value of $(CMAKE_COMMAND) and other helper variables.

diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index da6a1c6..c8a06aa 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -608,6 +608,27 @@ cmLocalUnixMakefileGenerator3
 }
 
 //----------------------------------------------------------------------------
+std::string
+cmLocalUnixMakefileGenerator3
+::ConvertShellCommand(std::string const& cmd, RelativeRoot root)
+{
+  if(this->WatcomWMake &&
+     cmSystemTools::FileIsFullPath(cmd.c_str()) &&
+     cmd.find_first_of("( )") != cmd.npos)
+    {
+    // On Watcom WMake use the windows short path for the command
+    // name.  This is needed to avoid funny quoting problems on
+    // lines with shell redirection operators.
+    std::string scmd;
+    if(cmSystemTools::GetShortPath(cmd.c_str(), scmd))
+      {
+      return this->Convert(scmd.c_str(), NONE, SHELL);
+      }
+    }
+  return this->Convert(cmd.c_str(), root, SHELL);
+}
+
+//----------------------------------------------------------------------------
 void
 cmLocalUnixMakefileGenerator3
 ::WriteMakeVariables(std::ostream& makefileStream)
@@ -646,13 +667,13 @@ cmLocalUnixMakefileGenerator3
   makefileStream
     << "# The CMake executable.\n"
     << "CMAKE_COMMAND = "
-    << this->Convert(cmakecommand.c_str(), FULL, SHELL).c_str()
+    << this->ConvertShellCommand(cmakecommand, FULL)
     << "\n"
     << "\n";
   makefileStream
     << "# The command to remove a file.\n"
     << "RM = "
-    << this->Convert(cmakecommand.c_str(),FULL,SHELL).c_str()
+    << this->ConvertShellCommand(cmakecommand, FULL)
     << " -E remove -f\n"
     << "\n";
 
@@ -662,7 +683,7 @@ cmLocalUnixMakefileGenerator3
     makefileStream
       << "# The program to use to edit the cache.\n"
       << "CMAKE_EDIT_COMMAND = "
-      << this->Convert(edit_cmd,FULL,SHELL) << "\n"
+      << this->ConvertShellCommand(edit_cmd, FULL) << "\n"
       << "\n";
     }
 
@@ -1019,22 +1040,9 @@ cmLocalUnixMakefileGenerator3
         // without the current directory being in the search path.
         cmd = "./" + cmd;
         }
-      if(this->WatcomWMake &&
-         cmSystemTools::FileIsFullPath(cmd.c_str()) &&
-         cmd.find(" ") != cmd.npos)
-        {
-        // On Watcom WMake use the windows short path for the command
-        // name.  This is needed to avoid funny quoting problems on
-        // lines with shell redirection operators.
-        std::string scmd;
-        if(cmSystemTools::GetShortPath(cmd.c_str(), scmd))
-          {
-          cmd = scmd;
-          }
-        }
       std::string launcher =
         this->MakeLauncher(cc, target, workingDir? NONE : START_OUTPUT);
-      cmd = launcher + this->Convert(cmd.c_str(),NONE,SHELL);
+      cmd = launcher + this->ConvertShellCommand(cmd, NONE);
 
       ccg.AppendArguments(c, cmd);
       if(content)
diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h
index fab98da..45ac21d 100644
--- a/Source/cmLocalUnixMakefileGenerator3.h
+++ b/Source/cmLocalUnixMakefileGenerator3.h
@@ -340,6 +340,7 @@ protected:
   void CheckMultipleOutputs(bool verbose);
 
 private:
+  std::string ConvertShellCommand(std::string const& cmd, RelativeRoot root);
   std::string MakeLauncher(const cmCustomCommand& cc, cmTarget* target,
                            RelativeRoot relative);
 

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

Summary of changes:
 Source/cmLocalUnixMakefileGenerator3.cxx |   42 +++++++++++++++++------------
 Source/cmLocalUnixMakefileGenerator3.h   |    1 +
 Source/kwsys/kwsysDateStamp.cmake        |    2 +-
 3 files changed, 27 insertions(+), 18 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list