Skip to content

Refactor CMake with JRL CMake Modules v2#794

Draft
ahoarau wants to merge 75 commits into
coal-library:develfrom
ahoarau:jrl-next
Draft

Refactor CMake with JRL CMake Modules v2#794
ahoarau wants to merge 75 commits into
coal-library:develfrom
ahoarau:jrl-next

Conversation

@ahoarau

@ahoarau ahoarau commented Dec 11, 2025

Copy link
Copy Markdown
Collaborator

⚠️DO NOT MERGE UNTIL jrl-umi3218/jrl-cmakemodules#798 is merged ⚠️

This PR is a full rewrite of the CMake files with the JRL CMake Modules v2.

  • Full rewrite of the CMake Files in modern CMake
  • Remove submodules
  • c++17 minimum required
  • 🚧 NIX CI is temporarily disabled
  • CI pixi on Ubuntu-22.04
  • BREAKING: hpp-fcl-compatiblity is now a COMPONENT
find_package(coal CONFIG REQUIRED COMPONENTS coal coal-hpp-fcl-compatibility)

@ahoarau ahoarau marked this pull request as draft December 11, 2025 16:39
@ahoarau ahoarau force-pushed the jrl-next branch 2 times, most recently from 075411a to e6124d7 Compare January 12, 2026 16:39
@ahoarau ahoarau force-pushed the jrl-next branch 3 times, most recently from b8bf15e to f604bdc Compare February 20, 2026 09:38
ahoarau added 21 commits May 13, 2026 16:06
new method with COMPONENTS
they are now generated by jrl v2
if we enable OCTOMAP, the library is REQUIRED. We are supposed to have it.
testing is a library is available creates opacity in what we are actually building, better to enable+require, fatal_error otherwise
Boost.Test was included as a standalone library (included/unit_test.hpp), but linked against a shared_library Boost::unit_test_framework
- os: "macos"
python-version: "3.8" # Not available on arm64
os: ["ubuntu-latest", "macos-latest"]
python-version: ["3.10", "3.11", "3.12", "3.13"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
python-version: ["3.10", "3.11", "3.12", "3.13"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]


- name: Install Coal [MacOS/Linux/Windows]
run: |
pixi run -e ${{ matrix.environment }} install

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running this will rerun pixi run configure and pixi run build.
It's maybe better to directly run cmake.

- name: Test Coal [MacOS/Linux/Windows]
if: matrix.run_tests == true
run: |
pixi run -e ${{ matrix.environment }} test

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same remark than install

endif()

# Fallback to FetchContent if not found
set(JRL_GIT_REPOSITORY "https://github.com/ahoarau/jrl-cmakemodules.git")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To update when jrl-next is released

Comment thread development/scripts/pixi/activation.sh
Comment thread CMakeLists.txt
)
endif()

add_library(coal-hpp-fcl-compatibility INTERFACE)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

compatibility layer should be named hpp-fcl::hpp-fcl. So consumer doesn't have to care about target name.

Comment thread CMakeLists.txt
$<$<BOOL:${COAL_USE_FLOAT_PRECISION}>:COAL_USE_FLOAT_PRECISION>
$<$<BOOL:${COAL_TURN_ASSERT_INTO_EXCEPTION}>:COAL_TURN_ASSERT_INTO_EXCEPTION>
$<$<BOOL:${COAL_BACKWARD_COMPATIBILITY_WITH_HPP_FCL}>:COAL_BACKWARD_COMPATIBILITY_WITH_HPP_FCL>
$<$<BOOL:${COAL_BUILD_WITH_OCTOMAP}>:COAL_HAS_OCTOMAP>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also need to define COAL_HAVE_OCTOMAP for back compatibility

Comment thread pixi.toml
Comment thread pixi.toml Outdated
libboost-devel = ">=1.80.0"
eigen = ">=3.4.0"
eigen-abi-devel = ">=3.4.0"
eigenpy = ">=3.7.0"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eigenpy is only needed with boost-python feature.

Comment thread pixi.toml Outdated
"-S",
".",
# Don't use standard layout because it's not well implemented on Windows
"-DPYTHON_STANDARD_LAYOUT=OFF",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't exist anymore.

@jorisv jorisv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad button, I request some changes ;)

Comment thread CMakeLists.txt
Comment on lines +76 to +80
jrl_option(
BUILD_PYTHON_INTERFACE
"Build the Python bindings (either with Boost.Python or Nanobind)"
OFF
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This option is set to ON by default in jrl-v1

set_tests_properties(
${test_name}
PROPERTIES
ENVIRONMENT "PYTHONPATH=$<TARGET_FILE_DIR:${coal_python_bindings}>/.."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to use ENVIRONMENT_MODIFICATION to avoid issue with some package manager or custom installation path:

      ENVIRONMENT_MODIFICATION
        "PYTHONPATH=path_list_prepend:$<TARGET_FILE_DIR:coal_python_bindings>/.."

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.

2 participants