blob: a096e98860938d17220340709594404b1cf7ef67 [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.Runnable
import org.eclipse.app4mc.slg.commons.m2t.transformers.RunnableTransformer
import org.eclipse.app4mc.slg.ros2.generators.RosRunnableTranslationUnit
import org.eclipse.app4mc.transformation.util.OutputBuffer
class RosRunnableTransformer extends RunnableTransformer {
@Inject OutputBuffer outputBuffer
@Inject RosActivityGraphItemTransformer psCallGraphItemTransformer
override create new RosRunnableTranslationUnit(outputBuffer, psCallGraphItemTransformer, runnable)
transform(Runnable runnable) {
}
override getCache() { return this._createCache_transform }
override createCMake() {
outputBuffer.appendTo("OTHER", RosRunnableTranslationUnit.makeFilePathStatic, toCMake())
}
override String toCMake() '''
# «RosRunnableTranslationUnit.libName» ################################################################
####
add_library(«RosRunnableTranslationUnit.libName» STATIC
«FOR srcFile : getSrcFiles»
«""» ${CMAKE_CURRENT_LIST_DIR}/_src/«srcFile»
«ENDFOR»
)
target_include_directories(«RosRunnableTranslationUnit.libName»
PUBLIC ${CMAKE_CURRENT_LIST_DIR}/_inc
)
target_include_directories(«RosRunnableTranslationUnit.libName»
PUBLIC ${CMAKE_CURRENT_LIST_DIR}/../ticksUtils/_inc
${CMAKE_CURRENT_LIST_DIR}/../labels/_inc
${CMAKE_CURRENT_LIST_DIR}/../channelSendUtils/_inc
)
target_link_libraries(RUNNABLES_LIB
PRIVATE LABELS_LIB TICKS_UTILS CHANNELSEND_UTILS
)
'''
}