Skip to content

build both the ROS2 package and a plain CMake configuration - #10

Merged
zeerekahmad merged 1 commit into
zeerekahmad/kinematics-projectorsfrom
zeerekahmad/kinematics-dual-build
Aug 18, 2026
Merged

build both the ROS2 package and a plain CMake configuration#10
zeerekahmad merged 1 commit into
zeerekahmad/kinematics-projectorsfrom
zeerekahmad/kinematics-dual-build

Conversation

@zeerekahmad

Copy link
Copy Markdown
Contributor

PR: build both the ROS2 package and a plain CMake configuration

  • branch: zeerekahmad/kinematics-dual-build
  • base: zeerekahmad/kinematics-projectors
  • commit: cac4573

Description

One CMakeLists.txt now serves both colcon and the wheel build. find_package(ament_cmake QUIET) selects the
branch: under ament the library stays SHARED and is exported to downstream packages; without it the library is
STATIC and position-independent, so the pybind11 module is self-contained and a wheel ships a single .so.

  • Install, export and ament_package() calls move under the ament guard; the wheel path installs the
    extension at the root.
  • Drops the pybind11_vendor lookup for a direct pybind11 CONFIG lookup (vendor is a ROS2 package and is
    unavailable off-distro), the LINK_OPTIONS "" workaround, and the -Wl,-no-undefined link option that the
    static/pybind combination cannot satisfy.
  • cmake_minimum_required rises to 3.15 to match what scikit-build-core requires.
  • package.xml promotes pybind11_vendor to a full depend, adds python3-numpy and ament_cmake_test, and
    refreshes the description and maintainer.
  • CI gains a standalone_cmake job so the non-ament path is actually exercised;
    CMAKE_DISABLE_FIND_PACKAGE_ament_cmake forces that branch even on a ROS2 runner.

Migration Guide

No API change for consumers. Downstream ROS 2 packages keep linking the same exported SHARED target; only the
non-ament configuration is new.

Related issues

Completeness checklist

  • Is there test coverage? If it was a bugfix, is there a regression test?
  • Is user-facing API/behavior documented?
  • Is core documentation updated?
  • Are all checks green?
  • Assign reviewers to the PR and post in #code_reviews

Stack created with GitHub Stacks CLIGive Feedback 💬

find_package(ament_cmake QUIET) selects the branch, so one CMakeLists serves colcon
and the wheel build. Under ament the library stays SHARED and is exported to downstream
packages; without it the library is STATIC and position-independent, so the pybind11
module is self-contained and a wheel ships a single .so. Install, export and
ament_package() calls move under the ament guard, and the wheel path installs the
extension at the root.

Drops the pybind11_vendor lookup for a direct pybind11 CONFIG lookup (vendor is a ROS2
package and is unavailable off-distro), the LINK_OPTIONS "" workaround, and the
-Wl,-no-undefined link option that the static/pybind combination cannot satisfy.
cmake_minimum_required rises to 3.15 to match what scikit-build-core requires.

package.xml promotes pybind11_vendor to a full depend, adds python3-numpy and
ament_cmake_test, and refreshes the description and maintainer.

CI gains a standalone_cmake job so the non-ament path is actually exercised;
CMAKE_DISABLE_FIND_PACKAGE_ament_cmake forces that branch even on a ROS2 runner.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@zeerekahmad
zeerekahmad merged commit 284cab3 into main Aug 18, 2026
4 of 5 checks passed
@zeerekahmad
zeerekahmad deleted the zeerekahmad/kinematics-dual-build branch August 18, 2026 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant