aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp')
-rw-r--r--src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp
index 2d0616e481..bd0bf3b774 100644
--- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp
@@ -215,10 +215,17 @@ void CMakeBuildSystem::requestDebugging()
bool CMakeBuildSystem::supportsAction(Node *context, ProjectAction action, const Node *node) const
{
const auto cmakeTarget = dynamic_cast<CMakeTargetNode *>(context);
- if (cmakeTarget && cmakeTarget->productType() != ProductType::Other)
- return action == ProjectAction::AddNewFile || action == ProjectAction::AddExistingFile
- || action == ProjectAction::AddExistingDirectory || action == ProjectAction::Rename
- || action == ProjectAction::RemoveFile;
+ if (cmakeTarget) {
+ const auto buildTarget = Utils::findOrDefault(m_buildTargets,
+ [cmakeTarget](const CMakeBuildTarget &bt) {
+ return bt.title
+ == cmakeTarget->buildKey();
+ });
+ if (buildTarget.targetType != UtilityType)
+ return action == ProjectAction::AddNewFile || action == ProjectAction::AddExistingFile
+ || action == ProjectAction::AddExistingDirectory
+ || action == ProjectAction::Rename || action == ProjectAction::RemoveFile;
+ }
return BuildSystem::supportsAction(context, action, node);
}