Add dh-ros to Build-Depends in debian/control
Add cmake and/or dh-sequence-python3 to Build-Depends as needed
Use the ROS build system in debian/rules:
#!/usr/bin/make -f %: dh $@ --buildsystem=ros
dh-ros is a Debian helper for ROS. The ros build system looks for package.xml files in the sources to discover all ROS packages and builds them individually, in the correct order according to their dependencies.
The ros buildsystem is a meta buildsystem that will not actually perform the build itself. Instead it will look at the build type in the package.xml of each ROS package and invoke the appropriate build system:
It is your responsibility to add the required build dependencies to debian/control.
For technical reasons, all operations are carried out as part of the dh_auto_install step. This is unfortunately required so that ROS packages can discover each other as build dependencies.
In order to customize the individual build stages, you can export ROS_ variables in your debian/rules, similar to the way pybuild is customized:
ROS_CONFIGURE_ARGS passes additional arguments to dh_auto_configure.
ROS_BUILD_ARGS passes additional arguments to dh_auto_build.
ROS_TEST_ARGS passes additional arguments to dh_auto_test.
ROS_INSTALL_ARGS passes additional arguments to dh_auto_install.
You can also export PYBUILD_ variables as needed.
Each variable name (including the PYBUILD_ ones) can be suffixed with _<ros_package_name>. This will limit their effect to the specified ROS package. Replace all non-alphanumeric characters in package names with underscore (_) to create a valid identifier.
You can exclude ROS packages from the build by listing them in ROS_SKIP_PACKAGES.