ProjectExplorer: Let users provide project-specific environment

Add a new project panel where users can set environment variables for
the current project in all configurations.

Fixes: QTCREATORBUG-21862
Change-Id: Id98c7f1cf579927a8004a63172f193f943556f44
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2019-12-10 17:09:49 +01:00
parent 0dbe6f8e3c
commit 6e0d44b0ff
6 changed files with 70 additions and 4 deletions

View File

@@ -116,6 +116,8 @@ BuildConfiguration::BuildConfiguration(Target *target, Core::Id id)
this, &BuildConfiguration::updateCacheAndEmitEnvironmentChanged);
connect(this, &BuildConfiguration::environmentChanged,
this, &BuildConfiguration::emitBuildDirectoryChanged);
connect(target->project(), &Project::environmentChanged,
this, &BuildConfiguration::environmentChanged);
// Many macroexpanders are based on the current project, so they may change the environment:
connect(ProjectTree::instance(), &ProjectTree::currentProjectChanged,
this, &BuildConfiguration::updateCacheAndEmitEnvironmentChanged);
@@ -343,6 +345,7 @@ Utils::Environment BuildConfiguration::baseEnvironment() const
result = Utils::Environment::systemEnvironment();
addToEnvironment(result);
target()->kit()->addToEnvironment(result);
result.modify(project()->additionalEnvironment());
return result;
}