use of com.jetbrains.cidr.cpp.execution.CMakeAppRunConfiguration in project clion-embedded-arm by elmot.
the class ConvertProject method modifyCMakeConfigs.
private static void modifyCMakeConfigs(Project project, ProjectData projectData) {
RunManager runManager = RunManager.getInstance(project);
@SuppressWarnings("ConstantConditions") ConfigurationFactory factory = runManager.getConfigurationType(OpenOcdConfigurationType.TYPE_ID).getConfigurationFactories()[0];
String name = "OCD " + projectData.getProjectName();
if (runManager.findConfigurationByTypeAndName(OpenOcdConfigurationType.TYPE_ID, name) == null) {
RunnerAndConfigurationSettings newRunConfig = runManager.createRunConfiguration(name, factory);
newRunConfig.setSingleton(true);
((CMakeAppRunConfiguration) newRunConfig.getConfiguration()).setupDefaultTargetAndExecutable();
ApplicationManager.getApplication().invokeLater(() -> ApplicationManager.getApplication().runWriteAction(() -> {
runManager.addConfiguration(newRunConfig);
runManager.makeStable(newRunConfig);
runManager.setSelectedConfiguration(newRunConfig);
}));
}
}
Aggregations