blob: 6ad0d0b9745ccc9c1507b317b9ba2af4956c616e [file] [log] [blame]
/**
* 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
override create new RosLabelTranslationUnit(outputBuffer, label)
transform(Label label) {
}
override getCache() { return this._createCache_transform }
override createCMake() {
outputBuffer.appendTo("OTHER", RosLabelTranslationUnit.makeFilePathStatic, toCMake())
}
override String toCMake() '''
# «RosLabelTranslationUnit.libName» ################################################################
####
add_library(«RosLabelTranslationUnit.libName» STATIC
«FOR srcFile : getSrcFiles()»
«""» ${CMAKE_CURRENT_LIST_DIR}/_src/«srcFile»
«ENDFOR»
)
target_include_directories(«RosLabelTranslationUnit.getLibName()»
PUBLIC ${CMAKE_CURRENT_LIST_DIR}/_inc
)
'''
}