Add the ability to set a build environment also for CMake projects.

Note: as for qt projects, this is also used for running. And we don't
use it for running cmake yet.
This commit is contained in:
dt
2009-05-26 15:22:11 +02:00
parent 19d3131ef6
commit 0bda19a099
12 changed files with 220 additions and 134 deletions

View File

@@ -698,6 +698,16 @@ Qt4ProFileNode *Qt4Project::rootProjectNode() const
return m_rootProjectNode;
}
QString Qt4Project::buildDirectory(const QString &buildConfiguration) const
{
QString workingDirectory;
if (value(buildConfiguration, "useShadowBuild").toBool())
workingDirectory = value(buildConfiguration, "buildDirectory").toString();
if (workingDirectory.isEmpty())
workingDirectory = QFileInfo(file()->fileName()).absolutePath();
return workingDirectory;
}
ProjectExplorer::Environment Qt4Project::baseEnvironment(const QString &buildConfiguration) const
{
Environment env = useSystemEnvironment(buildConfiguration) ? Environment(QProcess::systemEnvironment()) : Environment();
@@ -712,16 +722,6 @@ ProjectExplorer::Environment Qt4Project::environment(const QString &buildConfigu
return env;
}
QString Qt4Project::buildDirectory(const QString &buildConfiguration) const
{
QString workingDirectory;
if (value(buildConfiguration, "useShadowBuild").toBool())
workingDirectory = value(buildConfiguration, "buildDirectory").toString();
if (workingDirectory.isEmpty())
workingDirectory = QFileInfo(file()->fileName()).absolutePath();
return workingDirectory;
}
void Qt4Project::setUseSystemEnvironment(const QString &buildConfiguration, bool b)
{
setValue(buildConfiguration, "clearSystemEnvironment", !b);
@@ -733,6 +733,16 @@ bool Qt4Project::useSystemEnvironment(const QString &buildConfiguration) const
return b;
}
QList<ProjectExplorer::EnvironmentItem> Qt4Project::userEnvironmentChanges(const QString &buildConfig) const
{
return EnvironmentItem::fromStringList(value(buildConfig, "userEnvironmentChanges").toStringList());
}
void Qt4Project::setUserEnvironmentChanges(const QString &buildConfig, const QList<ProjectExplorer::EnvironmentItem> &diff)
{
setValue(buildConfig, "userEnvironmentChanges", EnvironmentItem::toStringList(diff));
}
QString Qt4Project::qtDir(const QString &buildConfiguration) const
{
QtVersion *version = qtVersion(buildConfiguration);
@@ -802,16 +812,6 @@ QList<BuildStepConfigWidget*> Qt4Project::subConfigWidgets()
return subWidgets;
}
QList<ProjectExplorer::EnvironmentItem> Qt4Project::userEnvironmentChanges(const QString &buildConfig) const
{
return EnvironmentItem::fromStringList(value(buildConfig, "userEnvironmentChanges").toStringList());
}
void Qt4Project::setUserEnvironmentChanges(const QString &buildConfig, const QList<ProjectExplorer::EnvironmentItem> &diff)
{
setValue(buildConfig, "userEnvironmentChanges", EnvironmentItem::toStringList(diff));
}
/// **************************
/// Qt4ProjectBuildConfigWidget
/// **************************