diff options
author | Johan Björk <phb@spotify.com> | 2011-07-26 07:36:40 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2011-07-28 14:43:09 (GMT) |
commit | 642f10066a5c9b33e8736b9ca013a44023c21b2c (patch) | |
tree | c6e63fd944f9e04b588009c67148d75ca5b3b5d0 /Source/cmSystemTools.cxx | |
parent | 856a9e499f299a33cb4f763bf36a75524a03e4f5 (diff) | |
download | CMake-642f10066a5c9b33e8736b9ca013a44023c21b2c.zip CMake-642f10066a5c9b33e8736b9ca013a44023c21b2c.tar.gz CMake-642f10066a5c9b33e8736b9ca013a44023c21b2c.tar.bz2 |
RunSingleCommand: Add a OUTPUT_NORMAL flag.
OUTPUT_NORMAL does no processing of the output streams, it just passes
them through the same streams as they were received on.
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index ba620d1..1971610 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -247,6 +247,12 @@ void cmSystemTools::Stdout(const char* s) } } +void cmSystemTools::Stderr(const char* s, int length) +{ + std::cerr.write(s, length); + std::cerr.flush(); +} + void cmSystemTools::Stdout(const char* s, int length) { if(s_StdoutCallback) @@ -630,7 +636,21 @@ bool cmSystemTools::RunSingleCommand(std::vector<cmStdString>const& command, } if(outputflag != OUTPUT_NONE) { - cmSystemTools::Stdout(data, length); + if(outputflag == OUTPUT_MERGE) + { + cmSystemTools::Stdout(data, length); + } + else + { + if(pipe == cmsysProcess_Pipe_STDERR) + { + cmSystemTools::Stderr(data, length); + } + else if(pipe == cmsysProcess_Pipe_STDOUT) + { + cmSystemTools::Stdout(data, length); + } + } } } } |