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.
This commit is contained in:
parent
f52b5ae3c4
commit
92ddf0c9e2
|
@ -36,6 +36,8 @@ QCMake::QCMake(QObject* p)
|
||||||
cmSystemTools::DisableRunCommandOutput();
|
cmSystemTools::DisableRunCommandOutput();
|
||||||
cmSystemTools::SetRunCommandHideConsole(true);
|
cmSystemTools::SetRunCommandHideConsole(true);
|
||||||
cmSystemTools::SetMessageCallback(QCMake::messageCallback, this);
|
cmSystemTools::SetMessageCallback(QCMake::messageCallback, this);
|
||||||
|
cmSystemTools::SetStdoutCallback(QCMake::stdoutCallback, this);
|
||||||
|
cmSystemTools::SetStderrCallback(QCMake::stderrCallback, this);
|
||||||
|
|
||||||
this->CMakeInstance = new cmake;
|
this->CMakeInstance = new cmake;
|
||||||
this->CMakeInstance->SetCMakeEditCommand(
|
this->CMakeInstance->SetCMakeEditCommand(
|
||||||
|
@ -356,6 +358,20 @@ void QCMake::messageCallback(const char* msg, const char* /*title*/,
|
||||||
QCoreApplication::processEvents();
|
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
|
QString QCMake::binaryDirectory() const
|
||||||
{
|
{
|
||||||
return this->BinaryDirectory;
|
return this->BinaryDirectory;
|
||||||
|
|
|
@ -138,6 +138,8 @@ protected:
|
||||||
static void progressCallback(const char* msg, float percent, void* cd);
|
static void progressCallback(const char* msg, float percent, void* cd);
|
||||||
static void messageCallback(const char* msg, const char* title,
|
static void messageCallback(const char* msg, const char* title,
|
||||||
bool&, void* cd);
|
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 SuppressDevWarnings;
|
||||||
bool WarnUninitializedMode;
|
bool WarnUninitializedMode;
|
||||||
bool WarnUnusedMode;
|
bool WarnUnusedMode;
|
||||||
|
|
Loading…
Reference in New Issue