diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2019-10-09 13:52:06 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@qt.io> | 2019-10-09 14:32:56 +0000 |
commit | 2c82422932d050093f43db6b2aec8957edb53a28 (patch) | |
tree | 4b8d2bb13420c582763fcc8456050da489c2224e /src/plugins/cmakeprojectmanager/cmakeparser.cpp | |
parent | be0bab717c872f3fd1919eb9585616cdb00f65da (diff) | |
download | qt-creator-2c82422932d050093f43db6b2aec8957edb53a28.tar.gz |
CMake: Do not pass on normal CMake output to other parsers
This should avoid false positives with lines like this:
-- Qt5 install prefix: /usr/lib
which the toolchain may misinterpret otherwise.
Task-number: QTCREATORBUG-22837
Change-Id: I30a6fef6771edf37a9737366ae717d149cccfab6
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Diffstat (limited to 'src/plugins/cmakeprojectmanager/cmakeparser.cpp')
-rw-r--r-- | src/plugins/cmakeprojectmanager/cmakeparser.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmakeparser.cpp b/src/plugins/cmakeprojectmanager/cmakeparser.cpp index 515bf89222..458b7b8b4e 100644 --- a/src/plugins/cmakeprojectmanager/cmakeparser.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeparser.cpp @@ -105,6 +105,9 @@ void CMakeParser::stdError(const QString &line) Utils::FilePath(), -1, Constants::TASK_CATEGORY_BUILDSYSTEM); m_lines = 1; return; + } else if (trimmedLine.startsWith("-- ") || trimmedLine.startsWith(" * ")) { + // Do not pass on lines starting with "-- " or "* ". Those are typical CMake output + return; } IOutputParser::stdError(line); return; @@ -288,6 +291,10 @@ void Internal::CMakeProjectPlugin::testCMakeParser_data() Utils::FilePath::fromUserInput(QLatin1String("/test/path/CMakeLists.txt")), 9, categoryBuild)) << QString(); + QTest::newRow("eat normal CMake output") + << QString::fromLatin1("-- Qt5 install prefix: /usr/lib\n" + " * Plugin componentsplugin, with CONDITION TARGET QmlDesigner") + << OutputParserTester::STDERR << QString() << QString() << (Tasks()) << QString(); } void Internal::CMakeProjectPlugin::testCMakeParser() |