2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 Axonian LLC.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
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>
|
|
|
|
|
|
2022-09-30 17:21:09 +02:00
|
|
|
#include <utils/filepath.h>
|
|
|
|
|
|
2016-02-10 16:20:13 +01:00
|
|
|
#include <QRegularExpression>
|
|
|
|
|
|
2022-08-26 10:30:00 +02:00
|
|
|
#include <optional>
|
|
|
|
|
|
2013-07-10 21:43:49 +03:00
|
|
|
namespace CMakeProjectManager {
|
|
|
|
|
|
2020-04-15 14:59:51 +02:00
|
|
|
class CMAKE_EXPORT CMakeParser : public ProjectExplorer::OutputTaskParser
|
2013-07-10 21:43:49 +03:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
explicit CMakeParser();
|
2022-09-30 17:21:09 +02:00
|
|
|
void setSourceDirectory(const Utils::FilePath &sourceDir);
|
2013-07-10 21:43:49 +03:00
|
|
|
|
2020-04-08 09:42:51 +02:00
|
|
|
private:
|
2020-04-16 13:53:05 +02:00
|
|
|
Result handleLine(const QString &line, Utils::OutputFormat type) override;
|
2020-04-15 14:59:51 +02:00
|
|
|
void flush() override;
|
2022-09-30 17:21:09 +02:00
|
|
|
Utils::FilePath resolvePath(const QString &path) const;
|
2013-07-10 21:43:49 +03:00
|
|
|
|
2016-02-10 16:20:13 +01:00
|
|
|
enum TripleLineError { NONE, LINE_LOCATION, LINE_DESCRIPTION, LINE_DESCRIPTION2 };
|
|
|
|
|
|
|
|
|
|
TripleLineError m_expectTripleLineErrorData = NONE;
|
|
|
|
|
|
2022-09-30 17:21:09 +02:00
|
|
|
std::optional<Utils::FilePath> m_sourceDirectory;
|
2013-07-10 21:43:49 +03:00
|
|
|
ProjectExplorer::Task m_lastTask;
|
2020-06-16 08:54:25 +02:00
|
|
|
QRegularExpression m_commonError;
|
|
|
|
|
QRegularExpression m_nextSubError;
|
2021-09-07 14:34:02 +02:00
|
|
|
QRegularExpression m_commonWarning;
|
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
|
|
|
};
|
|
|
|
|
|
2022-09-30 17:21:09 +02:00
|
|
|
} // CMakeProjectManager
|