CMake: Duplicate CMake output in Projects mode

There is some space on the right side there, and in Projects mode it is
nice to have the output directly visible without opening the General
Messages pane (without intermangling with other output there).
This is a first step that duplicates the output in a very simple manner.

Fixes: QTCREATORBUG-25522
Change-Id: Id53b21d629b1f1bbc46ebf3d38bcec1fd83a6360
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Eike Ziller
2021-06-01 16:21:03 +02:00
parent dcbf26490d
commit 3c9da87f33
7 changed files with 64 additions and 20 deletions

View File

@@ -27,9 +27,9 @@
#include "cmakeparser.h"
#include <coreplugin/messagemanager.h>
#include <coreplugin/progressmanager/progressmanager.h>
#include <coreplugin/reaper.h>
#include <projectexplorer/buildsystem.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/taskhub.h>
@@ -117,7 +117,7 @@ void CMakeProcess::run(const BuildDirParameters &parameters, const QStringList &
TaskHub::clearTasks(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM);
Core::MessageManager::writeFlashing(
BuildSystem::startNewBuildSystemOutput(
tr("Running %1 in %2.").arg(commandLine.toUserOutput()).arg(workDirectory.toUserOutput()));
auto future = std::make_unique<QFutureInterface<void>>();
@@ -168,7 +168,7 @@ void CMakeProcess::processStandardOutput()
static QString rest;
rest = lineSplit(rest, m_process->readAllStandardOutput(), [](const QString &s) {
Core::MessageManager::writeSilently(s);
BuildSystem::appendBuildSystemOutput(s);
});
}
@@ -179,7 +179,7 @@ void CMakeProcess::processStandardError()
static QString rest;
rest = lineSplit(rest, m_process->readAllStandardError(), [this](const QString &s) {
m_parser.appendMessage(s + '\n', Utils::StdErrFormat);
Core::MessageManager::writeSilently(s);
BuildSystem::appendBuildSystemOutput(s);
});
}
@@ -205,7 +205,7 @@ void CMakeProcess::handleProcessFinished(int code, QProcess::ExitStatus status)
m_lastExitCode = code;
if (!msg.isEmpty()) {
Core::MessageManager::writeSilently(msg);
BuildSystem::appendBuildSystemOutput(msg);
TaskHub::addTask(BuildSystemTask(Task::Error, msg));
m_future->reportCanceled();
} else {
@@ -217,7 +217,7 @@ void CMakeProcess::handleProcessFinished(int code, QProcess::ExitStatus status)
emit finished(code, status);
const QString elapsedTime = Utils::formatElapsedTime(m_elapsed.elapsed());
Core::MessageManager::writeSilently(elapsedTime);
BuildSystem::appendBuildSystemOutput(elapsedTime);
}
void CMakeProcess::checkForCancelled()