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
EMAM2RosCpp
Commits
11306f7c
Commit
11306f7c
authored
Apr 13, 2019
by
Alexander David Hellwig
Browse files
Fix: ros1 include dir for struct_msgs
parent
68f78782
Pipeline
#118280
failed with stages
in 44 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/de/monticore/lang/monticar/generator/roscpp/GeneratorRosCpp.java
View file @
11306f7c
...
...
@@ -122,11 +122,12 @@ public class GeneratorRosCpp {
.
map
(
RosConnectionSymbol:
:
getTopicType
)
.
map
(
Optional:
:
get
)
.
map
(
n
->
n
.
split
(
"/"
)[
0
])
//dont add struct_msgs if we are in ros1 mode
.
filter
(
s
->
ros2Mode
||
!
s
.
equals
(
"struct_msgs"
))
.
forEach
(
allPackages:
:
add
);
allPackages
.
forEach
(
model:
:
addPackage
);
if
(!
ros2Mode
){
model
.
addExcludeFindPackage
(
"struct_msgs"
);
}
List
<
FileContent
>
result
=
new
ArrayList
<>();
result
.
add
(
new
FileContent
(
"CMakeLists.txt"
,
RosCppTemplates
.
generateRosCMakeLists
(
model
)));
...
...
src/main/java/de/monticore/lang/monticar/generator/roscpp/template/RosCppCMakeListsModel.java
View file @
11306f7c
...
...
@@ -9,6 +9,7 @@ public class RosCppCMakeListsModel {
private
String
name
;
private
String
compName
;
private
List
<
String
>
packages
=
new
ArrayList
<>();
private
List
<
String
>
excludeFindPackages
=
new
ArrayList
<>();
public
String
getName
()
{
return
name
;
...
...
@@ -25,6 +26,14 @@ public class RosCppCMakeListsModel {
.
collect
(
Collectors
.
toList
());
}
public
List
<
String
>
getExcludeFindPackages
()
{
return
excludeFindPackages
;
}
public
void
addExcludeFindPackage
(
String
excludeFindPackage
)
{
this
.
excludeFindPackages
.
add
(
excludeFindPackage
);
}
public
RosCppCMakeListsModel
(
String
name
,
String
compName
)
{
this
.
name
=
name
;
this
.
compName
=
compName
;
...
...
src/main/resources/de/monticore/lang/monticar/generator/roscpp/template/CMakeLists.ftl
View file @
11306f7c
...
...
@@ -4,7 +4,9 @@ set (CMAKE_CXX_STANDARD 14)
set (AMENT_CMAKE_UNINSTALL_TARGET FALSE)
<#list model.getPackages() as pack>
<#if !model.getExcludeFindPackages()?seq_contains(pack)>
find_package(${pack} REQUIRED)
</#if>
</#list>
add_library(${model.name} ${model.name}.cpp)
...
...
@@ -12,13 +14,13 @@ add_library(${model.name} ${model.name}.cpp)
list(APPEND LIBRARIES ${model.compName})
list(APPEND LIBRARIES IAdapter_${model.compName})
<#list model.getPackages() as lib>
list(APPEND LIBRARIES ${r"${"}${lib}_LIBRARIES})
list(APPEND LIBRARIES ${r"${"}${lib}_LIBRARIES})
</#list>
target_link_libraries(${model.name} <#noparse>${LIBRARIES}</#noparse>)
list(APPEND INCLUDE_DIRS <#noparse>${CMAKE_CURRENT_SOURCE_DIR}</#noparse>)
<#list model.getPackages() as incl>
list(APPEND INCLUDE_DIRS ${r"${"}${incl}_INCLUDE_DIRS})
list(APPEND INCLUDE_DIRS ${r"${"}${incl}_INCLUDE_DIRS})
</#list>
target_include_directories(${model.name} PUBLIC <#noparse>${INCLUDE_DIRS}</#noparse>)
...
...
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