CMakePM: Reuse EnvironmentAspect for CMake configure environment

EnvironmentAspect is used in the Run configuration page.

For a configuration not using presets the "Build Environment" will be
used by default. This is the pre Qt Creator 9 behavior.

With presets "System Environment" is used, which allows the environment
sepparation of configure and build steps.

Fixes: QTCREATORBUG-28513
Change-Id: Ie65c0a5ac67355642460fca9fc618a1d29f4b1bd
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Cristian Adam
2023-01-02 20:03:41 +01:00
parent 567216bb49
commit 83a86bc4fe
5 changed files with 162 additions and 155 deletions

View File

@@ -32,8 +32,14 @@ EnvironmentAspectWidget::EnvironmentAspectWidget(EnvironmentAspect *aspect)
auto baseEnvironmentWidget = new QWidget;
m_baseLayout = new QHBoxLayout(baseEnvironmentWidget);
m_baseLayout->setContentsMargins(0, 0, 0, 0);
auto label = new QLabel(Tr::tr("Base environment for this run configuration:"), this);
m_baseLayout->addWidget(label);
auto label = [aspect]() {
if (aspect->labelText().isEmpty())
aspect->setLabelText(Tr::tr("Base environment for this run configuration:"));
aspect->setupLabel();
return aspect->label();
};
m_baseLayout->addWidget(label());
m_baseEnvironmentComboBox = new QComboBox;
for (const QString &displayName : m_aspect->displayNames())