Skip to content

Commit

Permalink
Fix Rolling includes (#25)
Browse files Browse the repository at this point in the history
* Fix Rolling includes

Signed-off-by: Pablo Garrido <[email protected]>

Update

Signed-off-by: Pablo Garrido <[email protected]>

Update

Signed-off-by: Pablo Garrido <[email protected]>

* Update

Signed-off-by: Pablo Garrido <[email protected]>
  • Loading branch information
pablogs9 authored Mar 29, 2022
1 parent f44daaa commit 462d485
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
13 changes: 11 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ externalproject_add(libmicroros_project
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}
CONFIGURE_COMMAND ""
BUILD_COMMAND
make -j -f ${CMAKE_CURRENT_SOURCE_DIR}/libmicroros.mk
make -f ${CMAKE_CURRENT_SOURCE_DIR}/libmicroros.mk
X_CC=${CMAKE_C_COMPILER}
X_AR=${CMAKE_AR}
X_STRIP=${CMAKE_STRIP}
Expand All @@ -47,7 +47,16 @@ target_sources(${APP_TARGET}
add_dependencies(${APP_TARGET} libmicroros_project)
target_include_directories(${APP_TARGET} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include)

set(INCLUDE_ROS2_PACKAGES rmw;rcl;rcl_action;rcl_lifecycle;rcl_logging_interface;rosidl_runtime_c;rosidl_typesupport_interface;rosidl_typesupport_introspection_c)
execute_process(
COMMAND
make -f ${CMAKE_CURRENT_SOURCE_DIR}/libmicroros.mk get_package_names
WORKING_DIRECTORY
${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE
INCLUDE_ROS2_PACKAGES
OUTPUT_STRIP_TRAILING_WHITESPACE
)

foreach(pkg ${INCLUDE_ROS2_PACKAGES})
target_include_directories(${APP_TARGET} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/${pkg})
endforeach()
Expand Down
9 changes: 6 additions & 3 deletions libmicroros.mk
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,12 @@ $(EXTENSIONS_DIR)/micro_ros_dev/install:
git clone -b master https:/ament/ament_index src/ament_index; \
colcon build --cmake-args -DBUILD_TESTING=OFF;

get_package_names: $(EXTENSIONS_DIR)/micro_ros_src/src
@cd $(EXTENSIONS_DIR)/micro_ros_src/src; \
colcon list | awk '{print $$1}' | awk -v d=";" '{s=(NR==1?s:s d)$$0}END{print s}'

$(EXTENSIONS_DIR)/micro_ros_src/src:
cd $(EXTENSIONS_DIR); \
@cd $(EXTENSIONS_DIR); \
rm -rf micro_ros_src; \
mkdir micro_ros_src; cd micro_ros_src; \
git clone -b foxy https:/eProsima/micro-CDR src/micro-CDR; \
Expand All @@ -69,11 +73,10 @@ $(EXTENSIONS_DIR)/micro_ros_src/src:
git clone -b master https:/ros2/rmw_implementation src/rmw_implementation; \
git clone -b master https:/ros2/rcl_logging src/rcl_logging; \
git clone -b master https://gitlab.com/micro-ROS/ros_tracing/ros2_tracing src/ros2_tracing; \
git clone -b main https:/micro-ROS/micro_ros_utilities; \
git clone -b main https:/micro-ROS/micro_ros_utilities src/micro_ros_utilities; \
touch src/rosidl/rosidl_typesupport_introspection_cpp/COLCON_IGNORE; \
touch src/rclc/rclc_examples/COLCON_IGNORE; \
touch src/rcl/rcl_yaml_param_parser/COLCON_IGNORE; \
touch src/rcl_logging/rcl_logging_log4cxx/COLCON_IGNORE; \
touch src/rcl_logging/rcl_logging_spdlog/COLCON_IGNORE; \
cp -rf $(EXTENSIONS_DIR)/extra_packages src/extra_packages || :;

Expand Down

0 comments on commit 462d485

Please sign in to comment.