CMake: Move CMakeInstallStep definition to .cpp

It doesn't have to be a Q_OBJECT. Smaller interface. Also de-noise a bit.

Change-Id: I70c056e76646e9de166ded46f6fd4f448a804112
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
hjk
2022-12-19 16:17:36 +01:00
parent 68e15e613f
commit 33eb5ff391
2 changed files with 22 additions and 29 deletions

View File

@@ -3,6 +3,7 @@
#include "cmakeinstallstep.h"
#include "cmakeabstractprocessstep.h"
#include "cmakebuildsystem.h"
#include "cmakekitinformation.h"
#include "cmakeparser.h"
@@ -27,7 +28,23 @@ const char CMAKE_ARGUMENTS_KEY[] = "CMakeProjectManager.InstallStep.CMakeArgumen
// CMakeInstallStep
CMakeInstallStep::CMakeInstallStep(BuildStepList *bsl, Utils::Id id)
class CMakeInstallStep : public CMakeAbstractProcessStep
{
public:
CMakeInstallStep(ProjectExplorer::BuildStepList *bsl, Id id);
private:
CommandLine cmakeCommand() const;
void processFinished(bool success) override;
void setupOutputFormatter(OutputFormatter *formatter) override;
QWidget *createConfigWidget() override;
StringAspect *m_cmakeArguments = nullptr;
};
CMakeInstallStep::CMakeInstallStep(BuildStepList *bsl, Id id)
: CMakeAbstractProcessStep(bsl, id)
{
m_cmakeArguments = addAspect<StringAspect>();
@@ -38,7 +55,7 @@ CMakeInstallStep::CMakeInstallStep(BuildStepList *bsl, Utils::Id id)
setCommandLineProvider([this] { return cmakeCommand(); });
}
void CMakeInstallStep::setupOutputFormatter(Utils::OutputFormatter *formatter)
void CMakeInstallStep::setupOutputFormatter(OutputFormatter *formatter)
{
CMakeParser *cmakeParser = new CMakeParser;
cmakeParser->setSourceDirectory(project()->projectDirectory());
@@ -119,5 +136,5 @@ CMakeInstallStepFactory::CMakeInstallStepFactory()
setSupportedStepLists({ProjectExplorer::Constants::BUILDSTEPS_DEPLOY});
}
} // namespace CMakeProjectManager::Internal
} // CMakeProjectManager::Internal

View File

@@ -3,38 +3,14 @@
#pragma once
#include "cmakeabstractprocessstep.h"
namespace Utils {
class CommandLine;
class StringAspect;
} // namespace Utils
#include <projectexplorer/buildstep.h>
namespace CMakeProjectManager::Internal {
class CMakeInstallStep : public CMakeAbstractProcessStep
{
Q_OBJECT
public:
CMakeInstallStep(ProjectExplorer::BuildStepList *bsl, Utils::Id id);
private:
Utils::CommandLine cmakeCommand() const;
void processFinished(bool success) override;
void setupOutputFormatter(Utils::OutputFormatter *formatter) override;
QWidget *createConfigWidget() override;
friend class CMakeInstallStepConfigWidget;
Utils::StringAspect *m_cmakeArguments = nullptr;
};
class CMakeInstallStepFactory : public ProjectExplorer::BuildStepFactory
{
public:
CMakeInstallStepFactory();
};
} // namespace CMakeProjectManager::Internal
} // CMakeProjectManager::Internal