forked from qt-creator/qt-creator
Unification of desktop run configurations, step 6
Move special CMake environment modification to CMakeBuildConfiguration. Change-Id: I27f886db48d8c036f2f77f5ae8f239b405cb5721 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -48,6 +48,8 @@
|
|||||||
#include <projectexplorer/projectmacroexpander.h>
|
#include <projectexplorer/projectmacroexpander.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
|
|
||||||
|
#include <qtsupport/qtkitinformation.h>
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/mimetypes/mimedatabase.h>
|
#include <utils/mimetypes/mimedatabase.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
@@ -275,6 +277,18 @@ const QList<BuildTargetInfo> CMakeBuildConfiguration::appTargets() const
|
|||||||
bti.projectFilePath = ct.sourceDirectory.stringAppended("/");
|
bti.projectFilePath = ct.sourceDirectory.stringAppended("/");
|
||||||
bti.workingDirectory = ct.workingDirectory;
|
bti.workingDirectory = ct.workingDirectory;
|
||||||
bti.buildKey = ct.title;
|
bti.buildKey = ct.title;
|
||||||
|
|
||||||
|
// Workaround for QTCREATORBUG-19354:
|
||||||
|
bti.runEnvModifier = [this](Environment &env, bool) {
|
||||||
|
if (HostOsInfo::isWindowsHost()) {
|
||||||
|
const Kit *k = target()->kit();
|
||||||
|
if (const QtSupport::BaseQtVersion *qt = QtSupport::QtKitAspect::qtVersion(k)) {
|
||||||
|
const QString installBinPath = qt->qmakeProperty("QT_INSTALL_BINS");
|
||||||
|
env.prependOrSetPath(installBinPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
appTargetList.append(bti);
|
appTargetList.append(bti);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,6 @@
|
|||||||
|
|
||||||
#include "desktoprunconfiguration.h"
|
#include "desktoprunconfiguration.h"
|
||||||
|
|
||||||
#include "qtkitinformation.h"
|
|
||||||
#include "qtoutputformatter.h"
|
#include "qtoutputformatter.h"
|
||||||
|
|
||||||
#include <projectexplorer/localenvironmentaspect.h>
|
#include <projectexplorer/localenvironmentaspect.h>
|
||||||
@@ -74,23 +73,13 @@ DesktopRunConfiguration::DesktopRunConfiguration(Target *target, Core::Id id, Ki
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_kind == Qmake) {
|
envAspect->addModifier([this, libAspect](Environment &env) {
|
||||||
|
|
||||||
envAspect->addModifier([this](Environment &env) {
|
|
||||||
BuildTargetInfo bti = buildTargetInfo();
|
BuildTargetInfo bti = buildTargetInfo();
|
||||||
if (bti.runEnvModifier)
|
if (bti.runEnvModifier)
|
||||||
bti.runEnvModifier(env, aspect<UseLibraryPathsAspect>()->value());
|
bti.runEnvModifier(env, libAspect->value());
|
||||||
});
|
});
|
||||||
|
|
||||||
} else if (kind == Qbs) {
|
if (kind == Qbs) {
|
||||||
|
|
||||||
envAspect->addModifier([this](Environment &env) {
|
|
||||||
bool usingLibraryPaths = aspect<UseLibraryPathsAspect>()->value();
|
|
||||||
|
|
||||||
BuildTargetInfo bti = buildTargetInfo();
|
|
||||||
if (bti.runEnvModifier)
|
|
||||||
bti.runEnvModifier(env, usingLibraryPaths);
|
|
||||||
});
|
|
||||||
|
|
||||||
connect(project(), &Project::parsingFinished,
|
connect(project(), &Project::parsingFinished,
|
||||||
envAspect, &EnvironmentAspect::environmentChanged);
|
envAspect, &EnvironmentAspect::environmentChanged);
|
||||||
@@ -107,17 +96,6 @@ DesktopRunConfiguration::DesktopRunConfiguration(Target *target, Core::Id id, Ki
|
|||||||
|
|
||||||
libAspect->setVisible(false);
|
libAspect->setVisible(false);
|
||||||
|
|
||||||
// Workaround for QTCREATORBUG-19354:
|
|
||||||
if (HostOsInfo::isWindowsHost()) {
|
|
||||||
envAspect->addModifier([target](Environment &env) {
|
|
||||||
const Kit *k = target->kit();
|
|
||||||
if (const QtSupport::BaseQtVersion *qt = QtSupport::QtKitAspect::qtVersion(k)) {
|
|
||||||
const QString installBinPath = qt->qmakeProperty("QT_INSTALL_BINS");
|
|
||||||
env.prependOrSetPath(installBinPath);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setOutputFormatter<QtSupport::QtOutputFormatter>();
|
setOutputFormatter<QtSupport::QtOutputFormatter>();
|
||||||
|
|||||||
Reference in New Issue
Block a user