2019-06-05 18:09:02 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator.
|
|
|
|
|
**
|
|
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
|
|
|
|
**
|
|
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "builddirparameters.h"
|
|
|
|
|
|
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>
|
2020-04-17 15:30:05 +02:00
|
|
|
#include <QObject>
|
|
|
|
|
#include <QStringList>
|
2019-06-14 16:42:41 +02:00
|
|
|
#include <QTimer>
|
2019-06-05 18:09:02 +02:00
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
2022-05-13 18:22:03 +02:00
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
template<class T>
|
|
|
|
|
class QFutureInterface;
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
|
|
namespace Utils {
|
|
|
|
|
class ProcessResultData;
|
|
|
|
|
class QtcProcess;
|
|
|
|
|
}
|
2022-03-02 04:12:25 +01:00
|
|
|
|
2019-06-05 18:09:02 +02:00
|
|
|
namespace CMakeProjectManager {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
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-14 16:42:41 +02:00
|
|
|
void checkForCancelled();
|
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;
|
2019-06-05 18:09:02 +02:00
|
|
|
std::unique_ptr<QFutureInterface<void>> m_future;
|
2019-06-14 16:42:41 +02:00
|
|
|
bool m_processWasCanceled = false;
|
|
|
|
|
QTimer m_cancelTimer;
|
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
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace CMakeProjectManager
|