CMake: Extract and show more CMake location information for targets

Report more cmake file locations that are relevant to a target in
the "Open..." menu entry in the target's context menu.

This information is extracted from the backtrace information that
is provided by fileapi.

Change-Id: I01659a6cc7254cd0ef6b533a0785d2f15d31c3c6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Tobias Hunger
2019-07-26 13:57:24 +02:00
parent 9ae4510e27
commit 4aee38e04c
4 changed files with 115 additions and 76 deletions

View File

@@ -28,6 +28,7 @@
#include "cmake_global.h"
#include <projectexplorer/projectmacro.h>
#include <projectexplorer/projectnodes.h>
#include <utils/fileutils.h>
@@ -43,6 +44,9 @@ enum TargetType {
UtilityType
};
using Backtrace = QVector<ProjectExplorer::FolderNode::LocationInfo>;
using Backtraces = QVector<Backtrace>;
class CMAKE_EXPORT CMakeBuildTarget
{
public:
@@ -53,8 +57,13 @@ public:
Utils::FilePath sourceDirectory;
Utils::FilePath makeCommand;
Utils::FilePath definitionFile;
int definitionLine = -1;
Backtrace backtrace;
Backtraces dependencyDefinitions;
Backtraces sourceDefinitions;
Backtraces defineDefinitions;
Backtraces includeDefinitions;
Backtraces installDefinitions;
// code model
QList<Utils::FilePath> includeFiles;