From 5419b020580e3997655e26f2d5c7875078ccd381 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 7 Jan 2016 11:47:56 +0100 Subject: [PATCH] CMake: Make sure there is a "clean" target Change-Id: I9e3eb49b7f5a2d7d5c89a53969c4703b3ce99330 Reviewed-by: Cristian Adam Reviewed-by: Niels Weber --- src/plugins/cmakeprojectmanager/cmakecbpparser.cpp | 10 ++++++++++ src/plugins/cmakeprojectmanager/cmakeproject.h | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/cmakecbpparser.cpp b/src/plugins/cmakeprojectmanager/cmakecbpparser.cpp index 980f87c443a..0e186ee2138 100644 --- a/src/plugins/cmakeprojectmanager/cmakecbpparser.cpp +++ b/src/plugins/cmakeprojectmanager/cmakecbpparser.cpp @@ -177,6 +177,16 @@ bool CMakeCbpParser::parseCbpFile(Kit *kit, const QString &fileName, const QStri sortFiles(); fi.close(); + + // There is always a clean target: + CMakeBuildTarget cleanTarget; + cleanTarget.title = QLatin1String("clean"); + cleanTarget.targetType = UtilityType; + cleanTarget.workingDirectory = m_buildDirectory; + cleanTarget.sourceDirectory = m_sourceDirectory; + + m_buildTargets.append(cleanTarget); + return true; } return false; diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.h b/src/plugins/cmakeprojectmanager/cmakeproject.h index 290c5845cd3..2efb8d2d33d 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.h +++ b/src/plugins/cmakeprojectmanager/cmakeproject.h @@ -65,7 +65,8 @@ class CMakeManager; enum TargetType { ExecutableType = 0, StaticLibraryType = 2, - DynamicLibraryType = 3 + DynamicLibraryType = 3, + UtilityType = 64 }; struct CMAKE_EXPORT CMakeBuildTarget