diff --git a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp index 67823d4b68f..64d487aeb4e 100644 --- a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp @@ -39,6 +39,7 @@ #include #include +#include #include #include #include @@ -64,7 +65,17 @@ const char TITLE_KEY[] = "CMakeProjectManager.CMakeRunConfiguation.Title"; CMakeRunConfiguration::CMakeRunConfiguration(Target *target) : RunConfiguration(target) { - addExtraAspect(new LocalEnvironmentAspect(this, LocalEnvironmentAspect::BaseEnvironmentModifier())); + // Workaround for QTCREATORBUG-19354: + auto cmakeRunEnvironmentModifier = [](RunConfiguration *rc, Utils::Environment &env) { + if (!Utils::HostOsInfo::isWindowsHost() || !rc) + return; + + const Kit *k = rc->target()->kit(); + const QtSupport::BaseQtVersion *qt = QtSupport::QtKitInformation::qtVersion(k); + if (qt) + env.prependOrSetPath(qt->qmakeProperty("QT_INSTALL_BINS")); + }; + addExtraAspect(new LocalEnvironmentAspect(this, cmakeRunEnvironmentModifier)); addExtraAspect(new ArgumentsAspect(this, "CMakeProjectManager.CMakeRunConfiguration.Arguments")); addExtraAspect(new TerminalAspect(this, "CMakeProjectManager.CMakeRunConfiguration.UseTerminal")); addExtraAspect(new WorkingDirectoryAspect(this, "CMakeProjectManager.CMakeRunConfiguration.UserWorkingDirectory"));