Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
monticore
EmbeddedMontiArc
generators
EMAM2Cpp
Commits
aa02c297
Commit
aa02c297
authored
Oct 30, 2018
by
Evgeny Kusmenko
Browse files
Merge branch 'richter-dev' into 'master'
Richter dev See merge request
!22
parents
f54ba48b
46971d81
Pipeline
#81602
failed with stages
in 15 minutes and 27 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
pom.xml
View file @
aa02c297
...
...
@@ -8,7 +8,7 @@
<groupId>
de.monticore.lang.monticar
</groupId>
<artifactId>
embedded-montiarc-math-generator
</artifactId>
<version>
0.0.2
6
-SNAPSHOT
</version>
<version>
0.0.2
7
-SNAPSHOT
</version>
<!-- == PROJECT DEPENDENCIES ============================================= -->
...
...
src/main/java/de/monticore/lang/monticar/generator/cmake/CMakeConfig.java
View file @
aa02c297
...
...
@@ -49,7 +49,7 @@ public class CMakeConfig {
private
CMakeListsCPPViewModel
cMakeListsViewModel
=
new
CMakeListsCPPViewModel
();
private
HashSe
t
<
CMakeFindModule
>
moduleList
=
new
HashSe
t
<>();
private
Lis
t
<
CMakeFindModule
>
moduleList
=
new
ArrayLis
t
<>();
private
List
<
String
>
cmakeCommandList
=
new
ArrayList
<>();
...
...
src/main/java/de/monticore/lang/monticar/generator/cmake/CMakeListsCPPViewModel.java
View file @
aa02c297
...
...
@@ -19,7 +19,7 @@ public class CMakeListsCPPViewModel extends ViewModelBase {
// fields
private
String
compName
;
private
HashSe
t
<
CMakeFindModule
>
moduleDependencies
;
private
Lis
t
<
CMakeFindModule
>
moduleDependencies
;
private
List
<
String
>
cmakeCommandList
=
new
ArrayList
<>();
...
...
@@ -35,11 +35,11 @@ public class CMakeListsCPPViewModel extends ViewModelBase {
this
.
compName
=
compName
;
}
public
HashSe
t
<
CMakeFindModule
>
getModuleDependencies
()
{
public
Lis
t
<
CMakeFindModule
>
getModuleDependencies
()
{
return
moduleDependencies
;
}
public
void
setModuleDependencies
(
HashSe
t
<
CMakeFindModule
>
moduleDependencies
)
{
public
void
setModuleDependencies
(
Lis
t
<
CMakeFindModule
>
moduleDependencies
)
{
this
.
moduleDependencies
=
moduleDependencies
;
}
...
...
src/main/java/de/monticore/lang/monticar/generator/cpp/GeneratorCPP.java
View file @
aa02c297
...
...
@@ -389,19 +389,16 @@ public class GeneratorCPP implements Generator {
// add jni
cmake
.
addCMakeCommand
(
"find_package(JNI)"
);
cmake
.
addCMakeCommand
(
"set(INCLUDE_DIRS ${INCLUDE_DIRS} ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})"
);
// set install dir
cmake
.
addCMakeCommand
(
"IF (WIN32)"
);
cmake
.
addCMakeCommand
(
"set(CMAKE_INSTALL_PREFIX $ENV{DLL_DIR})"
);
cmake
.
addCMakeCommand
(
"ELSE()"
);
cmake
.
addCMakeCommand
(
"set(CMAKE_INSTALL_PREFIX /usr/lib)"
);
cmake
.
addCMakeCommand
(
"ENDIF()"
);
// create shared lib
cmake
.
addCMakeCommandEnd
(
"add_library(AutopilotAdapter SHARED AutopilotAdapter.cpp ${CMAKE_CURRENT_SOURCE_DIR})"
);
cmake
.
addCMakeCommandEnd
(
"target_include_directories(AutopilotAdapter PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})"
);
cmake
.
addCMakeCommandEnd
(
"target_link_libraries(AutopilotAdapter PUBLIC ${LIBS})"
);
cmake
.
addCMakeCommandEnd
(
"set_target_properties(AutopilotAdapter PROPERTIES LINKER_LANGUAGE CXX)"
);
cmake
.
addCMakeCommand
(
"IF (WIN32)"
);
cmake
.
addCMakeCommandEnd
(
"set_target_properties(AutopilotAdapter PROPERTIES PREFIX \"\")"
);
cmake
.
addCMakeCommand
(
"ENDIF()"
);
// install shared lib
cmake
.
addCMakeCommandEnd
(
"install(TARGETS AutopilotAdapter DESTINATION
\"./\"
)"
);
cmake
.
addCMakeCommandEnd
(
"install(TARGETS AutopilotAdapter DESTINATION
$ENV{DLL_DIR}
)"
);
cmake
.
addCMakeCommandEnd
(
"export(TARGETS AutopilotAdapter FILE de_rwth_armin_modeling_autopilot_autopilotAdapter.cmake)"
);
}
...
...
src/main/resources/template/cmake/CMakeListsCppTemplate.ftl
View file @
aa02c297
...
...
@@ -8,7 +8,7 @@ set(CMAKE_MODULE_PATH ${r"${CMAKE_MODULE_PATH}"} ${r"${CMAKE_CURRENT_SOURCE_DIR}
# add dependencies
<#
list
viewModel.moduleDependencies as var>
find_package
(${
var
.packageName
}
<#if var.required>REQUIRED<#else>
OPTIONAL
</#if>)
find_package
(${
var
.packageName
}
<#if var.required>REQUIRED<#else></#if>)
<#
if
var.findPath>set(INCLUDE_DIRS $
{
r
"${INCLUDE_DIRS}"
}
$
{
r
"${"
}
$
{
var
.packageName
}
$
{
r
"_INCLUDE_DIRS}"
}
)</#if>
<#
if
var.findLibrary>set(LIBS $
{
r
"${LIBS}"
}
$
{
r
"${"
}
$
{
var
.packageName
}
$
{
r
"_LIBRARIES}"
}
)</#if>
</#
list
>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment