From b1b4d761a1991ce3634195b0b5be251ec43295c4 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 15 May 2014 10:16:48 -0400 Subject: cmCTestBuildAndTestHandler: Refactor local loop var --- Source/CTest/cmCTestBuildAndTestHandler.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index 4a3eec5..ac2196c 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -173,7 +173,6 @@ struct cmSetupOutputCaptureCleanup //---------------------------------------------------------------------- int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) { - unsigned int k; std::string cmakeOutString; cmSystemTools::SetErrorCallback(CMakeMessageCallback, &cmakeOutString); cmSystemTools::SetStdoutCallback(CMakeStdoutCallback, &cmakeOutString); @@ -369,7 +368,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) std::vector testCommand; testCommand.push_back(fullPath.c_str()); - for(k=0; k < this->TestCommandArgs.size(); ++k) + for(size_t k=0; k < this->TestCommandArgs.size(); ++k) { testCommand.push_back(this->TestCommandArgs[k].c_str()); } @@ -383,7 +382,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) cmSystemTools::ChangeDirectory(this->BuildRunDir.c_str()); } out << "Running test command: \"" << fullPath << "\""; - for(k=0; k < this->TestCommandArgs.size(); ++k) + for(size_t k=0; k < this->TestCommandArgs.size(); ++k) { out << " \"" << this->TestCommandArgs[k] << "\""; } -- cgit v0.12 From 7577a542dfa0aac045b97bfe4440241583c62e3a Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 15 May 2014 10:19:29 -0400 Subject: cmCTestBuildAndTestHandler: Refactor output capture Use an RAII class to add and remove callbacks. --- Source/CTest/cmCTestBuildAndTestHandler.cxx | 41 ++++++++++++++++------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index ac2196c..9a6b40e 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -161,28 +161,29 @@ void CMakeStdoutCallback(const char* m, int len, void* s) std::string* out = (std::string*)s; out->append(m, len); } -struct cmSetupOutputCaptureCleanup + +//---------------------------------------------------------------------- +class cmCTestBuildAndTestCaptureRAII { - ~cmSetupOutputCaptureCleanup() - { - cmSystemTools::SetErrorCallback(0, 0); + cmake& CM; +public: + cmCTestBuildAndTestCaptureRAII(cmake& cm, std::string& s): CM(cm) + { + cmSystemTools::SetErrorCallback(CMakeMessageCallback, &s); + cmSystemTools::SetStdoutCallback(CMakeStdoutCallback, &s); + this->CM.SetProgressCallback(CMakeProgressCallback, &s); + } + ~cmCTestBuildAndTestCaptureRAII() + { + this->CM.SetProgressCallback(0, 0); cmSystemTools::SetStdoutCallback(0, 0); - } + cmSystemTools::SetErrorCallback(0, 0); + } }; //---------------------------------------------------------------------- int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) { - std::string cmakeOutString; - cmSystemTools::SetErrorCallback(CMakeMessageCallback, &cmakeOutString); - cmSystemTools::SetStdoutCallback(CMakeStdoutCallback, &cmakeOutString); - // make sure SetStdoutCallback and SetErrorCallback are set to null - // after this function exits so that they do not point at a destroyed - // string cmakeOutString - cmSetupOutputCaptureCleanup cleanup; - static_cast(cleanup); - cmOStringStream out; - // if the generator and make program are not specified then it is an error if (!this->BuildGenerator.size()) { @@ -196,6 +197,12 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) return 1; } + cmake cm; + std::string cmakeOutString; + cmCTestBuildAndTestCaptureRAII captureRAII(cm, cmakeOutString); + static_cast(captureRAII); + cmOStringStream out; + if ( this->CTest->GetConfigType().size() == 0 && this->ConfigSample.size()) { @@ -232,10 +239,6 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) } cmSystemTools::ChangeDirectory(this->BinaryDir.c_str()); - // should we cmake? - cmake cm; - cm.SetProgressCallback(CMakeProgressCallback, &cmakeOutString); - if(this->BuildNoCMake) { // Make the generator available for the Build call below. -- cgit v0.12 From 73b13f56413cac74d90a2ab1938add3bbe740ecb Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 15 May 2014 09:38:30 -0400 Subject: cmSystemTools: Rename ErrorCallback to MessageCallback Clarify that it is the callback for the cmSystemTools::Message API. Rename callback clients too. --- Source/CTest/cmCTestBuildAndTestHandler.cxx | 4 ++-- Source/CursesDialog/ccmake.cxx | 5 +++-- Source/QtDialog/QCMake.cxx | 6 +++--- Source/QtDialog/QCMake.h | 4 ++-- Source/cmSystemTools.cxx | 17 ++++++++--------- Source/cmSystemTools.h | 8 ++++---- Source/cmakemain.cxx | 6 +++--- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index 9a6b40e..6756dbf 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -169,7 +169,7 @@ class cmCTestBuildAndTestCaptureRAII public: cmCTestBuildAndTestCaptureRAII(cmake& cm, std::string& s): CM(cm) { - cmSystemTools::SetErrorCallback(CMakeMessageCallback, &s); + cmSystemTools::SetMessageCallback(CMakeMessageCallback, &s); cmSystemTools::SetStdoutCallback(CMakeStdoutCallback, &s); this->CM.SetProgressCallback(CMakeProgressCallback, &s); } @@ -177,7 +177,7 @@ public: { this->CM.SetProgressCallback(0, 0); cmSystemTools::SetStdoutCallback(0, 0); - cmSystemTools::SetErrorCallback(0, 0); + cmSystemTools::SetMessageCallback(0, 0); } }; diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx index 2d1ef5c..d70bedb 100644 --- a/Source/CursesDialog/ccmake.cxx +++ b/Source/CursesDialog/ccmake.cxx @@ -73,7 +73,8 @@ void onsig(int) } -void CMakeErrorHandler(const char* message, const char* title, bool&, void* clientData) +void CMakeMessageHandler(const char* message, const char* title, bool&, + void* clientData) { cmCursesForm* self = static_cast( clientData ); self->AddError(message, title); @@ -171,7 +172,7 @@ int main(int argc, char const* const* argv) return 1; } - cmSystemTools::SetErrorCallback(CMakeErrorHandler, myform); + cmSystemTools::SetMessageCallback(CMakeMessageHandler, myform); cmCursesForm::CurrentForm = myform; diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 5f9ebaf..f2a23bb 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -35,7 +35,7 @@ QCMake::QCMake(QObject* p) cmSystemTools::DisableRunCommandOutput(); cmSystemTools::SetRunCommandHideConsole(true); - cmSystemTools::SetErrorCallback(QCMake::errorCallback, this); + cmSystemTools::SetMessageCallback(QCMake::messageCallback, this); this->CMakeInstance = new cmake; this->CMakeInstance->SetCMakeEditCommand( @@ -348,8 +348,8 @@ void QCMake::progressCallback(const char* msg, float percent, void* cd) QCoreApplication::processEvents(); } -void QCMake::errorCallback(const char* msg, const char* /*title*/, - bool& /*stop*/, void* cd) +void QCMake::messageCallback(const char* msg, const char* /*title*/, + bool& /*stop*/, void* cd) { QCMake* self = reinterpret_cast(cd); emit self->errorMessage(QString::fromLocal8Bit(msg)); diff --git a/Source/QtDialog/QCMake.h b/Source/QtDialog/QCMake.h index 93ac8ab..8e71ea5 100644 --- a/Source/QtDialog/QCMake.h +++ b/Source/QtDialog/QCMake.h @@ -136,8 +136,8 @@ protected: static bool interruptCallback(void*); static void progressCallback(const char* msg, float percent, void* cd); - static void errorCallback(const char* msg, const char* title, - bool&, void* cd); + static void messageCallback(const char* msg, const char* title, + bool&, void* cd); bool SuppressDevWarnings; bool WarnUninitializedMode; bool WarnUnusedMode; diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index c38a99c..f61d75d 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -121,10 +121,9 @@ bool cmSystemTools::s_FatalErrorOccured = false; bool cmSystemTools::s_DisableMessages = false; bool cmSystemTools::s_ForceUnixPaths = false; -void (*cmSystemTools::s_ErrorCallback)(const char*, const char*, - bool&, void*); +cmSystemTools::MessageCallback cmSystemTools::s_MessageCallback; void (*cmSystemTools::s_StdoutCallback)(const char*, int len, void*); -void* cmSystemTools::s_ErrorCallbackClientData = 0; +void* cmSystemTools::s_MessageCallbackClientData; void* cmSystemTools::s_StdoutCallbackClientData = 0; bool (*cmSystemTools::s_InterruptCallback)(void*); void* cmSystemTools::s_InterruptCallbackClientData = 0; @@ -254,10 +253,10 @@ bool cmSystemTools::GetInterruptFlag() return false; } -void cmSystemTools::SetErrorCallback(ErrorCallback f, void* clientData) +void cmSystemTools::SetMessageCallback(MessageCallback f, void* clientData) { - s_ErrorCallback = f; - s_ErrorCallbackClientData = clientData; + s_MessageCallback = f; + s_MessageCallbackClientData = clientData; } void cmSystemTools::SetStdoutCallback(StdoutCallback f, void* clientData) @@ -305,10 +304,10 @@ void cmSystemTools::Message(const char* m1, const char *title) { return; } - if(s_ErrorCallback) + if(s_MessageCallback) { - (*s_ErrorCallback)(m1, title, s_DisableMessages, - s_ErrorCallbackClientData); + (*s_MessageCallback)(m1, title, s_DisableMessages, + s_MessageCallbackClientData); return; } else diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 27b4bce..979551c 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -57,14 +57,14 @@ public: */ static std::string TrimWhitespace(const std::string& s); - typedef void (*ErrorCallback)(const char*, const char*, bool&, void*); + typedef void (*MessageCallback)(const char*, const char*, bool&, void*); /** * Set the function used by GUIs to display error messages * Function gets passed: message as a const char*, * title as a const char*, and a reference to bool that when * set to false, will disable furthur messages (cancel). */ - static void SetErrorCallback(ErrorCallback f, void* clientData=0); + static void SetMessageCallback(MessageCallback f, void* clientData=0); /** * Display an error message. @@ -470,10 +470,10 @@ private: static bool s_FatalErrorOccured; static bool s_DisableMessages; static bool s_DisableRunCommandOutput; - static ErrorCallback s_ErrorCallback; + static MessageCallback s_MessageCallback; static StdoutCallback s_StdoutCallback; static InterruptCallback s_InterruptCallback; - static void* s_ErrorCallbackClientData; + static void* s_MessageCallbackClientData; static void* s_StdoutCallbackClientData; static void* s_InterruptCallbackClientData; }; diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index fcaa127..77f1e4e 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -129,8 +129,8 @@ static std::string cmakemainGetStack(void *clientdata) return msg; } -static void cmakemainErrorCallback(const char* m, const char*, bool&, - void *clientdata) +static void cmakemainMessageCallback(const char* m, const char*, bool&, + void *clientdata) { std::cerr << m << cmakemainGetStack(clientdata) << std::endl << std::flush; } @@ -310,7 +310,7 @@ int do_cmake(int ac, char const* const* av) return ret; } cmake cm; - cmSystemTools::SetErrorCallback(cmakemainErrorCallback, (void *)&cm); + cmSystemTools::SetMessageCallback(cmakemainMessageCallback, (void *)&cm); cm.SetProgressCallback(cmakemainProgressCallback, (void *)&cm); cm.SetWorkingMode(workingMode); -- cgit v0.12 From a9ae1d7a605333f0dea6d709e27a177b19f8c2ae Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 15 May 2014 09:40:03 -0400 Subject: cmSystemTools: Simplify InterruptCallback definition Use the typedef to declare the member instead of duplicating the type. Use default initialization instead of an explicit zero initializer. --- Source/cmSystemTools.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index f61d75d..0289430 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -122,11 +122,11 @@ bool cmSystemTools::s_DisableMessages = false; bool cmSystemTools::s_ForceUnixPaths = false; cmSystemTools::MessageCallback cmSystemTools::s_MessageCallback; +cmSystemTools::InterruptCallback cmSystemTools::s_InterruptCallback; void (*cmSystemTools::s_StdoutCallback)(const char*, int len, void*); void* cmSystemTools::s_MessageCallbackClientData; void* cmSystemTools::s_StdoutCallbackClientData = 0; -bool (*cmSystemTools::s_InterruptCallback)(void*); -void* cmSystemTools::s_InterruptCallbackClientData = 0; +void* cmSystemTools::s_InterruptCallbackClientData; // replace replace with with as many times as it shows up in source. // write the result into source. -- cgit v0.12 From f52b5ae3c4a87723f90f63249a979424aaf99407 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 15 May 2014 09:44:25 -0400 Subject: cmSystemTools: Add callback for Stderr Factor a common callback type out of StdoutCallback. Add an equivalent StderrCallback. While at it, use "size_t" for the data length instead of "int". Teach "ctest --build-and-test" to capture the Stderr callback because output sent through it is part of the logical CMake process output. --- Source/CTest/cmCTestBuildAndTestHandler.cxx | 6 +++-- Source/cmSystemTools.cxx | 39 ++++++++++++++++++----------- Source/cmSystemTools.h | 17 ++++++++----- 3 files changed, 40 insertions(+), 22 deletions(-) diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index 6756dbf..b4818be 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -156,7 +156,7 @@ void CMakeProgressCallback(const char*msg, float , void * s) } //---------------------------------------------------------------------- -void CMakeStdoutCallback(const char* m, int len, void* s) +void CMakeOutputCallback(const char* m, size_t len, void* s) { std::string* out = (std::string*)s; out->append(m, len); @@ -170,12 +170,14 @@ public: cmCTestBuildAndTestCaptureRAII(cmake& cm, std::string& s): CM(cm) { cmSystemTools::SetMessageCallback(CMakeMessageCallback, &s); - cmSystemTools::SetStdoutCallback(CMakeStdoutCallback, &s); + cmSystemTools::SetStdoutCallback(CMakeOutputCallback, &s); + cmSystemTools::SetStderrCallback(CMakeOutputCallback, &s); this->CM.SetProgressCallback(CMakeProgressCallback, &s); } ~cmCTestBuildAndTestCaptureRAII() { this->CM.SetProgressCallback(0, 0); + cmSystemTools::SetStderrCallback(0, 0); cmSystemTools::SetStdoutCallback(0, 0); cmSystemTools::SetMessageCallback(0, 0); } diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 0289430..2e417cb 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -122,10 +122,12 @@ bool cmSystemTools::s_DisableMessages = false; bool cmSystemTools::s_ForceUnixPaths = false; cmSystemTools::MessageCallback cmSystemTools::s_MessageCallback; +cmSystemTools::OutputCallback cmSystemTools::s_StdoutCallback; +cmSystemTools::OutputCallback cmSystemTools::s_StderrCallback; cmSystemTools::InterruptCallback cmSystemTools::s_InterruptCallback; -void (*cmSystemTools::s_StdoutCallback)(const char*, int len, void*); void* cmSystemTools::s_MessageCallbackClientData; -void* cmSystemTools::s_StdoutCallbackClientData = 0; +void* cmSystemTools::s_StdoutCallbackClientData; +void* cmSystemTools::s_StderrCallbackClientData; void* cmSystemTools::s_InterruptCallbackClientData; // replace replace with with as many times as it shows up in source. @@ -259,33 +261,42 @@ void cmSystemTools::SetMessageCallback(MessageCallback f, void* clientData) s_MessageCallbackClientData = clientData; } -void cmSystemTools::SetStdoutCallback(StdoutCallback f, void* clientData) +void cmSystemTools::SetStdoutCallback(OutputCallback f, void* clientData) { s_StdoutCallback = f; s_StdoutCallbackClientData = clientData; } +void cmSystemTools::SetStderrCallback(OutputCallback f, void* clientData) +{ + s_StderrCallback = f; + s_StderrCallbackClientData = clientData; +} + void cmSystemTools::Stdout(const char* s) { - if(s_StdoutCallback) + cmSystemTools::Stdout(s, strlen(s)); +} + +void cmSystemTools::Stderr(const char* s) +{ + cmSystemTools::Stderr(s, strlen(s)); +} + +void cmSystemTools::Stderr(const char* s, size_t length) +{ + if(s_StderrCallback) { - (*s_StdoutCallback)(s, static_cast(strlen(s)), - s_StdoutCallbackClientData); + (*s_StderrCallback)(s, length, s_StderrCallbackClientData); } else { - std::cout << s; - std::cout.flush(); - } -} - -void cmSystemTools::Stderr(const char* s, int length) -{ std::cerr.write(s, length); std::cerr.flush(); + } } -void cmSystemTools::Stdout(const char* s, int length) +void cmSystemTools::Stdout(const char* s, size_t length) { if(s_StdoutCallback) { diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 979551c..4455dd1 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -77,14 +77,17 @@ public: */ static void Message(const char* m, const char* title=0); + typedef void (*OutputCallback)(const char*, size_t length, void*); + ///! Send a string to stdout static void Stdout(const char* s); - static void Stdout(const char* s, int length); - typedef void (*StdoutCallback)(const char*, int length, void*); - static void SetStdoutCallback(StdoutCallback, void* clientData=0); + static void Stdout(const char* s, size_t length); + static void SetStdoutCallback(OutputCallback, void* clientData=0); - ///! Send a string to stderr. Stdout callbacks will not be invoced. - static void Stderr(const char* s, int length); + ///! Send a string to stderr + static void Stderr(const char* s); + static void Stderr(const char* s, size_t length); + static void SetStderrCallback(OutputCallback, void* clientData=0); typedef bool (*InterruptCallback)(void*); @@ -471,10 +474,12 @@ private: static bool s_DisableMessages; static bool s_DisableRunCommandOutput; static MessageCallback s_MessageCallback; - static StdoutCallback s_StdoutCallback; + static OutputCallback s_StdoutCallback; + static OutputCallback s_StderrCallback; static InterruptCallback s_InterruptCallback; static void* s_MessageCallbackClientData; static void* s_StdoutCallbackClientData; + static void* s_StderrCallbackClientData; static void* s_InterruptCallbackClientData; }; -- cgit v0.12 From 92ddf0c9e20af6158d84db34eeba795061fad1e9 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 15 May 2014 09:47:25 -0400 Subject: cmake-gui: Capture cmSystemTools::Stdout and Stderr Output sent through these APIs is logically part of the CMake process output. Capture it with callbacks and display it in the cmake-gui output window along with other messages. --- Source/QtDialog/QCMake.cxx | 16 ++++++++++++++++ Source/QtDialog/QCMake.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index f2a23bb..b833648 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -36,6 +36,8 @@ QCMake::QCMake(QObject* p) cmSystemTools::DisableRunCommandOutput(); cmSystemTools::SetRunCommandHideConsole(true); cmSystemTools::SetMessageCallback(QCMake::messageCallback, this); + cmSystemTools::SetStdoutCallback(QCMake::stdoutCallback, this); + cmSystemTools::SetStderrCallback(QCMake::stderrCallback, this); this->CMakeInstance = new cmake; this->CMakeInstance->SetCMakeEditCommand( @@ -356,6 +358,20 @@ void QCMake::messageCallback(const char* msg, const char* /*title*/, QCoreApplication::processEvents(); } +void QCMake::stdoutCallback(const char* msg, size_t len, void* cd) +{ + QCMake* self = reinterpret_cast(cd); + emit self->outputMessage(QString::fromLocal8Bit(msg,int(len))); + QCoreApplication::processEvents(); +} + +void QCMake::stderrCallback(const char* msg, size_t len, void* cd) +{ + QCMake* self = reinterpret_cast(cd); + emit self->outputMessage(QString::fromLocal8Bit(msg,int(len))); + QCoreApplication::processEvents(); +} + QString QCMake::binaryDirectory() const { return this->BinaryDirectory; diff --git a/Source/QtDialog/QCMake.h b/Source/QtDialog/QCMake.h index 8e71ea5..bd82f0d 100644 --- a/Source/QtDialog/QCMake.h +++ b/Source/QtDialog/QCMake.h @@ -138,6 +138,8 @@ protected: static void progressCallback(const char* msg, float percent, void* cd); static void messageCallback(const char* msg, const char* title, bool&, void* cd); + static void stdoutCallback(const char* msg, size_t len, void* cd); + static void stderrCallback(const char* msg, size_t len, void* cd); bool SuppressDevWarnings; bool WarnUninitializedMode; bool WarnUnusedMode; -- cgit v0.12 From d7c692466bf100b077ffd0eef3a51fe1316782f0 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 15 May 2014 09:48:39 -0400 Subject: execute_process: Send stderr through cmSystemTools::Stderr Give cmake-gui and ctest --build-and-test a chance to capture the output instead of sending it to the real stderr. --- Source/cmExecuteProcessCommand.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx index 40f70b8..11f8ae5 100644 --- a/Source/cmExecuteProcessCommand.cxx +++ b/Source/cmExecuteProcessCommand.cxx @@ -256,10 +256,6 @@ bool cmExecuteProcessCommand // Check the output variables. bool merge_output = (output_variable == error_variable); - if(error_variable.empty() && !error_quiet) - { - cmsysProcess_SetPipeShared(cp, cmsysProcess_Pipe_STDERR, 1); - } if(!input_file.empty()) { cmsysProcess_SetPipeFile(cp, cmsysProcess_Pipe_STDIN, input_file.c_str()); @@ -307,7 +303,11 @@ bool cmExecuteProcessCommand } else if(p == cmsysProcess_Pipe_STDERR && !error_quiet) { - if(!error_variable.empty()) + if(error_variable.empty()) + { + cmSystemTools::Stderr(data, length); + } + else { cmExecuteProcessCommandAppend(tempError, data, length); } -- cgit v0.12 From 209cd475ebf492616ec21cf55c7557e090c2a18f Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 15 May 2014 11:10:52 -0400 Subject: Help: Add notes for topic 'cmake-gui-capture-output' --- Help/release/dev/cmake-gui-capture-output.rst | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Help/release/dev/cmake-gui-capture-output.rst diff --git a/Help/release/dev/cmake-gui-capture-output.rst b/Help/release/dev/cmake-gui-capture-output.rst new file mode 100644 index 0000000..40cd25e --- /dev/null +++ b/Help/release/dev/cmake-gui-capture-output.rst @@ -0,0 +1,6 @@ +cmake-gui-capture-output +------------------------ + +* The :manual:`cmake-gui(1)` learned to capture output from child + processes started by the :command:`execute_process` command + and display it in the output window. -- cgit v0.12