ROS 2 rule package that enables building ROS 2 packages with xmake. It provides xmake rules and helpers so that xmake-based packages follow standard ament install conventions and integrate seamlessly with the ROS 2 build ecosystem via colcon-xmake.
- ROS 2 Jazzy (or later)
- xmake build system
ament_xmake is a standard ROS 2 package. Clone it into a colcon workspace and build:
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src
git clone https://github.com/ros-x/ament_xmake.git
cd ~/ros2_ws
colcon build --packages-select ament_xmake
source install/setup.bashYou will also need colcon-xmake installed so
that colcon build knows how to drive xmake-based packages.
add_rules("ament_xmake.package")
target("my_node")
set_kind("binary")
add_files("src/my_node.cpp")
add_ros_deps("rclcpp", "geometry_msgs")The rule is expected to ensure ROS package install conventions:
- install
package.xmltoshare/<pkg>/package.xml - install ament index marker to
share/ament_index/resource_index/packages/<pkg> - generate minimal
share/<pkg>/cmake/<pkg>Config.cmakefor downstreamfind_package(... CONFIG) - install built artifacts to ROS-style layout (e.g.
lib/,lib/<pkg>/) - export imported target
<pkg>::<pkg>when a library artifact exists - provide
add_ros_deps(...)to resolve ROS package include/link flags via CMake export metadata
- For deterministic config export, the primary library target should be named the same as the package.
- In
--symlink-installmode the plugin setsAMENT_XMAKE_SYMLINK_INSTALL=1so install steps prefer symlinks on Linux.
docs/RULE_SPEC.mddocs/SYMLINK_INSTALL.mdCHANGELOG.md
- ros-x — GitHub organization for ROS 2 + xmake tooling
- colcon-xmake — colcon build verb extension for xmake
Apache License 2.0 — see LICENSE for details.