forked from qt-creator/qt-creator
McuSupport: Expand variables for automatic kits
An MCU kit that is created automatically also requires variable expansion before the kit is generated. The same preparation for the variables will be done as the MCU option page. Task-number: UL-6603 Change-Id: I915f6f6e8c6e2a90409c527951e469c555002cff Reviewed-by: Rainer Keller <Rainer.Keller@qt.io> Reviewed-by: Yasser Grimes <yasser.grimes@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -527,6 +527,8 @@ void createAutomaticKits(const SettingsHandler::Ptr &settingsHandler)
|
|||||||
}
|
}
|
||||||
|
|
||||||
McuSdkRepository repo{targetsAndPackages(qtForMCUsPackage, settingsHandler)};
|
McuSdkRepository repo{targetsAndPackages(qtForMCUsPackage, settingsHandler)};
|
||||||
|
McuSdkRepository::updateQtDirMacro(qtForMCUsPackage->path());
|
||||||
|
repo.expandVariablesAndWildcards();
|
||||||
|
|
||||||
bool needsUpgrade = false;
|
bool needsUpgrade = false;
|
||||||
for (const auto &target : std::as_const(repo.mcuTargets)) {
|
for (const auto &target : std::as_const(repo.mcuTargets)) {
|
||||||
|
@@ -77,6 +77,15 @@ Macros *McuSdkRepository::globalMacros()
|
|||||||
return ¯os;
|
return ¯os;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void McuSdkRepository::updateQtDirMacro(const FilePath &qulDir)
|
||||||
|
{
|
||||||
|
// register the Qt installation directory containing Qul dir
|
||||||
|
auto qtPath = (qulDir / "../..").cleanPath();
|
||||||
|
if (qtPath.exists()) {
|
||||||
|
globalMacros()->insert("QtDir", [qtPathString = qtPath.path()] { return qtPathString; });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void McuSdkRepository::expandVariablesAndWildcards()
|
void McuSdkRepository::expandVariablesAndWildcards()
|
||||||
{
|
{
|
||||||
for (const auto &target : std::as_const(mcuTargets)) {
|
for (const auto &target : std::as_const(mcuTargets)) {
|
||||||
@@ -198,13 +207,7 @@ bool McuSupportOptions::isLegacyVersion(const QVersionNumber &version)
|
|||||||
|
|
||||||
void McuSupportOptions::setQulDir(const FilePath &path)
|
void McuSupportOptions::setQulDir(const FilePath &path)
|
||||||
{
|
{
|
||||||
//register the Qt installation directory containing Qul dir
|
McuSdkRepository::updateQtDirMacro(path);
|
||||||
auto qtPath = (path / "../..").cleanPath();
|
|
||||||
if (qtPath.exists()) {
|
|
||||||
McuSdkRepository::globalMacros()->insert("QtDir", [qtPathString = qtPath.path()] {
|
|
||||||
return qtPathString;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
qtForMCUsSdkPackage->updateStatus();
|
qtForMCUsSdkPackage->updateStatus();
|
||||||
if (qtForMCUsSdkPackage->isValidStatus())
|
if (qtForMCUsSdkPackage->isValidStatus())
|
||||||
sdkRepository = targetsAndPackages(qtForMCUsSdkPackage, settingsHandler);
|
sdkRepository = targetsAndPackages(qtForMCUsSdkPackage, settingsHandler);
|
||||||
|
@@ -40,6 +40,7 @@ public:
|
|||||||
Targets mcuTargets;
|
Targets mcuTargets;
|
||||||
Packages packages;
|
Packages packages;
|
||||||
|
|
||||||
|
static void updateQtDirMacro(const Utils::FilePath &qulDir);
|
||||||
void expandVariablesAndWildcards();
|
void expandVariablesAndWildcards();
|
||||||
MacroExpanderPtr getMacroExpander(const McuTarget &target);
|
MacroExpanderPtr getMacroExpander(const McuTarget &target);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user