2013-07-10 21:43:49 +03:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 Axonian LLC.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2013-07-10 21:43:49 +03:00
|
|
|
**
|
|
|
|
|
** 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
|
2016-01-15 14:57:40 +01:00
|
|
|
** 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.
|
2013-07-10 21:43:49 +03:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** 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.
|
2013-07-10 21:43:49 +03:00
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
2016-01-27 10:14:00 +01:00
|
|
|
#pragma once
|
2013-07-10 21:43:49 +03:00
|
|
|
|
2017-02-23 11:32:27 +01:00
|
|
|
#include "cmake_global.h"
|
|
|
|
|
|
2013-07-10 21:43:49 +03:00
|
|
|
#include <projectexplorer/ioutputparser.h>
|
|
|
|
|
#include <projectexplorer/task.h>
|
|
|
|
|
|
2019-07-24 17:37:58 +02:00
|
|
|
#include <QDir>
|
2017-03-09 23:02:32 +01:00
|
|
|
#include <QRegExp>
|
2016-02-10 16:20:13 +01:00
|
|
|
#include <QRegularExpression>
|
|
|
|
|
|
2013-07-10 21:43:49 +03:00
|
|
|
namespace CMakeProjectManager {
|
|
|
|
|
|
2017-02-23 11:32:27 +01:00
|
|
|
class CMAKE_EXPORT CMakeParser : public ProjectExplorer::IOutputParser
|
2013-07-10 21:43:49 +03:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
explicit CMakeParser();
|
2019-07-24 17:37:58 +02:00
|
|
|
void setSourceDirectory(const QString &sourceDir);
|
2016-01-07 15:22:53 +01:00
|
|
|
void stdError(const QString &line) override;
|
2013-07-10 21:43:49 +03:00
|
|
|
|
|
|
|
|
protected:
|
2016-01-07 15:22:53 +01:00
|
|
|
void doFlush() override;
|
2013-07-10 21:43:49 +03:00
|
|
|
|
|
|
|
|
private:
|
2016-02-10 16:20:13 +01:00
|
|
|
enum TripleLineError { NONE, LINE_LOCATION, LINE_DESCRIPTION, LINE_DESCRIPTION2 };
|
|
|
|
|
|
|
|
|
|
TripleLineError m_expectTripleLineErrorData = NONE;
|
|
|
|
|
|
2019-07-24 17:37:58 +02:00
|
|
|
Utils::optional<QDir> m_sourceDirectory;
|
2013-07-10 21:43:49 +03:00
|
|
|
ProjectExplorer::Task m_lastTask;
|
|
|
|
|
QRegExp m_commonError;
|
|
|
|
|
QRegExp m_nextSubError;
|
2016-02-10 16:20:13 +01:00
|
|
|
QRegularExpression m_locationLine;
|
2016-01-07 15:22:53 +01:00
|
|
|
bool m_skippedFirstEmptyLine = false;
|
2015-04-20 17:13:45 +02:00
|
|
|
int m_lines = 0;
|
2013-07-10 21:43:49 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace CMakeProjectManager
|