2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2019-06-05 18:09:02 +02:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2020-04-16 13:53:05 +02:00
|
|
|
#include <utils/outputformatter.h>
|
2019-06-05 18:09:02 +02:00
|
|
|
|
2020-02-28 12:44:00 +01:00
|
|
|
#include <QElapsedTimer>
|
2022-05-14 02:27:28 +02:00
|
|
|
#include <QFutureInterface>
|
2020-04-17 15:30:05 +02:00
|
|
|
#include <QObject>
|
|
|
|
|
#include <QStringList>
|
2019-06-05 18:09:02 +02:00
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
2022-05-13 18:22:03 +02:00
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
template<class T>
|
2022-05-14 02:27:28 +02:00
|
|
|
class QFutureWatcher;
|
2022-05-13 18:22:03 +02:00
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
|
|
namespace Utils {
|
|
|
|
|
class ProcessResultData;
|
|
|
|
|
class QtcProcess;
|
|
|
|
|
}
|
2022-03-02 04:12:25 +01:00
|
|
|
|
2022-09-29 15:26:31 +02:00
|
|
|
namespace CMakeProjectManager::Internal {
|
2019-06-05 18:09:02 +02:00
|
|
|
|
2022-05-14 02:27:28 +02:00
|
|
|
class BuildDirParameters;
|
|
|
|
|
|
2021-06-08 13:40:45 +02:00
|
|
|
class CMakeProcess : public QObject
|
|
|
|
|
{
|
2019-06-05 18:09:02 +02:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
CMakeProcess();
|
|
|
|
|
~CMakeProcess();
|
|
|
|
|
|
|
|
|
|
void run(const BuildDirParameters ¶meters, const QStringList &arguments);
|
2022-05-13 18:22:03 +02:00
|
|
|
void stop();
|
2019-06-05 18:09:02 +02:00
|
|
|
|
2020-09-28 15:10:04 +02:00
|
|
|
int lastExitCode() const { return m_lastExitCode; }
|
2021-05-28 14:48:25 +02:00
|
|
|
|
2019-06-05 18:09:02 +02:00
|
|
|
signals:
|
|
|
|
|
void started();
|
2021-06-08 13:40:45 +02:00
|
|
|
void finished();
|
2019-06-05 18:09:02 +02:00
|
|
|
|
|
|
|
|
private:
|
2022-05-13 18:22:03 +02:00
|
|
|
void handleProcessDone(const Utils::ProcessResultData &resultData);
|
2019-06-05 18:09:02 +02:00
|
|
|
|
|
|
|
|
std::unique_ptr<Utils::QtcProcess> m_process;
|
2020-04-16 13:53:05 +02:00
|
|
|
Utils::OutputFormatter m_parser;
|
2022-05-14 02:27:28 +02:00
|
|
|
QFutureInterface<void> m_futureInterface;
|
|
|
|
|
std::unique_ptr<QFutureWatcher<void>> m_futureWatcher;
|
2020-02-28 12:44:00 +01:00
|
|
|
QElapsedTimer m_elapsed;
|
2020-09-28 15:10:04 +02:00
|
|
|
int m_lastExitCode = 0;
|
2019-06-05 18:09:02 +02:00
|
|
|
};
|
|
|
|
|
|
2022-09-29 15:26:31 +02:00
|
|
|
} // CMakeProjectManager::Internal
|