CMake: fixup env if jom is missing

Add the applitcation dir path to the path environment variable
if jom cannot be found there. This should fix the cannot find
jom error for binary releases since we ship jom with qc.

Fixes: QTCREATORBUG-22645
Change-Id: Ia3b55f794d3ac4b5fd6d2e85cf19f00bd8cddd2c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
David Schulz
2020-04-17 09:06:28 +02:00
parent 2aac4cc07f
commit e3a0fe71e4
2 changed files with 11 additions and 0 deletions

View File

@@ -787,6 +787,16 @@ KitAspectWidget *CMakeGeneratorKitAspect::createConfigWidget(Kit *k) const
return new CMakeGeneratorKitAspectWidget(k, this);
}
void CMakeGeneratorKitAspect::addToEnvironment(const Kit *k, Utils::Environment &env) const
{
GeneratorInfo info = generatorInfo(k);
if (info.generator == "NMake Makefiles JOM") {
if (env.searchInPath("jom.exe").exists())
return;
env.appendOrSetPath(QCoreApplication::applicationDirPath());
}
}
// --------------------------------------------------------------------
// CMakeConfigurationKitAspect:
// --------------------------------------------------------------------

View File

@@ -83,6 +83,7 @@ public:
void upgrade(ProjectExplorer::Kit *k) final;
ItemList toUserOutput(const ProjectExplorer::Kit *k) const final;
ProjectExplorer::KitAspectWidget *createConfigWidget(ProjectExplorer::Kit *k) const final;
void addToEnvironment(const ProjectExplorer::Kit *k, Utils::Environment &env) const final;
private:
QVariant defaultValue(const ProjectExplorer::Kit *k) const;