File indexing completed on 2024-05-05 04:40:21

0001 /*
0002     SPDX-FileCopyrightText: 2010 Milian Wolff <mail@milianw.de>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 
0008 #ifndef QMAKEJOB_H
0009 #define QMAKEJOB_H
0010 
0011 #include <outputview/outputjob.h>
0012 
0013 #include <QProcess>
0014 
0015 namespace KDevelop {
0016 class OutputModel;
0017 }
0018 
0019 class QProcess;
0020 class QMakeJob : public KDevelop::OutputJob
0021 {
0022     Q_OBJECT
0023 
0024 public:
0025     QMakeJob( QString  srcDir, QString buildDir, QObject* parent = nullptr );
0026     void start() override;
0027     ~QMakeJob() override;
0028     void setQMakePath(const QString& path);
0029     void setInstallPrefix(const QString& prefix);
0030     void setBuildType(int comboboxSelectedIndex); // --> qmakebuilddirchooser.ui
0031     void setExtraArguments(const QString& args);
0032     
0033 
0034     QString errorString() const override;
0035 
0036 protected:
0037     bool doKill() override;
0038 
0039 private Q_SLOTS:
0040   void processError( QProcess::ProcessError error );
0041   void processFinished( int exitCode, QProcess::ExitStatus status );
0042 
0043 private:
0044     QString m_srcDir;
0045     QString m_buildDir;
0046     QString m_qmakePath;
0047     QString m_installPrefix;
0048     int m_buildType;
0049     QString m_extraArguments;
0050     QProcess* m_process;
0051     KDevelop::OutputModel* m_model;
0052 };
0053 
0054 #endif // QMAKEJOB_H