[Cmake-commits] CMake branch, next, updated. v2.8.11.2-3447-g1f270ca

Patrick Gansterer paroga at paroga.com
Mon Jul 29 02:55:29 EDT 2013


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  1f270cad85205759e1b9bd27a1067ea747db1c4e (commit)
       via  2b473d2eaa2d09a69fc5a4f37d24ad051d5ead9a (commit)
       via  fc1708ac99ead110417911609a2b67d4deae9d34 (commit)
       via  8d3b65346f112d2d21efd3105f4d1535adc2935e (commit)
      from  fa080816bf8998a5020137760462bd9cd6052070 (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=1f270cad85205759e1b9bd27a1067ea747db1c4e
commit 1f270cad85205759e1b9bd27a1067ea747db1c4e
Merge: fa08081 2b473d2
Author:     Patrick Gansterer <paroga at paroga.com>
AuthorDate: Mon Jul 29 02:55:26 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Jul 29 02:55:26 2013 -0400

    Merge topic 'passthru' into next
    
    2b473d2 Add option to use stdout/stderr of original terminal in cmake --build
    fc1708a CMake Nightly Date Stamp
    8d3b653 CMake Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2b473d2eaa2d09a69fc5a4f37d24ad051d5ead9a
commit 2b473d2eaa2d09a69fc5a4f37d24ad051d5ead9a
Author:     Patrick Gansterer <paroga at paroga.com>
AuthorDate: Mon Jul 29 08:52:54 2013 +0200
Commit:     Patrick Gansterer <paroga at paroga.com>
CommitDate: Mon Jul 29 08:52:54 2013 +0200

    Add option to use stdout/stderr of original terminal in cmake --build
    
    Pass the original file handles to the native tool when using the
    --use-stderr option in the build command. This enables the
    usage of advanced terminal features like colored output.

diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index c52c266..c5e475e 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -638,6 +638,12 @@ bool cmSystemTools::RunSingleCommand(std::vector<cmStdString>const& command,
     cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1);
     }
 
+  if (outputflag == OUTPUT_PASSTHROUGH)
+    {
+    cmsysProcess_SetPipeShared(cp, cmsysProcess_Pipe_STDOUT, 1);
+    cmsysProcess_SetPipeShared(cp, cmsysProcess_Pipe_STDERR, 1);
+    }
+
   cmsysProcess_SetTimeout(cp, timeout);
   cmsysProcess_Execute(cp);
 
@@ -645,7 +651,7 @@ bool cmSystemTools::RunSingleCommand(std::vector<cmStdString>const& command,
   char* data;
   int length;
   int pipe;
-  if ( output || outputflag != OUTPUT_NONE )
+  if(outputflag != OUTPUT_PASSTHROUGH && (output || outputflag != OUTPUT_NONE))
     {
     while((pipe = cmsysProcess_WaitForData(cp, &data, &length, 0)) > 0)
       {
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index 9614449..9d7dae9 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -211,7 +211,7 @@ public:
    * user-viewable output from the program being run will be generated.
    * OUTPUT_MERGE is the legacy behaviour where stdout and stderr are merged
    * into stdout.  OUTPUT_NORMAL passes through the output to stdout/stderr as
-   * it was received.
+   * it was received.  OUTPUT_PASSTHROUGH passes through the original handles.
    *
    * If timeout is specified, the command will be terminated after
    * timeout expires. Timeout is specified in seconds.
@@ -230,7 +230,8 @@ public:
    {
      OUTPUT_NONE = 0,
      OUTPUT_MERGE,
-     OUTPUT_NORMAL
+     OUTPUT_NORMAL,
+     OUTPUT_PASSTHROUGH
    };
   static bool RunSingleCommand(const char* command, std::string* output = 0,
                                int* retVal = 0, const char* dir = 0,
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 77a5e43..5e911bc 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -62,7 +62,10 @@ static const char * cmDocumentationDescription[][3] =
   "  --config <cfg> = For multi-configuration tools, choose <cfg>.\n"   \
   "  --clean-first  = Build target 'clean' first, then build.\n"        \
   "                   (To clean only, use --target 'clean'.)\n"         \
-  "  --use-stderr  =  Don't merge stdout/stderr.\n"                     \
+  "  --use-stderr   = Don't merge stdout/stderr output and pass the\n"  \
+  "                   original stdout/stderr handles to the native\n"   \
+  "                   tool so it can use the capabilities of the\n"     \
+  "                   calling terminal (e.g. colored output).\n"        \
   "  --             = Pass remaining options to the native tool.\n"
 
 //----------------------------------------------------------------------------
@@ -604,7 +607,7 @@ static int do_build(int ac, char** av)
       }
     else if(strcmp(av[i], "--use-stderr") == 0)
       {
-        outputflag = cmSystemTools::OUTPUT_NORMAL;
+      outputflag = cmSystemTools::OUTPUT_PASSTHROUGH;
       }
     else if(strcmp(av[i], "--") == 0)
       {

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

Summary of changes:
 Source/CMakeVersion.cmake |    2 +-
 Source/cmSystemTools.cxx  |    8 +++++++-
 Source/cmSystemTools.h    |    5 +++--
 Source/cmakemain.cxx      |    7 +++++--
 4 files changed, 16 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list