Refactor CMake with JRL CMake Modules v2 - #794
Conversation
075411a to
e6124d7
Compare
b8bf15e to
f604bdc
Compare
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
Issues on recent clang compilers
| - 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"] |
There was a problem hiding this comment.
| 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 |
There was a problem hiding this comment.
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 |
| endif() | ||
|
|
||
| # Fallback to FetchContent if not found | ||
| set(JRL_GIT_REPOSITORY "https://github.com/ahoarau/jrl-cmakemodules.git") |
There was a problem hiding this comment.
To update when jrl-next is released
| ) | ||
| endif() | ||
|
|
||
| add_library(coal-hpp-fcl-compatibility INTERFACE) |
There was a problem hiding this comment.
compatibility layer should be named hpp-fcl::hpp-fcl. So consumer doesn't have to care about target name.
| $<$<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> |
There was a problem hiding this comment.
You also need to define COAL_HAVE_OCTOMAP for back compatibility
| libboost-devel = ">=1.80.0" | ||
| eigen = ">=3.4.0" | ||
| eigen-abi-devel = ">=3.4.0" | ||
| eigenpy = ">=3.7.0" |
There was a problem hiding this comment.
eigenpy is only needed with boost-python feature.
| "-S", | ||
| ".", | ||
| # Don't use standard layout because it's not well implemented on Windows | ||
| "-DPYTHON_STANDARD_LAYOUT=OFF", |
There was a problem hiding this comment.
This doesn't exist anymore.
jorisv
left a comment
There was a problem hiding this comment.
Bad button, I request some changes ;)
| jrl_option( | ||
| BUILD_PYTHON_INTERFACE | ||
| "Build the Python bindings (either with Boost.Python or Nanobind)" | ||
| OFF | ||
| ) |
There was a problem hiding this comment.
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}>/.." |
There was a problem hiding this comment.
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>/.."
| option(INSTALL_DOCUMENTATION "Generate and install the documentation" OFF) | ||
| option(SUFFIX_SO_VERSION "Suffix library name with its version" OFF) | ||
| option( | ||
| jrl_option(COAL_INSTALL_DOCUMENTATION "Generate and install the documentation" OFF) |
There was a problem hiding this comment.
This option doesn't seem to control documentation installation
| FALLBACK OFF | ||
| ) | ||
| jrl_option( | ||
| ENABLE_PYTHON_DOXYGEN_AUTODOC |
There was a problem hiding this comment.
Variable is named ENABLE_DOXYGEN_AUTODOC in python/CMakeLists.txt
| ) | ||
| endif() | ||
|
|
||
| add_library(coal-hpp-fcl-compatibility INTERFACE) |
There was a problem hiding this comment.
Compatibility layer should only be installed if COAL_BACKWARD_COMPATIBILITY_WITH_HPP_FCL=ON
| ) | ||
| endif(COAL_HAS_OCTOMAP) | ||
| jrl_add_export_component(TARGETS coal NAME coal) | ||
| jrl_add_export_component(TARGETS coal-hpp-fcl-compatibility NAME coal-hpp-fcl-compatibility) |
There was a problem hiding this comment.
Compatibility layer should only be installed if COAL_BACKWARD_COMPATIBILITY_WITH_HPP_FCL=ON
- Upgrade CMake build system to JRL CMake Modules v2 - Integrate cmake/get-jrl-cmakemodules.cmake downloader - Use target-based modern CMake for coal, python, python-nb, doc, and test suites - Condition coal-hpp-fcl-compatibility target, headers, and export component on COAL_BACKWARD_COMPATIBILITY_WITH_HPP_FCL (fixes PR coal-library#794 review feedback) - Require C++17 minimum standard
- Upgrade CMake build system to JRL CMake Modules v2 - Integrate cmake/get-jrl-cmakemodules.cmake downloader - Use target-based modern CMake for coal, python, python-nb, doc, and test suites - Condition coal-hpp-fcl-compatibility target, headers, and export component on COAL_BACKWARD_COMPATIBILITY_WITH_HPP_FCL (fixes PR coal-library#794 review feedback) - Require C++17 minimum standard
- Upgrade CMake build system to JRL CMake Modules v2 - Integrate cmake/get-jrl-cmakemodules.cmake downloader pointing to official jrl-umi3218/jrl-cmakemodules master branch - Use target-based modern CMake for coal, python, python-nb, doc, and test suites - Condition coal-hpp-fcl-compatibility target, headers, and export component on COAL_BACKWARD_COMPATIBILITY_WITH_HPP_FCL (fixes PR coal-library#794 review feedback) - Require C++17 minimum standard
- Upgrade CMake build system to JRL CMake Modules v2 - Integrate cmake/get-jrl-cmakemodules.cmake downloader pointing to official jrl-umi3218/jrl-cmakemodules master branch - Use target-based modern CMake for coal, python, python-nb, doc, and test suites - Condition coal-hpp-fcl-compatibility target, headers, and export component on COAL_BACKWARD_COMPATIBILITY_WITH_HPP_FCL (fixes PR coal-library#794 review feedback) - Require C++17 minimum standard
This PR is a full rewrite of the CMake files with the JRL CMake Modules v2.
c++17minimum required