diff --git a/classes/ros2_distro.bbclass b/classes/ros2_distro.bbclass index cdd9e1b..4d632a7 100644 --- a/classes/ros2_distro.bbclass +++ b/classes/ros2_distro.bbclass @@ -10,3 +10,14 @@ def ros_distro__get_component_type(component, d): # *.cmake files has hardcoded sysroot-s in them. We assume this is only an issue with ROS 2. SSTATE_SCAN_FILES_append = " *.cmake" + +# The parent_prefix_path files are used on the target => remove the build tree from the paths. We assume this is only an issue +# with ROS 2. +do_install_append_class-target() { + if [ -d ${D}${datadir}/ament_index/resource_index/parent_prefix_path ]; then + find ${D}${datadir}/ament_index/resource_index/parent_prefix_path -type f \ + | xargs --no-run-if-empty sed -i -e 's@${STAGING_DIR_HOST}/@/@g' -e 's@${STAGING_DIR_NATIVE}/@/@g' + else + true + fi +}