diff options
Diffstat (limited to 'Source/cmExecProgramCommand.cxx')
-rw-r--r-- | Source/cmExecProgramCommand.cxx | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Source/cmExecProgramCommand.cxx b/Source/cmExecProgramCommand.cxx index df92592..6c271a2 100644 --- a/Source/cmExecProgramCommand.cxx +++ b/Source/cmExecProgramCommand.cxx @@ -6,6 +6,7 @@ #include <stdio.h> #include "cmMakefile.h" +#include "cmProcessOutput.h" #include "cmSystemTools.h" class cmExecutionStatus; @@ -214,17 +215,28 @@ bool cmExecProgramCommand::RunCommand(const char* command, std::string& output, int length; char* data; int p; + cmProcessOutput processOutput; + std::string strdata; while ((p = cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR), p)) { if (p == cmsysProcess_Pipe_STDOUT || p == cmsysProcess_Pipe_STDERR) { if (verbose) { - cmSystemTools::Stdout(data, length); + processOutput.DecodeText(data, length, strdata); + cmSystemTools::Stdout(strdata.c_str(), strdata.size()); } output.append(data, length); } } + if (verbose) { + processOutput.DecodeText(std::string(), strdata); + if (!strdata.empty()) { + cmSystemTools::Stdout(strdata.c_str(), strdata.size()); + } + } + // All output has been read. Wait for the process to exit. cmsysProcess_WaitForExit(cp, CM_NULLPTR); + processOutput.DecodeText(output, output); // Check the result of running the process. std::string msg; |