forked from qt-creator/qt-creator
CMakeProjectManager: Use aspects more directly in build configuration
Change-Id: I35b9a31c158cac8eccb44ffb3f4e2d21d8183b8b Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -10,6 +10,8 @@
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <projectexplorer/environmentaspect.h>
|
||||
|
||||
#include <qtsupport/qtbuildaspects.h>
|
||||
|
||||
namespace CMakeProjectManager {
|
||||
class CMakeProject;
|
||||
|
||||
@@ -19,6 +21,33 @@ class CMakeBuildSystem;
|
||||
class CMakeBuildSettingsWidget;
|
||||
class CMakeProjectImporter;
|
||||
|
||||
class InitialCMakeArgumentsAspect final : public Utils::StringAspect
|
||||
{
|
||||
public:
|
||||
InitialCMakeArgumentsAspect(Utils::AspectContainer *container);
|
||||
|
||||
const CMakeConfig &cmakeConfiguration() const;
|
||||
const QStringList allValues() const;
|
||||
void setAllValues(const QString &values, QStringList &additionalArguments);
|
||||
void setCMakeConfiguration(const CMakeConfig &config);
|
||||
|
||||
void fromMap(const QVariantMap &map) final;
|
||||
void toMap(QVariantMap &map) const final;
|
||||
|
||||
private:
|
||||
CMakeConfig m_cmakeConfiguration;
|
||||
};
|
||||
|
||||
class ConfigureEnvironmentAspect final: public ProjectExplorer::EnvironmentAspect
|
||||
{
|
||||
public:
|
||||
ConfigureEnvironmentAspect(Utils::AspectContainer *container,
|
||||
ProjectExplorer::BuildConfiguration *buildConfig);
|
||||
|
||||
void fromMap(const QVariantMap &map);
|
||||
void toMap(QVariantMap &map) const;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
class CMAKE_EXPORT CMakeBuildConfiguration : public ProjectExplorer::BuildConfiguration
|
||||
@@ -39,13 +68,18 @@ public:
|
||||
void buildTarget(const QString &buildTarget);
|
||||
ProjectExplorer::BuildSystem *buildSystem() const final;
|
||||
|
||||
void setSourceDirectory(const Utils::FilePath& path);
|
||||
Utils::FilePath sourceDirectory() const;
|
||||
|
||||
void addToEnvironment(Utils::Environment &env) const override;
|
||||
|
||||
Utils::Environment configureEnvironment() const;
|
||||
|
||||
ProjectExplorer::BuildDirectoryAspect buildDir{this};
|
||||
Internal::InitialCMakeArgumentsAspect initialCMakeArguments{this};
|
||||
Utils::StringAspect additionalCMakeOptions{this};
|
||||
Utils::FilePathAspect sourceDirectory{this};
|
||||
Utils::StringAspect buildTypeAspect{this};
|
||||
QtSupport::QmlDebuggingAspect qmlDebugging{this};
|
||||
Internal::ConfigureEnvironmentAspect configureEnv{this, this};
|
||||
|
||||
signals:
|
||||
void signingFlagsChanged();
|
||||
void configureEnvironmentChanged();
|
||||
@@ -94,59 +128,4 @@ private:
|
||||
friend class Internal::CMakeProjectImporter;
|
||||
};
|
||||
|
||||
namespace Internal {
|
||||
|
||||
class InitialCMakeArgumentsAspect final : public Utils::StringAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
CMakeConfig m_cmakeConfiguration;
|
||||
public:
|
||||
InitialCMakeArgumentsAspect();
|
||||
|
||||
const CMakeConfig &cmakeConfiguration() const;
|
||||
const QStringList allValues() const;
|
||||
void setAllValues(const QString &values, QStringList &additionalArguments);
|
||||
void setCMakeConfiguration(const CMakeConfig &config);
|
||||
|
||||
void fromMap(const QVariantMap &map) final;
|
||||
void toMap(QVariantMap &map) const final;
|
||||
};
|
||||
|
||||
class AdditionalCMakeOptionsAspect final : public Utils::StringAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
AdditionalCMakeOptionsAspect();
|
||||
};
|
||||
|
||||
class SourceDirectoryAspect final : public Utils::FilePathAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SourceDirectoryAspect();
|
||||
};
|
||||
|
||||
class BuildTypeAspect final : public Utils::StringAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BuildTypeAspect();
|
||||
};
|
||||
|
||||
class ConfigureEnvironmentAspect final: public ProjectExplorer::EnvironmentAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ConfigureEnvironmentAspect(ProjectExplorer::BuildConfiguration *buildConfig);
|
||||
|
||||
void fromMap(const QVariantMap &map);
|
||||
void toMap(QVariantMap &map) const;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace CMakeProjectManager
|
||||
|
||||
Reference in New Issue
Block a user