CMake: Parse cmake syntax errors

Improve the CMakeParser so that it picks up the most common
errors/warnings that cmake throws when running into errors while
parsing its CMakeLists.txt files.

Change-Id: Ie3774695418f13aa3869d78802c1a552e6fd384e
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Tobias Hunger
2016-02-10 16:20:13 +01:00
parent 36118a5cb0
commit c3aac7624c
2 changed files with 101 additions and 26 deletions

View File

@@ -28,6 +28,8 @@
#include <projectexplorer/ioutputparser.h>
#include <projectexplorer/task.h>
#include <QRegularExpression>
namespace CMakeProjectManager {
namespace Internal {
@@ -43,13 +45,17 @@ protected:
void doFlush() override;
private:
enum TripleLineError { NONE, LINE_LOCATION, LINE_DESCRIPTION, LINE_DESCRIPTION2 };
TripleLineError m_expectTripleLineErrorData = NONE;
ProjectExplorer::Task m_lastTask;
QRegExp m_commonError;
QRegExp m_nextSubError;
QRegularExpression m_locationLine;
bool m_skippedFirstEmptyLine = false;
int m_lines = 0;
};
} // namespace CMakeProjectManager
} // namespace Internal