Skip to main content

Quick Start

Prerequisites

  • Ubuntu with ROS 2 Jazzy installed at /opt/ros/jazzy
  • xmake available in PATH
  • Python 3.10+

Install xmake via xlings

xlings is a cross-platform package manager that can set up xmake (and other tools like Node.js) with one command:

# Install xlings
curl -fsSL https://raw.githubusercontent.com/d2learn/xlings/refs/heads/main/tools/other/quick_install.sh | bash

# Install xmake
xlings install xmake

On Windows (PowerShell):

irm https://raw.githubusercontent.com/d2learn/xlings/refs/heads/main/tools/other/quick_install.ps1 | iex
xlings install xmake

Setup

Install the colcon-xmake plugin:

pip install colcon-xmake

Set up a workspace with examples:

mkdir -p ~/ros2_xmake_ws/src && cd ~/ros2_xmake_ws/src
git clone https://github.com/ros-x/ros2_xmake_examples.git .
vcs import < ros2_xmake.repos

Build and test

cd ~/ros2_xmake_ws
source /opt/ros/jazzy/setup.bash
colcon build --event-handlers console_direct+
colcon test --packages-select demo_xmake_cpp downstream_cmake_consumer
colcon test-result --verbose