Skip to content

Refactor CMake with JRL CMake Modules v2 (v2) - #40

Open
ahoarau wants to merge 83 commits into
Simple-Robotics:mainfrom
ahoarau:jrl-next-v2
Open

Refactor CMake with JRL CMake Modules v2 (v2)#40
ahoarau wants to merge 83 commits into
Simple-Robotics:mainfrom
ahoarau:jrl-next-v2

Conversation

@ahoarau

@ahoarau ahoarau commented Jan 5, 2026

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: archives can now be used
  • Migrate python tests to pytest
  • 🚧 NIX CI is temporarily disabled

NOTE: This the commit are cherry-picked and squashed from the previously accidentitaly merged #28

@ahoarau
ahoarau marked this pull request as draft January 5, 2026 14:05
@ManifoldFR
ManifoldFR marked this pull request as ready for review January 9, 2026 20:55
@ManifoldFR
ManifoldFR enabled auto-merge January 9, 2026 20:55

@ManifoldFR ManifoldFR left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems good to me overall 😄

Comment thread CHANGELOG.md Outdated
Comment thread CMakeLists.txt Outdated
Comment thread CMakeLists.txt Outdated
Comment thread CMakeLists.txt Outdated
@ahoarau
ahoarau marked this pull request as draft January 10, 2026 07:25
auto-merge was automatically disabled January 10, 2026 07:25

Pull request was converted to draft

@ManifoldFR
ManifoldFR marked this pull request as ready for review January 10, 2026 16:01
@ahoarau
ahoarau marked this pull request as draft January 12, 2026 06:29
@ahoarau
ahoarau force-pushed the jrl-next-v2 branch 2 times, most recently from 5cedb44 to 099bd00 Compare January 16, 2026 09:56
@ManifoldFR
ManifoldFR marked this pull request as ready for review January 17, 2026 10:00
@ahoarau
ahoarau force-pushed the jrl-next-v2 branch 2 times, most recently from 05572ce to fcf926d Compare January 17, 2026 11:28
@ManifoldFR

Copy link
Copy Markdown
Member

@nim65s we will need a followup PR for Nix in the future 😃

@ahoarau
ahoarau force-pushed the jrl-next-v2 branch 2 times, most recently from 31fceae to e300dd5 Compare February 6, 2026 08:55
@ManifoldFR ManifoldFR linked an issue Feb 11, 2026 that may be closed by this pull request
@ahoarau
ahoarau force-pushed the jrl-next-v2 branch 2 times, most recently from 5b8813f to d8ac8b7 Compare March 18, 2026 15:47
@ahoarau
ahoarau force-pushed the jrl-next-v2 branch 2 times, most recently from 7b4631c to a747b22 Compare May 11, 2026 12:03
Comment thread .github/workflows/macos-linux-windows-pixi.yml Outdated
Comment thread .github/workflows/ros_ci.yml Outdated
Comment thread cmake/get-jrl-cmakemodules.cmake Outdated
Comment thread CHANGELOG.md Outdated
Comment thread pixi.toml Outdated
Comment thread CMakeLists.txt Outdated

# Stub generation requires typing-extensions
# ROS Humble ships an incompatible typing-extensions with python3.10
if(Python_VERSION VERSION_GREATER_EQUAL 3.11.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.

This mean we don't generate stub on python 3.10 even on non ROS system ?
Do we have another way to detect being build on ROS with python 3.10 ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

replaced by checking the typing_extension that needs to be >=4.1

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

With jrl-umi3218/jrl-cmakemodules#866, we can do a better handling of this version check like this:

if(NANOEIGENPY_GENERATE_STUBS)
  if(Python_VERSION VERSION_LESS 3.11)
    jrl_check_python_module(typing_extensions 4.1.0 REQUIRED)
  endif()

  nanobind_add_stub(
    nanoeigenpy_stub
    VERBOSE
    MODULE nanoeigenpy
    OUTPUT ${CMAKE_BINARY_DIR}/lib/site-packages/nanoeigenpy.pyi
    PYTHON_PATH $<TARGET_FILE_DIR:nanoeigenpy>
    DEPENDS nanoeigenpy
  )
endif()

For the Ubuntu 22 CI, its up to them to manually set -DNANOEIGENPY_GENERATE_STUBS=OFF, otherwise they will have a FATAL_ERROR.
This is more aligned with the "if user wants a feature by setting an option, REQUIRE the dependency".

Comment thread CMakeLists.txt Outdated
Comment thread CMakeLists.txt Outdated
Comment thread tests/CMakeLists.txt
Comment thread CMakeLists.txt Outdated
@ahoarau
ahoarau force-pushed the jrl-next-v2 branch 2 times, most recently from 15991d9 to 740f19f Compare July 28, 2026 15:26
ahoarau added 2 commits July 28, 2026 17:51
eigen does not initialize matrices at construction by default
Comment thread .github/workflows/macos-linux-windows-pixi.yml
Comment thread CMakeLists.txt Outdated

jrl_option(BUILD_TESTING "Build the tests" OFF)

jrl_option(INSTALL_DOCUMENTATION "Generate and install the documentation" 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.

It miss BUILD_DOCUMENTATION and the documentation subdirectory (it was done by default by legacy jrl cmake module)

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.

OFF by default ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

fixed.

Comment thread CMakeLists.txt
Comment thread CMakeLists.txt Outdated
Comment thread CMakeLists.txt
Comment thread CMakeLists.txt
${nanoeigenpy_HEADERS}
)
jrl_target_set_output_directory(nanoeigenpy OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/site-packages)
jrl_target_enforce_msvc_conformance(nanoeigenpy PRIVATE)

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 miss jrl_target_set_default_compile_options

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 put this on the nanoeigenpy_headers as interface. This will be forwarded to all consumer. Better only apply it on tests and binding.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

indeed. Now it's on the python bindings in PRIVATE. (there are no cpp tests)

Comment thread tests/CMakeLists.txt Outdated
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.

CMake: use of Python_SITELIB

3 participants