McuSupport Vendor specific flash/run CMake targets

The build system for QtMCU creates a CMake target
"flash_%1_and_bootloader" for STM targets but not for NXP targets.
Handle that (for now in a dirtry manner) in the run configuration.

In master branch we can add the API needed for the runconfiguration
to retrieve the list of available targets.

Change-Id: If2c9089a5dc004900424041898a6ff426ebb450b
Reviewed-by: Aurindam Jana <aurindam.jana@qt.io>
This commit is contained in:
Alessandro Portale
2019-11-04 18:06:41 +01:00
committed by Aurindam Jana
parent af6ec7943e
commit 096147d96d

View File

@@ -49,11 +49,17 @@ static CommandLine flashAndRunCommand(Target *target)
const CMakeProjectManager::CMakeTool *tool =
CMakeProjectManager::CMakeKitAspect::cmakeTool(target->kit());
// TODO: Hack! Implement flash target name handling, properly
const QString targetName =
target->kit()->value(Constants::KIT_BOARD_VENDOR_KEY).toString() == "NXP"
? QString("flash_%1").arg(projectName)
: QString("flash_%1_and_bootloader").arg(projectName);
return CommandLine(tool->filePath(), {
"--build",
".",
"--target",
QString("flash_%1_and_bootloader").arg(projectName)
targetName
});
}
@@ -63,7 +69,6 @@ FlashAndRunConfiguration::FlashAndRunConfiguration(Target *target, Core::Id id)
auto effectiveFlashAndRunCall = addAspect<BaseStringAspect>();
effectiveFlashAndRunCall->setLabelText(tr("Effective flash and run call:"));
effectiveFlashAndRunCall->setDisplayStyle(BaseStringAspect::TextEditDisplay);
effectiveFlashAndRunCall->setReadOnly(true);
auto updateConfiguration = [target, effectiveFlashAndRunCall] {
effectiveFlashAndRunCall->setValue(flashAndRunCommand(target).toUserOutput());