Commit a7bb7728 authored by Tobias Hunger's avatar Tobias Hunger

BC: Move builddirectory handling into BC itself

Use setBuildDirectory() in the different BuildConfigurations instead
of reimplementing that over and over again.

Change-Id: Ic355fdb4624c71667ce470b3e2865c9a8722ef09
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 52a41ecb
......@@ -158,7 +158,7 @@ bool AutogenStep::init()
ProcessParameters *pp = processParameters();
pp->setMacroExpander(bc->macroExpander());
pp->setEnvironment(bc->environment());
pp->setWorkingDirectory(bc->buildDirectory());
pp->setWorkingDirectory(bc->buildDirectory().toString());
pp->setCommand(QLatin1String("autogen.sh"));
pp->setArguments(additionalArguments());
pp->resolveAll();
......@@ -171,9 +171,10 @@ void AutogenStep::run(QFutureInterface<bool> &interface)
BuildConfiguration *bc = buildConfiguration();
// Check whether we need to run autogen.sh
const QFileInfo configureInfo(bc->buildDirectory() + QLatin1String("/configure"));
const QFileInfo configureAcInfo(bc->buildDirectory() + QLatin1String("/configure.ac"));
const QFileInfo makefileAmInfo(bc->buildDirectory() + QLatin1String("/Makefile.am"));
const QString buildDir = bc->buildDirectory().toString();
const QFileInfo configureInfo(buildDir + QLatin1String("/configure"));
const QFileInfo configureAcInfo(buildDir + QLatin1String("/configure.ac"));
const QFileInfo makefileAmInfo(buildDir + QLatin1String("/Makefile.am"));
if (!configureInfo.exists()
|| configureInfo.lastModified() < configureAcInfo.lastModified()
......@@ -275,7 +276,7 @@ void AutogenStepConfigWidget::updateDetails()
ProcessParameters param;
param.setMacroExpander(bc->macroExpander());
param.setEnvironment(bc->environment());
param.setWorkingDirectory(bc->buildDirectory());
param.setWorkingDirectory(bc->buildDirectory().toString());
param.setCommand(QLatin1String("autogen.sh"));
param.setArguments(m_autogenStep->additionalArguments());
m_summaryText = param.summary(displayName());
......
......@@ -157,7 +157,7 @@ bool AutoreconfStep::init()
ProcessParameters *pp = processParameters();
pp->setMacroExpander(bc->macroExpander());
pp->setEnvironment(bc->environment());
pp->setWorkingDirectory(bc->buildDirectory());
pp->setWorkingDirectory(bc->buildDirectory().toString());
pp->setCommand(QLatin1String("autoreconf"));
pp->setArguments(additionalArguments());
pp->resolveAll();
......@@ -170,7 +170,8 @@ void AutoreconfStep::run(QFutureInterface<bool> &interface)
BuildConfiguration *bc = buildConfiguration();
// Check whether we need to run autoreconf
const QFileInfo configureInfo(bc->buildDirectory() + QLatin1String("/configure"));
const QString buildDir = bc->buildDirectory().toString();
const QFileInfo configureInfo(buildDir + QLatin1String("/configure"));
if (!configureInfo.exists())
m_runAutoreconf = true;
......@@ -269,7 +270,7 @@ void AutoreconfStepConfigWidget::updateDetails()
ProcessParameters param;
param.setMacroExpander(bc->macroExpander());
param.setEnvironment(bc->environment());
param.setWorkingDirectory(bc->buildDirectory());
param.setWorkingDirectory(bc->buildDirectory().toString());
param.setCommand(QLatin1String("autoreconf"));
param.setArguments(m_autoreconfStep->additionalArguments());
m_summaryText = param.summary(displayName());
......
......@@ -59,11 +59,7 @@ using namespace ProjectExplorer::Constants;
//////////////////////////////////////
AutotoolsBuildConfiguration::AutotoolsBuildConfiguration(ProjectExplorer::Target *parent)
: BuildConfiguration(parent, Core::Id(AUTOTOOLS_BC_ID))
{
AutotoolsProject *project = qobject_cast<AutotoolsProject *>(parent->project());
if (project)
m_buildDirectory = project->defaultBuildDirectory();
}
{ }
NamedWidget *AutotoolsBuildConfiguration::createConfigWidget()
{
......@@ -72,46 +68,15 @@ NamedWidget *AutotoolsBuildConfiguration::createConfigWidget()
AutotoolsBuildConfiguration::AutotoolsBuildConfiguration(ProjectExplorer::Target *parent, const Core::Id id)
: BuildConfiguration(parent, id)
{
}
{ }
AutotoolsBuildConfiguration::AutotoolsBuildConfiguration(ProjectExplorer::Target *parent,
AutotoolsBuildConfiguration *source)
: BuildConfiguration(parent, source),
m_buildDirectory(source->m_buildDirectory)
: BuildConfiguration(parent, source)
{
cloneSteps(source);
}
QVariantMap AutotoolsBuildConfiguration::toMap() const
{
QVariantMap map = BuildConfiguration::toMap();
map.insert(QLatin1String(BUILD_DIRECTORY_KEY), m_buildDirectory);
return map;
}
bool AutotoolsBuildConfiguration::fromMap(const QVariantMap &map)
{
if (!BuildConfiguration::fromMap(map))
return false;
m_buildDirectory = map.value(QLatin1String(BUILD_DIRECTORY_KEY)).toString();
return true;
}
QString AutotoolsBuildConfiguration::buildDirectory() const
{
return m_buildDirectory;
}
void AutotoolsBuildConfiguration::setBuildDirectory(const QString &buildDirectory)
{
if (m_buildDirectory == buildDirectory)
return;
m_buildDirectory = buildDirectory;
emit buildDirectoryChanged();
}
//////////////////////////////////////
// AutotoolsBuildConfiguration class
//////////////////////////////////////
......
......@@ -39,6 +39,7 @@ namespace Internal {
class AutotoolsTarget;
class AutotoolsBuildConfigurationFactory;
class AutotoolsBuildSettingsWidget;
class AutotoolsBuildConfiguration : public ProjectExplorer::BuildConfiguration
{
......@@ -50,19 +51,13 @@ public:
ProjectExplorer::NamedWidget *createConfigWidget();
QString buildDirectory() const;
void setBuildDirectory(const QString &buildDirectory);
QVariantMap toMap() const;
BuildType buildType() const;
protected:
AutotoolsBuildConfiguration(ProjectExplorer::Target *parent, const Core::Id id);
AutotoolsBuildConfiguration(ProjectExplorer::Target *parent, AutotoolsBuildConfiguration *source);
bool fromMap(const QVariantMap &map);
private:
QString m_buildDirectory;
friend class AutotoolsBuildSettingsWidget;
};
class AutotoolsBuildConfigurationFactory : public ProjectExplorer::IBuildConfigurationFactory
......
......@@ -59,15 +59,24 @@ AutotoolsBuildSettingsWidget::AutotoolsBuildSettingsWidget(AutotoolsBuildConfigu
m_pathChooser = new Utils::PathChooser(this);
m_pathChooser->setEnabled(true);
m_pathChooser->setExpectedKind(Utils::PathChooser::Directory);
m_pathChooser->setBaseDirectory(bc->target()->project()->projectDirectory());
m_pathChooser->setEnvironment(bc->environment());
fl->addRow(tr("Build directory:"), m_pathChooser);
connect(m_pathChooser, SIGNAL(changed(QString)), this, SLOT(buildDirectoryChanged()));
m_pathChooser->setBaseDirectory(bc->target()->project()->projectDirectory());
m_pathChooser->setPath(m_buildConfiguration->buildDirectory());
m_pathChooser->setPath(m_buildConfiguration->rawBuildDirectory().toString());
setDisplayName(tr("Autotools Manager"));
connect(bc, SIGNAL(environmentChanged()), this, SLOT(environmentHasChanged()));
}
void AutotoolsBuildSettingsWidget::buildDirectoryChanged()
{
m_buildConfiguration->setBuildDirectory(m_pathChooser->rawPath());
m_buildConfiguration->setBuildDirectory(Utils::FileName::fromString(m_pathChooser->rawPath()));
}
void AutotoolsBuildSettingsWidget::environmentHasChanged()
{
m_pathChooser->setEnvironment(m_buildConfiguration->environment());
}
......@@ -61,6 +61,7 @@ public:
private slots:
void buildDirectoryChanged();
void environmentHasChanged();
private:
Utils::PathChooser *m_pathChooser;
......
......@@ -41,7 +41,6 @@ namespace Constants {
//BuildConfiguration
const char AUTOTOOLS_BC_ID[] = "AutotoolsProjectManager.AutotoolsBuildConfiguration";
const char BUILD_DIRECTORY_KEY[] = "AutotoolsProjectManager.AutotoolsBuildConfiguration.BuildDirectory";
//Project
const char AUTOTOOLS_PROJECT_ID[] = "AutotoolsProjectManager.AutotoolsProject";
......
......@@ -158,7 +158,7 @@ bool ConfigureStep::init()
ProcessParameters *pp = processParameters();
pp->setMacroExpander(bc->macroExpander());
pp->setEnvironment(bc->environment());
pp->setWorkingDirectory(bc->buildDirectory());
pp->setWorkingDirectory(bc->buildDirectory().toString());
pp->setCommand(QLatin1String("configure"));
pp->setArguments(additionalArguments());
pp->resolveAll();
......@@ -171,8 +171,9 @@ void ConfigureStep::run(QFutureInterface<bool>& interface)
BuildConfiguration *bc = buildConfiguration();
//Check whether we need to run configure
const QFileInfo configureInfo(bc->buildDirectory() + QLatin1String("/configure"));
const QFileInfo configStatusInfo(bc->buildDirectory() + QLatin1String("/config.status"));
QString buildDir = bc->buildDirectory().toString();
const QFileInfo configureInfo(buildDir +QLatin1String("/configure"));
const QFileInfo configStatusInfo(buildDir + QLatin1String("/config.status"));
if (!configStatusInfo.exists()
|| configStatusInfo.lastModified() < configureInfo.lastModified()) {
......@@ -273,7 +274,7 @@ void ConfigureStepConfigWidget::updateDetails()
ProcessParameters param;
param.setMacroExpander(bc->macroExpander());
param.setEnvironment(bc->environment());
param.setWorkingDirectory(bc->buildDirectory());
param.setWorkingDirectory(bc->buildDirectory().toString());
param.setCommand(QLatin1String("configure"));
param.setArguments(m_configureStep->additionalArguments());
m_summaryText = param.summary(displayName());
......
......@@ -186,7 +186,7 @@ bool MakeStep::init()
// addToEnvironment() to not screw up the users run environment.
env.set(QLatin1String("LC_ALL"), QLatin1String("C"));
pp->setEnvironment(env);
pp->setWorkingDirectory(bc->buildDirectory());
pp->setWorkingDirectory(bc->buildDirectory().toString());
pp->setCommand(tc ? tc->makeCommand(bc->environment()) : QLatin1String("make"));
pp->setArguments(arguments);
pp->resolveAll();
......@@ -321,7 +321,7 @@ void MakeStepConfigWidget::updateDetails()
ProcessParameters param;
param.setMacroExpander(bc->macroExpander());
param.setEnvironment(bc->environment());
param.setWorkingDirectory(bc->buildDirectory());
param.setWorkingDirectory(bc->buildDirectory().toString());
param.setCommand(tc->makeCommand(bc->environment()));
param.setArguments(arguments);
m_summaryText = param.summary(displayName());
......
......@@ -44,7 +44,6 @@ using namespace CMakeProjectManager;
using namespace Internal;
namespace {
const char BUILD_DIRECTORY_KEY[] = "CMakeProjectManager.CMakeBuildConfiguration.BuildDirectory";
const char USE_NINJA_KEY[] = "CMakeProjectManager.CMakeBuildConfiguration.UseNinja";
} // namespace
......@@ -52,15 +51,14 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(ProjectExplorer::Target *parent
BuildConfiguration(parent, Core::Id(Constants::CMAKE_BC_ID)), m_useNinja(false)
{
CMakeProject *project = static_cast<CMakeProject *>(parent->project());
m_buildDirectory = project->shadowBuildDirectory(project->projectFilePath(),
parent->kit(),
displayName());
setBuildDirectory(Utils::FileName::fromString(project->shadowBuildDirectory(project->projectFilePath(),
parent->kit(),
displayName())));
}
CMakeBuildConfiguration::CMakeBuildConfiguration(ProjectExplorer::Target *parent,
CMakeBuildConfiguration *source) :
BuildConfiguration(parent, source),
m_buildDirectory(source->m_buildDirectory),
m_msvcVersion(source->m_msvcVersion),
m_useNinja(false)
{
......@@ -71,7 +69,6 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(ProjectExplorer::Target *parent
QVariantMap CMakeBuildConfiguration::toMap() const
{
QVariantMap map(ProjectExplorer::BuildConfiguration::toMap());
map.insert(QLatin1String(BUILD_DIRECTORY_KEY), m_buildDirectory);
map.insert(QLatin1String(USE_NINJA_KEY), m_useNinja);
return map;
}
......@@ -81,7 +78,6 @@ bool CMakeBuildConfiguration::fromMap(const QVariantMap &map)
if (!BuildConfiguration::fromMap(map))
return false;
m_buildDirectory = map.value(QLatin1String(BUILD_DIRECTORY_KEY)).toString();
m_useNinja = map.value(QLatin1String(USE_NINJA_KEY), false).toBool();
return true;
......@@ -108,20 +104,6 @@ ProjectExplorer::NamedWidget *CMakeBuildConfiguration::createConfigWidget()
return new CMakeBuildSettingsWidget(this);
}
QString CMakeBuildConfiguration::buildDirectory() const
{
return m_buildDirectory;
}
void CMakeBuildConfiguration::setBuildDirectory(const QString &buildDirectory)
{
if (m_buildDirectory == buildDirectory)
return;
m_buildDirectory = buildDirectory;
emit buildDirectoryChanged();
emit environmentChanged();
}
/*!
\class CMakeBuildConfigurationFactory
*/
......@@ -205,7 +187,7 @@ CMakeBuildConfiguration *CMakeBuildConfigurationFactory::create(ProjectExplorer:
cleanMakeStep->setAdditionalArguments(QLatin1String("clean"));
cleanMakeStep->setClean(true);
bc->setBuildDirectory(copw.buildDirectory());
bc->setBuildDirectory(Utils::FileName::fromString(copw.buildDirectory()));
bc->setUseNinja(copw.useNinja());
// Default to all
......@@ -254,7 +236,7 @@ bool CMakeBuildConfigurationFactory::canHandle(const ProjectExplorer::Target *t)
ProjectExplorer::BuildConfiguration::BuildType CMakeBuildConfiguration::buildType() const
{
QString cmakeBuildType;
QFile cmakeCache(buildDirectory() + QLatin1String("/CMakeCache.txt"));
QFile cmakeCache(buildDirectory().toString() + QLatin1String("/CMakeCache.txt"));
if (cmakeCache.open(QIODevice::ReadOnly)) {
while (!cmakeCache.atEnd()) {
QByteArray line = cmakeCache.readLine();
......
......@@ -39,6 +39,7 @@ class ToolChain;
namespace CMakeProjectManager {
namespace Internal {
class CMakeProject;
class CMakeBuildConfigurationFactory;
......@@ -52,9 +53,6 @@ public:
~CMakeBuildConfiguration();
ProjectExplorer::NamedWidget *createConfigWidget();
QString buildDirectory() const;
void setBuildDirectory(const QString &buildDirectory);
QVariantMap toMap() const;
......@@ -71,9 +69,10 @@ protected:
bool fromMap(const QVariantMap &map);
private:
QString m_buildDirectory;
QString m_msvcVersion;
bool m_useNinja;
friend class CMakeProject;
};
class CMakeBuildConfigurationFactory : public ProjectExplorer::IBuildConfigurationFactory
......
......@@ -78,7 +78,7 @@ public:
BuildInfo(CMakeBuildConfiguration *bc)
: sourceDirectory(bc->target()->project()->projectDirectory())
, buildDirectory(bc->buildDirectory())
, buildDirectory(bc->buildDirectory().toString())
, environment(bc->environment())
, useNinja(bc->useNinja())
, kit(bc->target()->kit())
......
......@@ -135,7 +135,7 @@ void CMakeProject::changeActiveBuildConfiguration(ProjectExplorer::BuildConfigur
CMakeBuildConfiguration *cmakebc = static_cast<CMakeBuildConfiguration *>(bc);
// Pop up a dialog asking the user to rerun cmake
QString cbpFile = CMakeManager::findCbpFile(QDir(bc->buildDirectory()));
QString cbpFile = CMakeManager::findCbpFile(QDir(bc->buildDirectory().toString()));
QFileInfo cbpFileFi(cbpFile);
CMakeOpenProjectWizard::Mode mode = CMakeOpenProjectWizard::Nothing;
if (!cbpFileFi.exists()) {
......@@ -180,7 +180,7 @@ void CMakeProject::activeTargetWasChanged(Target *target)
void CMakeProject::changeBuildDirectory(CMakeBuildConfiguration *bc, const QString &newBuildDirectory)
{
bc->setBuildDirectory(newBuildDirectory);
bc->setBuildDirectory(Utils::FileName::fromString(newBuildDirectory));
parseCMakeLists();
}
......@@ -210,7 +210,7 @@ bool CMakeProject::parseCMakeLists()
document->infoBar()->removeInfo(Core::Id("CMakeEditor.RunCMake"));
// Find cbp file
QString cbpFile = CMakeManager::findCbpFile(activeBC->buildDirectory());
QString cbpFile = CMakeManager::findCbpFile(activeBC->buildDirectory().toString());
if (cbpFile.isEmpty()) {
emit buildTargetsChanged();
......@@ -559,7 +559,7 @@ bool CMakeProject::fromMap(const QVariantMap &map)
CMakeBuildConfiguration *bc(new CMakeBuildConfiguration(t));
bc->setDefaultDisplayName(QLatin1String("all"));
bc->setUseNinja(copw.useNinja());
bc->setBuildDirectory(copw.buildDirectory());
bc->setBuildDirectory(Utils::FileName::fromString(copw.buildDirectory()));
ProjectExplorer::BuildStepList *buildSteps = bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
ProjectExplorer::BuildStepList *cleanSteps = bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_CLEAN);
......@@ -585,7 +585,7 @@ bool CMakeProject::fromMap(const QVariantMap &map)
CMakeBuildConfiguration *activeBC = qobject_cast<CMakeBuildConfiguration *>(activeTarget()->activeBuildConfiguration());
if (!activeBC)
return false;
QString cbpFile = CMakeManager::findCbpFile(QDir(activeBC->buildDirectory()));
QString cbpFile = CMakeManager::findCbpFile(QDir(activeBC->buildDirectory().toString()));
QFileInfo cbpFileFi(cbpFile);
CMakeOpenProjectWizard::Mode mode = CMakeOpenProjectWizard::Nothing;
......@@ -669,7 +669,7 @@ QString CMakeProject::uiHeaderFile(const QString &uiFile)
QDir srcDirRoot = QDir(project.toString());
QString relativePath = srcDirRoot.relativeFilePath(baseDirectory.toString());
QDir buildDir = QDir(activeTarget()->activeBuildConfiguration()->buildDirectory());
QDir buildDir = QDir(activeTarget()->activeBuildConfiguration()->buildDirectory().toString());
QString uiHeaderFilePath = buildDir.absoluteFilePath(relativePath);
uiHeaderFilePath += QLatin1String("/ui_");
uiHeaderFilePath += fi.completeBaseName();
......@@ -839,8 +839,8 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
fl->addRow(tr("Build directory:"), hbox);
m_buildConfiguration = bc;
m_pathLineEdit->setText(m_buildConfiguration->buildDirectory());
if (m_buildConfiguration->buildDirectory() == bc->target()->project()->projectDirectory())
m_pathLineEdit->setText(m_buildConfiguration->rawBuildDirectory().toString());
if (m_buildConfiguration->buildDirectory().toString() == bc->target()->project()->projectDirectory())
m_changeButton->setEnabled(false);
else
m_changeButton->setEnabled(true);
......@@ -856,7 +856,7 @@ void CMakeBuildSettingsWidget::openChangeBuildDirectoryDialog()
if (copw.exec() == QDialog::Accepted) {
project->changeBuildDirectory(m_buildConfiguration, copw.buildDirectory());
m_buildConfiguration->setUseNinja(copw.useNinja());
m_pathLineEdit->setText(m_buildConfiguration->buildDirectory());
m_pathLineEdit->setText(m_buildConfiguration->rawBuildDirectory().toString());
}
}
......
......@@ -192,7 +192,7 @@ bool MakeStep::init()
if (m_useNinja && !env.value(QLatin1String("NINJA_STATUS")).startsWith(m_ninjaProgressString))
env.set(QLatin1String("NINJA_STATUS"), m_ninjaProgressString + QLatin1String("%o/sec] "));
pp->setEnvironment(env);
pp->setWorkingDirectory(bc->buildDirectory());
pp->setWorkingDirectory(bc->buildDirectory().toString());
pp->setCommand(makeCommand(tc, bc->environment()));
pp->setArguments(arguments);
pp->resolveAll();
......@@ -408,7 +408,7 @@ void MakeStepConfigWidget::updateDetails()
ProcessParameters param;
param.setMacroExpander(bc->macroExpander());
param.setEnvironment(bc->environment());
param.setWorkingDirectory(bc->buildDirectory());
param.setWorkingDirectory(bc->buildDirectory().toString());
param.setCommand(m_makeStep->makeCommand(tc, bc->environment()));
param.setArguments(arguments);
m_summaryText = param.summary(displayName());
......
......@@ -359,7 +359,7 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu
if (const Project *project = target->project()) {
sp.projectSourceDirectory = project->projectDirectory();
if (const BuildConfiguration *buildConfig = target->activeBuildConfiguration())
sp.projectBuildDirectory = buildConfig->buildDirectory();
sp.projectBuildDirectory = buildConfig->buildDirectory().toString();
sp.projectSourceFiles = project->files(Project::ExcludeGeneratedFiles);
}
}
......
......@@ -48,7 +48,6 @@ namespace GenericProjectManager {
namespace Internal {
const char GENERIC_BC_ID[] = "GenericProjectManager.GenericBuildConfiguration";
const char BUILD_DIRECTORY_KEY[] = "GenericProjectManager.GenericBuildConfiguration.BuildDirectory";
GenericBuildConfiguration::GenericBuildConfiguration(Target *parent)
: BuildConfiguration(parent, Core::Id(GENERIC_BC_ID))
......@@ -61,50 +60,11 @@ GenericBuildConfiguration::GenericBuildConfiguration(Target *parent, const Core:
}
GenericBuildConfiguration::GenericBuildConfiguration(Target *parent, GenericBuildConfiguration *source) :
BuildConfiguration(parent, source),
m_buildDirectory(source->m_buildDirectory)
BuildConfiguration(parent, source)
{
cloneSteps(source);
}
QVariantMap GenericBuildConfiguration::toMap() const
{
QVariantMap map(BuildConfiguration::toMap());
map.insert(QLatin1String(BUILD_DIRECTORY_KEY), m_buildDirectory);
return map;
}
bool GenericBuildConfiguration::fromMap(const QVariantMap &map)
{
m_buildDirectory = map.value(QLatin1String(BUILD_DIRECTORY_KEY), target()->project()->projectDirectory()).toString();
return BuildConfiguration::fromMap(map);
}
QString GenericBuildConfiguration::buildDirectory() const
{
// Convert to absolute path when necessary
const QDir projectDir(target()->project()->projectDirectory());
return projectDir.absoluteFilePath(m_buildDirectory);
}
/**
* Returns the build directory unmodified, instead of making it absolute like
* buildDirectory() does.
*/
QString GenericBuildConfiguration::rawBuildDirectory() const
{
return m_buildDirectory;
}
void GenericBuildConfiguration::setBuildDirectory(const QString &buildDirectory)
{
if (m_buildDirectory == buildDirectory)
return;
m_buildDirectory = buildDirectory;
emit buildDirectoryChanged();
}
NamedWidget *GenericBuildConfiguration::createConfigWidget()
{
return new GenericBuildSettingsWidget(this);
......@@ -244,13 +204,21 @@ GenericBuildSettingsWidget::GenericBuildSettingsWidget(GenericBuildConfiguration
m_buildConfiguration = bc;
m_pathChooser->setBaseDirectory(bc->target()->project()->projectDirectory());
m_pathChooser->setPath(m_buildConfiguration->rawBuildDirectory());
m_pathChooser->setEnvironment(bc->environment());
m_pathChooser->setPath(m_buildConfiguration->rawBuildDirectory().toString());
setDisplayName(tr("Generic Manager"));
connect(bc, SIGNAL(environmentChanged()), this, SLOT(environmentHasChanged()));
}
void GenericBuildSettingsWidget::buildDirectoryChanged()
{
m_buildConfiguration->setBuildDirectory(m_pathChooser->rawPath());
m_buildConfiguration->setBuildDirectory(Utils::FileName::fromString(m_pathChooser->rawPath()));
}
void GenericBuildSettingsWidget::environmentHasChanged()
{
m_pathChooser->setEnvironment(m_buildConfiguration->environment());
}
} // namespace Internal
......
......@@ -40,6 +40,7 @@ namespace Internal {
class GenericTarget;
class GenericBuildConfigurationFactory;
class GenericBuildSettingsWidget;
class GenericBuildConfiguration : public ProjectExplorer::BuildConfiguration
{
......@@ -50,21 +51,14 @@ public:
explicit GenericBuildConfiguration(ProjectExplorer::Target *parent);
ProjectExplorer::NamedWidget *createConfigWidget();
QString buildDirectory() const;
QString rawBuildDirectory() const;
void setBuildDirectory(const QString &buildDirectory);
QVariantMap toMap() const;
BuildType buildType() const;
protected:
GenericBuildConfiguration(ProjectExplorer::Target *parent, GenericBuildConfiguration *source);
GenericBuildConfiguration(ProjectExplorer::Target *parent, const Core::Id id);
virtual bool fromMap(const QVariantMap