summaryrefslogtreecommitdiffstats
path: root/Source/QtDialog/QCMake.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-05-15 13:47:25 (GMT)
committerBrad King <brad.king@kitware.com>2014-05-15 14:28:42 (GMT)
commit92ddf0c9e20af6158d84db34eeba795061fad1e9 (patch)
treedac89570ff97e1b18cb2853ff38b0ee545005460 /Source/QtDialog/QCMake.cxx
parentf52b5ae3c4a87723f90f63249a979424aaf99407 (diff)
downloadCMake-92ddf0c9e20af6158d84db34eeba795061fad1e9.zip
CMake-92ddf0c9e20af6158d84db34eeba795061fad1e9.tar.gz
CMake-92ddf0c9e20af6158d84db34eeba795061fad1e9.tar.bz2
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.
Diffstat (limited to 'Source/QtDialog/QCMake.cxx')
-rw-r--r--Source/QtDialog/QCMake.cxx16
1 files changed, 16 insertions, 0 deletions
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<QCMake*>(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<QCMake*>(cd);
+ emit self->outputMessage(QString::fromLocal8Bit(msg,int(len)));
+ QCoreApplication::processEvents();
+}
+
QString QCMake::binaryDirectory() const
{
return this->BinaryDirectory;