Skip to content

Commit 377d090

Browse files
committed
Mandatory yaml dependency
1 parent 1655762 commit 377d090

3 files changed

Lines changed: 5 additions & 24 deletions

File tree

visualization/motion_planning_tasks/properties/CMakeLists.txt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,13 @@ set(MOVEIT_LIB_NAME motion_planning_tasks_properties)
22

33
set(SOURCES
44
property_factory.cpp
5+
property_from_yaml.cpp
56
)
67

78
find_package(PkgConfig REQUIRED)
8-
pkg_check_modules(YAML yaml-0.1)
9-
if (YAML_FOUND)
10-
# Only cmake > 3.12 provides XXX_LINK_LIBRARIES. Find the absolute path manually
11-
find_library(YAML_LIBRARIES ${YAML_LIBRARIES} PATHS ${YAML_LIBRARY_DIRS})
12-
list(APPEND SOURCES property_from_yaml.cpp)
13-
add_definitions(-DHAVE_YAML)
14-
endif()
9+
pkg_check_modules(YAML REQUIRED yaml-0.1)
10+
# Only cmake > 3.12 provides XXX_LINK_LIBRARIES. Find the absolute path manually
11+
find_library(YAML_LIBRARIES ${YAML_LIBRARIES} PATHS ${YAML_LIBRARY_DIRS})
1512

1613
add_library(${MOVEIT_LIB_NAME} SHARED ${SOURCES})
1714

visualization/motion_planning_tasks/properties/property_factory.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -147,21 +147,4 @@ void PropertyFactory::addRemainingProperties(rviz::Property* root, mtc::Property
147147
new rviz::Property("no properties", QVariant(), QString(), root);
148148
}
149149

150-
#ifndef HAVE_YAML
151-
rviz::Property* PropertyFactory::createDefault(const std::string& name, const std::string& /*type*/,
152-
const std::string& description, const std::string& value,
153-
rviz::Property* old) {
154-
if (old) { // reuse existing Property?
155-
assert(old->getNameStd() == name);
156-
old->setDescription(QString::fromStdString(description));
157-
old->setValue(QString::fromStdString(value));
158-
return old;
159-
} else { // create new Property?
160-
rviz::Property* result = new rviz::StringProperty(QString::fromStdString(name), QString::fromStdString(value),
161-
QString::fromStdString(description));
162-
result->setReadOnly(true);
163-
return result;
164-
}
165-
}
166-
#endif
167150
} // namespace moveit_rviz_plugin

visualization/package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<depend>moveit_ros_visualization</depend>
1919
<depend>roscpp</depend>
2020
<depend>rviz</depend>
21+
<depend>yaml</depend>
2122

2223
<test_depend>rosunit</test_depend>
2324
<test_depend>rostest</test_depend>

0 commit comments

Comments
 (0)