diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectnodes.h b/src/plugins/cmakeprojectmanager/cmakeprojectnodes.h index 74718944017..ad0af9db4b3 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectnodes.h +++ b/src/plugins/cmakeprojectmanager/cmakeprojectnodes.h @@ -72,6 +72,7 @@ public: void setVisibleAfterAddFileAction(bool visibleAfterAddFileAction); + using ProjectExplorer::Node::setFilePath; private: QString m_tooltip; Utils::FilePath m_buildDirectory; diff --git a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp index 0d8a9e71f01..9ef2d86e8ef 100644 --- a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp +++ b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp @@ -825,6 +825,9 @@ static void addTargets(FolderNode *root, folderDir, createSourceGroupNode(td.folderTargetProperty, folderDir, root)); tNode = createTargetNode(folderNodes, folderDir, t.name); + + // Set the correct source directory, not the FOLDER property value + tNode->setFilePath(dir); } else { tNode = createTargetNode(cmakeListsNodes, dir, t.name); }