Commit acbd4513 authored by con's avatar con
Browse files

Changing string based api to BuildConfiguration based api.

Builds, but I'm pretty sure it doesn't *work* :)
parent 30362e10
......@@ -69,16 +69,17 @@ QString CMakeBuildEnvironmentWidget::displayName() const
return tr("Build Environment");
}
void CMakeBuildEnvironmentWidget::init(const QString &buildConfiguration)
void CMakeBuildEnvironmentWidget::init(const QString &buildConfigurationName)
{
if (debug)
qDebug() << "Qt4BuildConfigWidget::init()";
m_buildConfiguration = buildConfiguration;
m_buildConfiguration = buildConfigurationName;
m_clearSystemEnvironmentCheckBox->setChecked(!m_pro->useSystemEnvironment(buildConfiguration));
m_buildEnvironmentWidget->setBaseEnvironment(m_pro->baseEnvironment(buildConfiguration));
m_buildEnvironmentWidget->setUserChanges(m_pro->userEnvironmentChanges(buildConfiguration));
ProjectExplorer::BuildConfiguration *bc = m_pro->buildConfiguration(buildConfigurationName);
m_clearSystemEnvironmentCheckBox->setChecked(!m_pro->useSystemEnvironment(bc));
m_buildEnvironmentWidget->setBaseEnvironment(m_pro->baseEnvironment(bc));
m_buildEnvironmentWidget->setUserChanges(m_pro->userEnvironmentChanges(bc));
m_buildEnvironmentWidget->updateButtons();
}
......@@ -89,6 +90,7 @@ void CMakeBuildEnvironmentWidget::environmentModelUserChangesUpdated()
void CMakeBuildEnvironmentWidget::clearSystemEnvironmentCheckBoxClicked(bool checked)
{
m_pro->setUseSystemEnvironment(m_buildConfiguration, !checked);
m_buildEnvironmentWidget->setBaseEnvironment(m_pro->baseEnvironment(m_buildConfiguration));
ProjectExplorer::BuildConfiguration *bc = m_pro->buildConfiguration(m_buildConfiguration);
m_pro->setUseSystemEnvironment(bc, !checked);
m_buildEnvironmentWidget->setBaseEnvironment(m_pro->baseEnvironment(bc));
}
......@@ -48,9 +48,11 @@
#include <QtCore/QProcess>
#include <QtGui/QFormLayout>
#include <QtGui/QMainWindow>
#include <QtGui/QInputDialog>
using namespace CMakeProjectManager;
using namespace CMakeProjectManager::Internal;
using namespace ProjectExplorer;
using ProjectExplorer::Environment;
using ProjectExplorer::EnvironmentItem;
......@@ -63,10 +65,77 @@ using ProjectExplorer::EnvironmentItem;
// Open Questions
// Who sets up the environment for cl.exe ? INCLUDEPATH and so on
/*!
\class CMakeBuildConfigurationFactory
*/
CMakeBuildConfigurationFactory::CMakeBuildConfigurationFactory(CMakeProject *project)
: IBuildConfigurationFactory(project),
m_project(project)
{
}
CMakeBuildConfigurationFactory::~CMakeBuildConfigurationFactory()
{
}
QStringList CMakeBuildConfigurationFactory::availableCreationTypes() const
{
return QStringList() << "Create";
}
QString CMakeBuildConfigurationFactory::displayNameForType(const QString &type) const
{
return tr("Create");
}
QList<BuildConfiguration *> CMakeBuildConfigurationFactory::create(const QString &type) const
{
QTC_ASSERT(type == "Create", return QList<BuildConfiguration*>());
//TODO configuration name should be part of the cmakeopenprojectwizard
bool ok;
QString buildConfigurationName = QInputDialog::getText(0,
tr("New configuration"),
tr("New Configuration Name:"),
QLineEdit::Normal,
QString(),
&ok);
if (!ok || buildConfigurationName.isEmpty())
return QList<BuildConfiguration *>();
BuildConfiguration *bc = new BuildConfiguration(buildConfigurationName);
// Default to all
//TODO the buildConfigurationName has not been made unique yet
if (m_project->targets().contains("all"))
m_project->makeStep()->setBuildTarget(buildConfigurationName, "all", true);
CMakeOpenProjectWizard copw(m_project->projectManager(),
m_project->sourceDirectory(),
m_project->buildDirectory(bc),
m_project->environment(bc));
if (copw.exec() != QDialog::Accepted) {
delete bc;
return QList<BuildConfiguration *>();
}
bc->setValue("buildDirectory", copw.buildDirectory());
bc->setValue("msvcVersion", copw.msvcVersion());
m_project->parseCMakeLists();
return QList<BuildConfiguration *>() << bc;
}
QList<BuildConfiguration *> CMakeBuildConfigurationFactory::createDefaultConfigurations() const
{
return QList<BuildConfiguration *>() << new BuildConfiguration;
}
/*!
\class CMakeProject
*/
CMakeProject::CMakeProject(CMakeManager *manager, const QString &fileName)
: m_manager(manager),
m_fileName(fileName),
m_buildConfigurationFactory(new CMakeBuildConfigurationFactory(this)),
m_rootNode(new CMakeProjectNode(m_fileName)),
m_toolChain(0),
m_insideFileChanged(false)
......@@ -80,12 +149,18 @@ CMakeProject::~CMakeProject()
delete m_toolChain;
}
IBuildConfigurationFactory *CMakeProject::buildConfigurationFactory() const
{
return m_buildConfigurationFactory;
}
void CMakeProject::slotActiveBuildConfiguration()
{
BuildConfiguration *activeBC = activeBuildConfiguration();
// Pop up a dialog asking the user to rerun cmake
QFileInfo sourceFileInfo(m_fileName);
QString cbpFile = CMakeManager::findCbpFile(QDir(buildDirectory(activeBuildConfiguration())));
QString cbpFile = CMakeManager::findCbpFile(QDir(buildDirectory(activeBC)));
QFileInfo cbpFileFi(cbpFile);
CMakeOpenProjectWizard::Mode mode = CMakeOpenProjectWizard::Nothing;
if (!cbpFileFi.exists()) {
......@@ -102,11 +177,11 @@ void CMakeProject::slotActiveBuildConfiguration()
if (mode != CMakeOpenProjectWizard::Nothing) {
CMakeOpenProjectWizard copw(m_manager,
sourceFileInfo.absolutePath(),
buildDirectory(activeBuildConfiguration()),
buildDirectory(activeBC),
mode,
environment(activeBuildConfiguration()));
environment(activeBC));
copw.exec();
setValue(activeBuildConfiguration(), "msvcVersion", copw.msvcVersion());
activeBC->setValue("msvcVersion", copw.msvcVersion());
}
// reparse
parseCMakeLists();
......@@ -133,7 +208,7 @@ void CMakeProject::updateToolChain(const QString &compiler)
newToolChain = ProjectExplorer::ToolChain::createGccToolChain("gcc");
#endif
} else if (compiler == "msvc8") {
newToolChain = ProjectExplorer::ToolChain::createMSVCToolChain(value(activeBuildConfiguration(), "msvcVersion").toString(), false);
newToolChain = ProjectExplorer::ToolChain::createMSVCToolChain(activeBuildConfiguration()->value("msvcVersion").toString(), false);
} else {
// TODO other toolchains
qDebug()<<"Not implemented yet!!! Qt Creator doesn't know which toolchain to use for"<<compiler;
......@@ -148,16 +223,16 @@ void CMakeProject::updateToolChain(const QString &compiler)
}
}
ProjectExplorer::ToolChain *CMakeProject::toolChain(const QString &buildConfiguration) const
ProjectExplorer::ToolChain *CMakeProject::toolChain(BuildConfiguration *configuration) const
{
if (buildConfiguration != activeBuildConfiguration())
if (configuration != activeBuildConfiguration())
qWarning()<<"CMakeProject asked for toolchain of a not active buildconfiguration";
return m_toolChain;
}
void CMakeProject::changeBuildDirectory(const QString &buildConfiguration, const QString &newBuildDirectory)
void CMakeProject::changeBuildDirectory(BuildConfiguration *configuration, const QString &newBuildDirectory)
{
setValue(buildConfiguration, "buildDirectory", newBuildDirectory);
configuration->setValue("buildDirectory", newBuildDirectory);
parseCMakeLists();
}
......@@ -176,7 +251,7 @@ bool CMakeProject::parseCMakeLists()
CMakeCbpParser cbpparser;
// Parsing
//qDebug()<<"Parsing file "<<cbpFile;
if (cbpparser.parseCbpFile(cbpFile)) {
if (cbpparser.parseCbpFile(cbpFile)) {
// ToolChain
updateToolChain(cbpparser.compilerName());
......@@ -317,11 +392,11 @@ bool CMakeProject::parseCMakeLists()
return true;
}
QString CMakeProject::buildParser(const QString &buildConfiguration) const
QString CMakeProject::buildParser(BuildConfiguration *configuration) const
{
Q_UNUSED(buildConfiguration)
Q_UNUSED(configuration)
// TODO this is actually slightly wrong, but do i care?
// this should call toolchain(buildConfiguration)
// this should call toolchain(configuration)
if (!m_toolChain)
return QString::null;
if (m_toolChain->type() == ProjectExplorer::ToolChain::GCC
......@@ -476,36 +551,37 @@ bool CMakeProject::isApplication() const
return true;
}
ProjectExplorer::Environment CMakeProject::baseEnvironment(const QString &buildConfiguration) const
ProjectExplorer::Environment CMakeProject::baseEnvironment(BuildConfiguration *configuration) const
{
Environment env = useSystemEnvironment(buildConfiguration) ? Environment(QProcess::systemEnvironment()) : Environment();
Environment env = useSystemEnvironment(configuration) ? Environment(QProcess::systemEnvironment()) : Environment();
return env;
}
ProjectExplorer::Environment CMakeProject::environment(const QString &buildConfiguration) const
ProjectExplorer::Environment CMakeProject::environment(BuildConfiguration *configuration) const
{
Environment env = baseEnvironment(buildConfiguration);
env.modify(userEnvironmentChanges(buildConfiguration));
Environment env = baseEnvironment(configuration);
env.modify(userEnvironmentChanges(configuration));
return env;
}
void CMakeProject::setUseSystemEnvironment(const QString &buildConfiguration, bool b)
void CMakeProject::setUseSystemEnvironment(BuildConfiguration *configuration, bool b)
{
if (b == useSystemEnvironment(buildConfiguration))
if (b == useSystemEnvironment(configuration))
return;
setValue(buildConfiguration, "clearSystemEnvironment", !b);
emit environmentChanged(buildConfiguration);
configuration->setValue("clearSystemEnvironment", !b);
emit environmentChanged(configuration->name());
}
bool CMakeProject::useSystemEnvironment(const QString &buildConfiguration) const
bool CMakeProject::useSystemEnvironment(BuildConfiguration *configuration) const
{
bool b = !(value(buildConfiguration, "clearSystemEnvironment").isValid() && value(buildConfiguration, "clearSystemEnvironment").toBool());
bool b = !(configuration->value("clearSystemEnvironment").isValid() &&
configuration->value("clearSystemEnvironment").toBool());
return b;
}
QList<ProjectExplorer::EnvironmentItem> CMakeProject::userEnvironmentChanges(const QString &buildConfig) const
QList<ProjectExplorer::EnvironmentItem> CMakeProject::userEnvironmentChanges(BuildConfiguration *configuration) const
{
return EnvironmentItem::fromStringList(value(buildConfig, "userEnvironmentChanges").toStringList());
return EnvironmentItem::fromStringList(configuration->value("userEnvironmentChanges").toStringList());
}
void CMakeProject::setUserEnvironmentChanges(const QString &buildConfig, const QList<ProjectExplorer::EnvironmentItem> &diff)
......@@ -517,9 +593,9 @@ void CMakeProject::setUserEnvironmentChanges(const QString &buildConfig, const Q
emit environmentChanged(buildConfig);
}
QString CMakeProject::buildDirectory(const QString &buildConfiguration) const
QString CMakeProject::buildDirectory(BuildConfiguration *configuration) const
{
QString buildDirectory = value(buildConfiguration, "buildDirectory").toString();
QString buildDirectory = configuration->value("buildDirectory").toString();
if (buildDirectory.isEmpty())
buildDirectory = sourceDirectory() + "/qtcreator-build";
return buildDirectory;
......@@ -537,21 +613,21 @@ QList<ProjectExplorer::BuildConfigWidget*> CMakeProject::subConfigWidgets()
return list;
}
bool CMakeProject::newBuildConfiguration(const QString &buildConfiguration)
{
// Default to all
if (targets().contains("all"))
makeStep()->setBuildTarget(buildConfiguration, "all", true);
CMakeOpenProjectWizard copw(projectManager(), sourceDirectory(), buildDirectory(buildConfiguration), environment(buildConfiguration));
if (copw.exec() == QDialog::Accepted) {
setValue(buildConfiguration, "buildDirectory", copw.buildDirectory());
setValue(buildConfiguration, "msvcVersion", copw.msvcVersion());
parseCMakeLists();
return true;
}
return false;
}
// bool CMakeProject::newBuildConfiguration(const QString &buildConfiguration)
// {
// // Default to all
// if (targets().contains("all"))
// makeStep()->setBuildTarget(buildConfiguration, "all", true);
//
// CMakeOpenProjectWizard copw(projectManager(), sourceDirectory(), buildDirectory(buildConfiguration), environment(buildConfiguration));
// if (copw.exec() == QDialog::Accepted) {
// setValue(buildConfiguration, "buildDirectory", copw.buildDirectory());
// setValue(buildConfiguration, "msvcVersion", copw.msvcVersion());
// parseCMakeLists();
// return true;
// }
// return false;
// }
ProjectExplorer::ProjectNode *CMakeProject::rootProjectNode() const
{
......@@ -600,23 +676,25 @@ bool CMakeProject::restoreSettingsImpl(ProjectExplorer::PersistentSettingsReader
insertBuildStep(0, makeStep);
addBuildConfiguration("all");
setValue("all", "msvcVersion", copw.msvcVersion());
ProjectExplorer::BuildConfiguration *bc = new ProjectExplorer::BuildConfiguration("all");
addBuildConfiguration(bc);
setValue(bc->name(), "msvcVersion", copw.msvcVersion());
if (!copw.buildDirectory().isEmpty())
setValue("all", "buildDirectory", copw.buildDirectory());
setValue(bc->name(), "buildDirectory", copw.buildDirectory());
//TODO save arguments somewhere copw.arguments()
MakeStep *cleanMakeStep = new MakeStep(this);
insertCleanStep(0, cleanMakeStep);
cleanMakeStep->setValue("clean", true);
setActiveBuildConfiguration("all");
setActiveBuildConfiguration(bc);
} else {
// We have a user file, but we could still be missing the cbp file
// or simply run createXml with the saved settings
QFileInfo sourceFileInfo(m_fileName);
QStringList needToCreate;
QStringList needToUpdate;
QString cbpFile = CMakeManager::findCbpFile(QDir(buildDirectory(activeBuildConfiguration())));
BuildConfiguration *activeBC = activeBuildConfiguration();
QString cbpFile = CMakeManager::findCbpFile(QDir(buildDirectory(activeBC)));
QFileInfo cbpFileFi(cbpFile);
CMakeOpenProjectWizard::Mode mode = CMakeOpenProjectWizard::Nothing;
......@@ -628,11 +706,11 @@ bool CMakeProject::restoreSettingsImpl(ProjectExplorer::PersistentSettingsReader
if (mode != CMakeOpenProjectWizard::Nothing) {
CMakeOpenProjectWizard copw(m_manager,
sourceFileInfo.absolutePath(),
buildDirectory(activeBuildConfiguration()),
buildDirectory(activeBC),
mode,
environment(activeBuildConfiguration()));
environment(activeBC));
copw.exec();
setValue(activeBuildConfiguration(), "msvcVersion", copw.msvcVersion());
activeBC->setValue("msvcVersion", copw.msvcVersion());
}
}
......@@ -752,11 +830,12 @@ QString CMakeBuildSettingsWidget::displayName() const
return "CMake";
}
void CMakeBuildSettingsWidget::init(const QString &buildConfiguration)
void CMakeBuildSettingsWidget::init(const QString &buildConfigurationName)
{
m_buildConfiguration = buildConfiguration;
m_pathLineEdit->setText(m_project->buildDirectory(buildConfiguration));
if (m_project->buildDirectory(buildConfiguration) == m_project->sourceDirectory())
m_buildConfiguration = buildConfigurationName;
BuildConfiguration *bc = m_project->buildConfiguration(buildConfigurationName);
m_pathLineEdit->setText(m_project->buildDirectory(bc));
if (m_project->buildDirectory(bc) == m_project->sourceDirectory())
m_changeButton->setEnabled(false);
else
m_changeButton->setEnabled(true);
......@@ -764,13 +843,14 @@ void CMakeBuildSettingsWidget::init(const QString &buildConfiguration)
void CMakeBuildSettingsWidget::openChangeBuildDirectoryDialog()
{
BuildConfiguration *bc = m_project->buildConfiguration(m_buildConfiguration);
CMakeOpenProjectWizard copw(m_project->projectManager(),
m_project->sourceDirectory(),
m_project->buildDirectory(m_buildConfiguration),
m_project->environment(m_buildConfiguration));
m_project->buildDirectory(bc),
m_project->environment(bc));
if (copw.exec() == QDialog::Accepted) {
m_project->changeBuildDirectory(m_buildConfiguration, copw.buildDirectory());
m_pathLineEdit->setText(m_project->buildDirectory(m_buildConfiguration));
m_project->changeBuildDirectory(bc, copw.buildDirectory());
m_pathLineEdit->setText(m_project->buildDirectory(bc));
}
}
......
......@@ -39,6 +39,7 @@
#include <projectexplorer/buildstep.h>
#include <projectexplorer/toolchain.h>
#include <projectexplorer/filewatcher.h>
#include <projectexplorer/buildconfiguration.h>
#include <coreplugin/ifile.h>
#include <QtCore/QXmlStreamReader>
......@@ -49,6 +50,7 @@ namespace CMakeProjectManager {
namespace Internal {
class CMakeFile;
class CMakeBuildSettingsWidget;
struct CMakeTarget
{
......@@ -60,7 +62,23 @@ struct CMakeTarget
void clear();
};
class CMakeBuildSettingsWidget;
class CMakeBuildConfigurationFactory : public ProjectExplorer::IBuildConfigurationFactory
{
Q_OBJECT
public:
CMakeBuildConfigurationFactory(CMakeProject *project);
~CMakeBuildConfigurationFactory();
QStringList availableCreationTypes() const;
QString displayNameForType(const QString &type) const;
QList<ProjectExplorer::BuildConfiguration *> create(const QString &type) const;
QList<ProjectExplorer::BuildConfiguration *> createDefaultConfigurations() const;
private:
CMakeProject *m_project;
};
class CMakeProject : public ProjectExplorer::Project
{
......@@ -73,6 +91,7 @@ public:
virtual QString name() const;
virtual Core::IFile *file() const;
virtual ProjectExplorer::IBuildConfigurationFactory *buildConfigurationFactory() const;
virtual CMakeManager *projectManager() const;
virtual QList<ProjectExplorer::Project *> dependsOn(); //NBS TODO implement dependsOn
......@@ -80,47 +99,43 @@ public:
virtual bool isApplication() const;
//building environment
ProjectExplorer::Environment environment(const QString &buildConfiguration) const;
ProjectExplorer::Environment baseEnvironment(const QString &buildConfiguration) const;
ProjectExplorer::Environment environment(ProjectExplorer::BuildConfiguration *configuration) const;
ProjectExplorer::Environment baseEnvironment(ProjectExplorer::BuildConfiguration *configuration) const;
void setUserEnvironmentChanges(const QString &buildConfig, const QList<ProjectExplorer::EnvironmentItem> &diff);
QList<ProjectExplorer::EnvironmentItem> userEnvironmentChanges(const QString &buildConfig) const;
bool useSystemEnvironment(const QString &buildConfiguration) const;
void setUseSystemEnvironment(const QString &buildConfiguration, bool b);
QList<ProjectExplorer::EnvironmentItem> userEnvironmentChanges(ProjectExplorer::BuildConfiguration *configuration) const;
bool useSystemEnvironment(ProjectExplorer::BuildConfiguration *configuration) const;
void setUseSystemEnvironment(ProjectExplorer::BuildConfiguration *configuration, bool b);
virtual QString buildDirectory(const QString &buildConfiguration) const;
virtual QString buildDirectory(ProjectExplorer::BuildConfiguration *configuration) const;
virtual ProjectExplorer::BuildConfigWidget *createConfigWidget();
virtual QList<ProjectExplorer::BuildConfigWidget*> subConfigWidgets();
// This method is called for new build configurations
// You should probably set some default values in this method
virtual bool newBuildConfiguration(const QString &buildConfiguration);
virtual ProjectExplorer::ProjectNode *rootProjectNode() const;
virtual QStringList files(FilesMode fileMode) const;
MakeStep *makeStep() const;
QStringList targets() const;
QString buildParser(const QString &buildConfiguration) const;
QString buildParser(ProjectExplorer::BuildConfiguration *configuration) const;
CMakeTarget targetForTitle(const QString &title);
QString sourceDirectory() const;
ProjectExplorer::ToolChain::ToolChainType toolChainType() const;
ProjectExplorer::ToolChain *toolChain(const QString &buildConfiguration) const;
ProjectExplorer::ToolChain *toolChain(ProjectExplorer::BuildConfiguration *configuration) const;
bool parseCMakeLists();
protected:
virtual void saveSettingsImpl(ProjectExplorer::PersistentSettingsWriter &writer);
virtual bool restoreSettingsImpl(ProjectExplorer::PersistentSettingsReader &reader);
// called by CMakeBuildSettingsWidget
void changeBuildDirectory(const QString &buildConfiguration, const QString &newBuildDirectory);
void changeBuildDirectory(ProjectExplorer::BuildConfiguration *configuration, const QString &newBuildDirectory);
private slots:
void fileChanged(const QString &fileName);
void slotActiveBuildConfiguration();
private:
bool parseCMakeLists();
void updateToolChain(const QString &compiler);
void buildTree(CMakeProjectNode *rootNode, QList<ProjectExplorer::FileNode *> list);
......@@ -131,6 +146,7 @@ private:
QString m_fileName;
CMakeFile *m_file;
QString m_projectName;
CMakeBuildConfigurationFactory *m_buildConfigurationFactory;
// TODO probably need a CMake specific node structure
CMakeProjectNode *m_rootNode;
......
......@@ -187,7 +187,6 @@ ProjectExplorer::Environment CMakeRunConfiguration::baseEnvironment() const
} else if (m_baseEnvironmentBase == CMakeRunConfiguration::SystemEnvironmentBase) {
env = ProjectExplorer::Environment::systemEnvironment();
} else if (m_baseEnvironmentBase == CMakeRunConfiguration::BuildEnvironmentBase) {
QString config = project()->activeBuildConfiguration();
env = project()->environment(project()->activeBuildConfiguration());
}
return env;
......
......@@ -54,12 +54,13 @@ MakeStep::~MakeStep()
bool MakeStep::init(const QString &buildConfiguration)
{
setBuildParser(m_pro->buildParser(buildConfiguration));
ProjectExplorer::BuildConfiguration *bc = m_pro->buildConfiguration(buildConfiguration);
setBuildParser(m_pro->buildParser(bc));
setEnabled(buildConfiguration, true);
setWorkingDirectory(buildConfiguration, m_pro->buildDirectory(buildConfiguration));
setWorkingDirectory(buildConfiguration, m_pro->buildDirectory(bc));
setCommand(buildConfiguration, m_pro->toolChain(buildConfiguration)->makeCommand());
setCommand(buildConfiguration, m_pro->toolChain(bc)->makeCommand());
if (!value(buildConfiguration, "cleanConfig").isValid() &&value("clean").isValid() && value("clean").toBool()) {
// Import old settings
......@@ -70,7 +71,7 @@ bool MakeStep::init(const QString &buildConfiguration)
QStringList arguments = value(buildConfiguration, "buildTargets").toStringList();
arguments << additionalArguments(buildConfiguration);
setArguments(buildConfiguration, arguments); // TODO
setEnvironment(buildConfiguration, m_pro->environment(buildConfiguration));
setEnvironment(buildConfiguration, m_pro->environment(bc));
setIgnoreReturnValue(buildConfiguration, value(buildConfiguration, "cleanConfig").isValid());
return AbstractMakeStep::init(buildConfiguration);
......@@ -225,7 +226,9 @@ void MakeStepConfigWidget::updateDetails()
QStringList arguments = m_makeStep->value(m_buildConfiguration, "buildTargets").toStringList();
arguments << m_makeStep->additionalArguments(m_buildConfiguration);
m_summaryText = tr("<b>Make:</b> %1 %2")
.arg(m_makeStep->project()->toolChain(m_buildConfiguration)->makeCommand(),
.arg(m_makeStep->project()->toolChain(
m_makeStep->project()->buildConfiguration(m_buildConfiguration))
->makeCommand(),
arguments.join(" "));
emit updateSummary();
}
......
......@@ -56,23 +56,24 @@ GenericMakeStep::~GenericMakeStep()
{
}
bool GenericMakeStep::init(const QString &buildConfiguration)
bool GenericMakeStep::init(const QString &buildConfigurationName)
{
const QString buildParser = m_pro->buildParser(buildConfiguration);
ProjectExplorer::BuildConfiguration *bc = m_pro->buildConfiguration(buildConfigurationName);
const QString buildParser = m_pro->buildParser(bc);
setBuildParser(buildParser);
qDebug() << "*** build parser:" << buildParser;
setEnabled(buildConfiguration, true);
setEnabled(buildConfigurationName, true);
Core::VariableManager *vm = Core::VariableManager::instance();
const QString rawBuildDir = m_pro->buildDirectory(buildConfiguration);
const QString rawBuildDir = m_pro->buildDirectory(bc);
const QString buildDir = vm->resolve(rawBuildDir);
setWorkingDirectory(buildConfiguration, buildDir);
setWorkingDirectory(buildConfigurationName, buildDir);
setCommand(buildConfiguration, makeCommand(buildConfiguration));
setArguments(buildConfiguration, replacedArguments(buildConfiguration));
setCommand(buildConfigurationName, makeCommand(buildConfigurationName));
setArguments(buildConfigurationName, replacedArguments(buildConfigurationName));
setEnvironment(buildConfiguration, m_pro->environment(buildConfiguration));
return AbstractMakeStep::init(buildConfiguration);
setEnvironment(buildConfigurationName, m_pro->environment(bc));
return AbstractMakeStep::init(buildConfigurationName);
}
QStringList GenericMakeStep::replacedArguments(const QString &buildConfiguration) const
......