Use generated cmake for cpp projects

parent 0c204286
Pipeline #67933 failed with stages
in 3 minutes and 15 seconds
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<groupId>de.monticore.lang.monticar</groupId> <groupId>de.monticore.lang.monticar</groupId>
<artifactId>embedded-montiarc-math-middleware-generator</artifactId> <artifactId>embedded-montiarc-math-middleware-generator</artifactId>
<version>0.0.6-SNAPSHOT</version> <version>0.0.7-SNAPSHOT</version>
<!-- == PROJECT DEPENDENCIES ============================================= --> <!-- == PROJECT DEPENDENCIES ============================================= -->
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<!-- .. SE-Libraries .................................................. --> <!-- .. SE-Libraries .................................................. -->
<se-commons.version>1.7.7</se-commons.version> <se-commons.version>1.7.7</se-commons.version>
<Embedded-montiarc-math-generator.version>0.0.18-SNAPSHOT</Embedded-montiarc-math-generator.version> <Embedded-montiarc-math-generator.version>0.0.25-SNAPSHOT</Embedded-montiarc-math-generator.version>
<Embedded-montiarc-math-roscpp-generator.version>0.0.4-SNAPSHOT</Embedded-montiarc-math-roscpp-generator.version> <Embedded-montiarc-math-roscpp-generator.version>0.0.4-SNAPSHOT</Embedded-montiarc-math-roscpp-generator.version>
<Embedded-montiarc-math-rosmsg-generator.version>0.0.3-SNAPSHOT</Embedded-montiarc-math-rosmsg-generator.version> <Embedded-montiarc-math-rosmsg-generator.version>0.0.3-SNAPSHOT</Embedded-montiarc-math-rosmsg-generator.version>
<!--TODO: remove with update to new emam version--> <!--TODO: remove with update to new emam version-->
......
...@@ -52,7 +52,4 @@ public class TemplateHelper { ...@@ -52,7 +52,4 @@ public class TemplateHelper {
return getTemplate("coordinatorCmakeListsTemplate.ftl"); return getTemplate("coordinatorCmakeListsTemplate.ftl");
} }
public static String getCmakeCppTemplate() {
return getTemplate("cmakeCppTemplate.ftl");
}
} }
...@@ -2,6 +2,7 @@ package de.monticore.lang.monticar.generator.middleware.impls; ...@@ -2,6 +2,7 @@ package de.monticore.lang.monticar.generator.middleware.impls;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ExpandedComponentInstanceSymbol; import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ExpandedComponentInstanceSymbol;
import de.monticore.lang.monticar.generator.FileContent; import de.monticore.lang.monticar.generator.FileContent;
import de.monticore.lang.monticar.generator.cmake.CMakeConfig;
import de.monticore.lang.monticar.generator.cpp.GeneratorCPP; import de.monticore.lang.monticar.generator.cpp.GeneratorCPP;
import de.monticore.lang.monticar.generator.middleware.helpers.NameHelper; import de.monticore.lang.monticar.generator.middleware.helpers.NameHelper;
import de.monticore.lang.monticar.generator.middleware.helpers.TemplateHelper; import de.monticore.lang.monticar.generator.middleware.helpers.TemplateHelper;
...@@ -19,6 +20,7 @@ public class CPPGenImpl implements GeneratorImpl { ...@@ -19,6 +20,7 @@ public class CPPGenImpl implements GeneratorImpl {
public CPPGenImpl(){ public CPPGenImpl(){
generatorCPP = new GeneratorCPP(); generatorCPP = new GeneratorCPP();
generatorCPP.useArmadilloBackend(); generatorCPP.useArmadilloBackend();
generatorCPP.setGenerateCMake(true);
} }
public void setGeneratorCPP(GeneratorCPP generatorCPP){ public void setGeneratorCPP(GeneratorCPP generatorCPP){
...@@ -30,7 +32,6 @@ public class CPPGenImpl implements GeneratorImpl { ...@@ -30,7 +32,6 @@ public class CPPGenImpl implements GeneratorImpl {
List<File> files = new ArrayList<>(); List<File> files = new ArrayList<>();
generatorCPP.setGenerationTargetPath(generationTargetPath); generatorCPP.setGenerationTargetPath(generationTargetPath);
files.add(generatorCPP.generateFile(generateCMake(componentInstanceSymbol)));
files.addAll(generatorCPP.generateFiles(componentInstanceSymbol, taggingResolver)); files.addAll(generatorCPP.generateFiles(componentInstanceSymbol, taggingResolver));
return files; return files;
...@@ -41,11 +42,4 @@ public class CPPGenImpl implements GeneratorImpl { ...@@ -41,11 +42,4 @@ public class CPPGenImpl implements GeneratorImpl {
this.generationTargetPath = path; this.generationTargetPath = path;
} }
private FileContent generateCMake(ExpandedComponentInstanceSymbol componentInstanceSymbol) {
FileContent cmake = new FileContent();
cmake.setFileName("CMakeLists.txt");
String name = NameHelper.getNameTargetLanguage(componentInstanceSymbol.getFullName());
cmake.setFileContent(TemplateHelper.getCmakeCppTemplate().replace("${compName}", name));
return cmake;
}
} }
cmake_minimum_required(VERSION 3.5)
project(${compName} LANGUAGES CXX)
add_library(${compName} ${compName}.h)
target_include_directories(${compName} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
set_target_properties(${compName} PROPERTIES LINKER_LANGUAGE CXX)
export(TARGETS ${compName} FILE ${compName}.cmake)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment