forked from qt-creator/qt-creator
CMakePM: Do not show source/group/path twice
For the cases of: source_group(TREE ${CMAKE_SOURCE_DIR} FILES my/subdir/file.cpp) Treat the "my\\subdir" part in the project view as part of the source group name. Fixes: QTCREATORBUG-29799 Change-Id: I92bf581be25d085783bcdadd8a418b849a29c708 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -664,7 +664,10 @@ static void addCompileGroups(ProjectNode *targetRoot,
|
||||
sourceDirectory,
|
||||
targetRoot);
|
||||
if (showSourceFolders) {
|
||||
insertNode->addNestedNodes(std::move(current), sourceDirectory);
|
||||
FilePath baseDir = sourceDirectory.pathAppended(td.sourceGroups[i]);
|
||||
if (!baseDir.exists())
|
||||
baseDir = sourceDirectory;
|
||||
insertNode->addNestedNodes(std::move(current), baseDir);
|
||||
} else {
|
||||
for (auto &fileNodes : current)
|
||||
insertNode->addNode(std::move(fileNodes));
|
||||
|
Reference in New Issue
Block a user