Skip to content

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

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

Refactor CMake with JRL CMake Modules v2 (v2)#40
ahoarau wants to merge 59 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 added 28 commits May 11, 2026 14:01
we only need the minimum version to be set to enable the correct policies
It was always required from nanobind
we now export eigen and cholmod correctly
cmake: cosmetic remove

cmake: generate ros2 python package files with condiition
key: ccache-macos-linux-windows-pixi-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.environment }}-${{ github.sha }}
restore-keys: ccache-macos-linux-windows-pixi-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.environment }}-
path: ${{ env.CCACHE_DIR }}
key: ccache-pixi-${{ matrix.os }}-${{ matrix.build_type }}-${{ github.sha }}

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.

Add ${{ matrix.environment }}

Comment on lines +55 to +56
key: ccache-${{ matrix.ROS_DISTRO }}-${{github.run_id}}
restore-keys: ccache-${{ matrix.ROS_DISTRO }}-

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
key: ccache-${{ matrix.ROS_DISTRO }}-${{github.run_id}}
restore-keys: ccache-${{ matrix.ROS_DISTRO }}-
key: ccache-ros-ci-${{ matrix.ROS_DISTRO }}-${{github.run_id}}
restore-keys: ccache-ros-ci-${{ matrix.ROS_DISTRO }}-

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 CHANGELOG.md
Comment on lines +19 to +21
- Switch to [JRL CMake modules v2](https://github.com/jrl-umi3218/jrl-cmakemodules/pull/798) ([#28](https://github.com/Simple-Robotics/nanoeigenpy/pull/28))
- Remove submodules: archives can now be used
- Migrate python tests to pytest

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
- Switch to [JRL CMake modules v2](https://github.com/jrl-umi3218/jrl-cmakemodules/pull/798) ([#28](https://github.com/Simple-Robotics/nanoeigenpy/pull/28))
- Remove submodules: archives can now be used
- Migrate python tests to pytest
- Switch to [JRL CMake modules v2](https://github.com/jrl-umi3218/jrl-cmakemodules/pull/798) ([#28](https://github.com/Simple-Robotics/nanoeigenpy/pull/28))
- Remove submodules: archives can now be used
- Migrate python tests to pytest

Comment thread pixi.toml
Comment on lines +188 to +194
[feature.test-pixi-build]
dependencies = { nanoeigenpy = { path = "." }, cmake = ">=3.22", python = "*", cxx-compiler = "*" }

# [feature.test-pixi-build.tasks]
# test-cmake = "cmake -S tests/packaging/pixi_build -B build_test_pixi_build"
# test-python = "python -c 'import nanoeigenpy'"
# test = { depends-on = ["test-cmake", "test-python"] }
[feature.test-pixi-build.tasks]
test-cmake = "cmake -S tests/packaging/cmake -B build/test_pixi_build"
test-python = "python -c 'import nanoeigenpy; print(nanoeigenpy.__version__)'"
test = { depends-on = ["test-cmake", "test-python"] }

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
[feature.test-pixi-build]
dependencies = { nanoeigenpy = { path = "." }, cmake = ">=3.22", python = "*", cxx-compiler = "*" }
# [feature.test-pixi-build.tasks]
# test-cmake = "cmake -S tests/packaging/pixi_build -B build_test_pixi_build"
# test-python = "python -c 'import nanoeigenpy'"
# test = { depends-on = ["test-cmake", "test-python"] }
[feature.test-pixi-build.tasks]
test-cmake = "cmake -S tests/packaging/cmake -B build/test_pixi_build"
test-python = "python -c 'import nanoeigenpy; print(nanoeigenpy.__version__)'"
test = { depends-on = ["test-cmake", "test-python"] }
# [feature.test-pixi-build]
# dependencies = { nanoeigenpy = { path = "." }, cmake = ">=3.22", python = "*", cxx-compiler = "*" }
# [feature.test-pixi-build.tasks]
# test-cmake = "cmake -S tests/packaging/cmake -B build/test_pixi_build"
# test-python = "python -c 'import nanoeigenpy; print(nanoeigenpy.__version__)'"
# test = { depends-on = ["test-cmake", "test-python"] }

To avoid issue with unwanted lockfile update

Comment thread CMakeLists.txt

# 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 ?

Comment thread CMakeLists.txt
endif()

jrl_generate_ros2_package_files(
INSTALL_CPP_PACKAGE_FILES [[NOT BUILD_STANDALONE_PYTHON_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.

BUILD_STANDALONE_PYTHON_INTERFACE doesn't exists on this project.

Comment thread CMakeLists.txt

jrl_generate_ros2_package_files(
INSTALL_CPP_PACKAGE_FILES [[NOT BUILD_STANDALONE_PYTHON_INTERFACE]]
INSTALL_PYTHON_PACKAGE_FILES [[BUILD_PYTHON_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.

BUILD_PYTHON_INTERFACE doesn't exists on this project

Comment thread tests/CMakeLists.txt
Comment on lines +15 to +20
set_property(
TEST ${test_name}
PROPERTY
ENVIRONMENT_MODIFICATION
"PYTHONPATH=path_list_prepend:$<TARGET_FILE_DIR:nanoeigenpy>"
"PYTHONPATH=path_list_prepend:$<TARGET_FILE_DIR:quaternion>"

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
set_property(
TEST ${test_name}
PROPERTY
ENVIRONMENT_MODIFICATION
"PYTHONPATH=path_list_prepend:$<TARGET_FILE_DIR:nanoeigenpy>"
"PYTHONPATH=path_list_prepend:$<TARGET_FILE_DIR:quaternion>"
set_property(
TEST ${test_name}
PROPERTY
ENVIRONMENT_MODIFICATION
"PYTHONPATH=path_list_prepend:$<TARGET_FILE_DIR:nanoeigenpy>"
"PYTHONPATH=path_list_prepend:$<TARGET_FILE_DIR:quaternion>"
DEPENDS quaternion nanoeigenpy

Comment thread CMakeLists.txt
if(WIN32)
string(REPLACE "\\" "/" Python_SITELIB "${Python_SITELIB}")
if(BUILD_WITH_CHOLMOD_SUPPORT)
jrl_find_package(CHOLMOD CONFIG REQUIRED)

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 in eigenpy

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