forked from qt-creator/qt-creator
CMakePM: Expand CMake preset macros also for environment vars
This fixes the case when a CMake variable (CMAKE_PREFIX_PATH) would
reference an environment variable (qt_path) that would contain a CMake
preset macro (${sourceDir}/../qt_install).
Fixes: QTCREATORBUG-28606
Change-Id: Ib6239b13782b2ea854969547af46c3fe82a061f4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -144,6 +144,9 @@ void expand(const PresetType &preset,
|
||||
return env.value(macroName);
|
||||
});
|
||||
|
||||
// Make sure to expand the CMake macros also for environment variables
|
||||
expandAllButEnv(preset, sourceDirectory, value);
|
||||
|
||||
if (append)
|
||||
env.appendOrSet(key, value, sep);
|
||||
else
|
||||
@@ -182,6 +185,9 @@ void expand(const PresetType &preset,
|
||||
return QString("${%1}").arg(macroName);
|
||||
});
|
||||
|
||||
// Make sure to expand the CMake macros also for environment variables
|
||||
expandAllButEnv(preset, sourceDirectory, value);
|
||||
|
||||
envItems.emplace_back(Utils::EnvironmentItem(key, value, operation));
|
||||
}
|
||||
}
|
||||
@@ -202,6 +208,9 @@ void expand(const PresetType &preset,
|
||||
value = expandMacroEnv("penv", value, [env](const QString ¯oName) {
|
||||
return env.value(macroName);
|
||||
});
|
||||
|
||||
// Make sure to expand the CMake macros also for environment variables
|
||||
expandAllButEnv(preset, sourceDirectory, value);
|
||||
}
|
||||
|
||||
void updateToolchainFile(
|
||||
|
||||
Reference in New Issue
Block a user