diff options
author | Patrick Gansterer <paroga@paroga.com> | 2013-07-29 06:52:54 (GMT) |
---|---|---|
committer | Patrick Gansterer <paroga@paroga.com> | 2013-07-29 06:52:54 (GMT) |
commit | 2b473d2eaa2d09a69fc5a4f37d24ad051d5ead9a (patch) | |
tree | c310b0bd0e73d2ad99f3b7fd027c213e4dbbc80a /Source/cmSystemTools.cxx | |
parent | fc1708ac99ead110417911609a2b67d4deae9d34 (diff) | |
download | CMake-2b473d2eaa2d09a69fc5a4f37d24ad051d5ead9a.zip CMake-2b473d2eaa2d09a69fc5a4f37d24ad051d5ead9a.tar.gz CMake-2b473d2eaa2d09a69fc5a4f37d24ad051d5ead9a.tar.bz2 |
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.
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
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) { |