| /** |
| * Copyright (c) 2020-2021 Robert Bosch GmbH. |
| * |
| * This program and the accompanying materials are made |
| * available under the terms of the Eclipse Public License 2.0 |
| * which is available at https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * Robert Bosch GmbH - initial API and implementation |
| */ |
| |
| package org.eclipse.app4mc.slg.ros2.transformers; |
| |
| import com.google.inject.Inject |
| import org.eclipse.app4mc.amalthea.model.Label |
| import org.eclipse.app4mc.slg.commons.m2t.transformers.LabelTransformer |
| import org.eclipse.app4mc.slg.ros2.generators.RosLabelTranslationUnit |
| import org.eclipse.app4mc.transformation.util.OutputBuffer |
| |
| class RosLabelTransformer extends LabelTransformer { |
| |
| @Inject OutputBuffer outputBuffer |
| |
| static final String LIB_NAME = "LABELS_LIB" |
| |
| override create new RosLabelTranslationUnit(outputBuffer, label) |
| transform(Label label) { |
| } |
| |
| override getCache() { return this._createCache_transform } |
| |
| override createCMake() { |
| outputBuffer.appendTo("OTHER", RosLabelTranslationUnit.MAKEFILE_PATH, toCMake()) |
| } |
| |
| override String toCMake() ''' |
| # «LIB_NAME» ################################################################ |
| #### |
| add_library(«LIB_NAME» STATIC |
| «FOR srcFile : getSrcFiles()» |
| «""» ${CMAKE_CURRENT_LIST_DIR}/_src/«srcFile» |
| «ENDFOR» |
| ) |
| |
| target_include_directories(«LIB_NAME» |
| PUBLIC ${CMAKE_CURRENT_LIST_DIR}/_inc |
| ) |
| ''' |
| |
| } |