CMakePM: Add imported targets to code completion / navigation

This allows e.g. Qt6::Core to be specified as argument for
target_link_libraries and navigation via F2.

Also fixes a bug introduced with
695952f84b which removed the project
specific features due to project being nullptr.

Change-Id: I5efa28c498d337e6bab564533a5445e6c364b26b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Cristian Adam
2023-09-27 17:55:43 +02:00
parent 1723af0206
commit d915e22adb
3 changed files with 69 additions and 26 deletions

View File

@@ -121,6 +121,7 @@ public:
const QHash<QString, Utils::Link> &cmakeSymbolsHash() const { return m_cmakeSymbolsHash; }
CMakeKeywords projectKeywords() const { return m_projectKeywords; }
QStringList projectImportedTargets() const { return m_projectImportedTargets; }
signals:
void configurationCleared();
@@ -227,6 +228,7 @@ private:
QSet<CMakeFileInfo> m_cmakeFiles;
QHash<QString, Utils::Link> m_cmakeSymbolsHash;
CMakeKeywords m_projectKeywords;
QStringList m_projectImportedTargets;
QHash<QString, ProjectFileArgumentPosition> m_filesToBeRenamed;