diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2019-07-24 17:37:58 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@qt.io> | 2019-07-25 09:13:39 +0000 |
commit | 35bb768f4a007d17056ab052708f4b00a2d3838c (patch) | |
tree | bec977580e88ebba88d44f23bce9fb93fd88aa34 /src/plugins/cmakeprojectmanager/cmakebuildstep.cpp | |
parent | 12dea8f77214cb05cb1898444d5dd874f073ad82 (diff) |
CMake: Make CMakeParser work again
The CMakeParser used to set relative paths in the Tasks it creates.
Since is problematic: Task tries to match that relative file name to
one of the files that exist in the session.
At the time cmake runs only the top-level CMakeLists.txt file is known,
so this logic will map all the relative file paths to that file.
Make sure to write absolute file paths into tasks so that this mapping
is not attempted.
Change-Id: I4ab72df21f18d2eff27ca9a502d605e00df2ad85
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/cmakeprojectmanager/cmakebuildstep.cpp')
-rw-r--r-- | src/plugins/cmakeprojectmanager/cmakebuildstep.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp index 7711ca42c0a..90c4bca5068 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp @@ -52,9 +52,10 @@ #include <utils/qtcprocess.h> #include <utils/pathchooser.h> +#include <QCheckBox> +#include <QDir> #include <QFormLayout> #include <QGroupBox> -#include <QCheckBox> #include <QLineEdit> #include <QListWidget> @@ -212,7 +213,9 @@ bool CMakeBuildStep::init() pp->setCommandLine(cmakeCommand(rc)); pp->resolveAll(); - setOutputParser(new CMakeParser); + CMakeParser *cmakeParser = new CMakeParser; + cmakeParser->setSourceDirectory(projectDirectory.toString()); + setOutputParser(cmakeParser); appendOutputParser(new GnuMakeParser); IOutputParser *parser = target()->kit()->createOutputParser(); if (parser) |