forked from qt-creator/qt-creator
CMakePM: Handle include(CMakeFileWithoutSuffix) navigation
Check that the function operating upon is "include" and then match the word under cursor with a file from the project. Change-Id: Ia0131f08515c56582a1fb02a59d6b2e41ac04288 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -1379,12 +1379,25 @@ void CMakeBuildSystem::setupCMakeSymbolsHash()
|
||||
}
|
||||
};
|
||||
|
||||
// Prepare a hash with all .cmake files
|
||||
m_dotCMakeFilesHash.clear();
|
||||
auto handleDotCMakeFiles = [&](const CMakeFileInfo &cmakeFile) {
|
||||
if (cmakeFile.path.suffix() == "cmake") {
|
||||
Utils::Link link;
|
||||
link.targetFilePath = cmakeFile.path;
|
||||
link.targetLine = 1;
|
||||
link.targetColumn = 0;
|
||||
m_dotCMakeFilesHash.insert(cmakeFile.path.completeBaseName(), link);
|
||||
}
|
||||
};
|
||||
|
||||
for (const auto &cmakeFile : std::as_const(m_cmakeFiles)) {
|
||||
for (const auto &func : cmakeFile.cmakeListFile.Functions) {
|
||||
handleFunctionMacroOption(cmakeFile, func);
|
||||
handleImportedTargets(cmakeFile, func);
|
||||
handleProjectTargets(cmakeFile, func);
|
||||
handleFindPackageVariables(cmakeFile, func);
|
||||
handleDotCMakeFiles(cmakeFile);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user