blob: 8099bcfa9906357dde0ed68bf193fbcfb6090cef [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.commons.m2t.generators
import java.util.List
class RunnableGenerator {
// Suppress default constructor
private new() {
throw new IllegalStateException("Utility class");
}
static def String toCMake(List<String> srcFiles) '''
# «RunnableTranslationUnit.libName» ################################################################
####
add_library(«RunnableTranslationUnit.libName» STATIC
«FOR srcFile : srcFiles»
${CMAKE_CURRENT_LIST_DIR}/_src/«srcFile»
«ENDFOR»
)
target_include_directories(«RunnableTranslationUnit.libName»
PUBLIC ${CMAKE_CURRENT_LIST_DIR}/_inc
)
target_include_directories(«RunnableTranslationUnit.libName»
PUBLIC ${CMAKE_CURRENT_LIST_DIR}/../ticksUtils/_inc
${CMAKE_CURRENT_LIST_DIR}/../labels/_inc
)
target_link_libraries(RUNNABLES_LIB
PRIVATE LABELS_LIB TICKS_UTILS
)
'''
}