forked from qt-creator/qt-creator
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:
@@ -368,8 +368,10 @@ QList<CMakeBuildTarget> BuildDirManager::takeBuildTargets(QString &errorMessage)
|
||||
|
||||
// Guess at the target definition position when no details are known
|
||||
for (CMakeBuildTarget &t : readerTargets) {
|
||||
if (t.definitionFile.isEmpty()) {
|
||||
t.definitionFile = t.sourceDirectory.pathAppended("CMakeLists.txt");
|
||||
if (t.backtrace.isEmpty()) {
|
||||
t.backtrace.append(
|
||||
FolderNode::LocationInfo(tr("CMakeLists.txt in source directory"),
|
||||
t.sourceDirectory.pathAppended("CMakeLists.txt")));
|
||||
}
|
||||
}
|
||||
result.append(readerTargets);
|
||||
|
||||
Reference in New Issue
Block a user