forked from qt-creator/qt-creator
CMake: Make sure top level CMakeLists.txt file is listed exactly once
The toplevel CMakeLists.txt file should always be visible in the project tree, otherwise there is no way to fix problems that stop creator from reading the project structure. Since the cmake configuration may add that file itself, creator needs to check before adding that file. All other files are taken straight from cmake, which makes sure they are unique. See the minimal project attached to QTCREATORBUG-16671 for an example triggering this issue. Change-Id: Iff3e307134b023e6955f47657e998a5981b03da0 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -382,7 +382,10 @@ void BuildDirManager::extractData()
|
||||
m_files.append(cbpparser.cmakeFileList());
|
||||
foreach (const ProjectExplorer::FileNode *node, cbpparser.cmakeFileList())
|
||||
m_cmakeFiles.insert(node->filePath());
|
||||
} else {
|
||||
}
|
||||
|
||||
// Make sure the top cmakelists.txt file is always listed:
|
||||
if (!Utils::contains(m_files, [topCMake](ProjectExplorer::FileNode *fn) { return fn->filePath() == topCMake; })) {
|
||||
m_files.append(new ProjectExplorer::FileNode(topCMake, ProjectExplorer::ProjectFileType, false));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user