Refactor CMake with JRL CMake Modules v2 (v2)#40
Conversation
ManifoldFR
left a comment
There was a problem hiding this comment.
Seems good to me overall 😄
Pull request was converted to draft
5cedb44 to
099bd00
Compare
05572ce to
fcf926d
Compare
|
@nim65s we will need a followup PR for Nix in the future 😃 |
31fceae to
e300dd5
Compare
5b8813f to
d8ac8b7
Compare
gersemirc: put back gersemi definitions no chance observed in this repo. Its for future proofness.
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 }} |
There was a problem hiding this comment.
Add ${{ matrix.environment }}
| key: ccache-${{ matrix.ROS_DISTRO }}-${{github.run_id}} | ||
| restore-keys: ccache-${{ matrix.ROS_DISTRO }}- |
There was a problem hiding this comment.
| 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") |
There was a problem hiding this comment.
To update when jrl-next is released
| - 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 |
There was a problem hiding this comment.
| - 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 |
| [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"] } |
There was a problem hiding this comment.
| [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
|
|
||
| # Stub generation requires typing-extensions | ||
| # ROS Humble ships an incompatible typing-extensions with python3.10 | ||
| if(Python_VERSION VERSION_GREATER_EQUAL 3.11.0) |
There was a problem hiding this comment.
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 ?
| endif() | ||
|
|
||
| jrl_generate_ros2_package_files( | ||
| INSTALL_CPP_PACKAGE_FILES [[NOT BUILD_STANDALONE_PYTHON_INTERFACE]] |
There was a problem hiding this comment.
BUILD_STANDALONE_PYTHON_INTERFACE doesn't exists on this project.
|
|
||
| jrl_generate_ros2_package_files( | ||
| INSTALL_CPP_PACKAGE_FILES [[NOT BUILD_STANDALONE_PYTHON_INTERFACE]] | ||
| INSTALL_PYTHON_PACKAGE_FILES [[BUILD_PYTHON_INTERFACE]] |
There was a problem hiding this comment.
BUILD_PYTHON_INTERFACE doesn't exists on this project
| set_property( | ||
| TEST ${test_name} | ||
| PROPERTY | ||
| ENVIRONMENT_MODIFICATION | ||
| "PYTHONPATH=path_list_prepend:$<TARGET_FILE_DIR:nanoeigenpy>" | ||
| "PYTHONPATH=path_list_prepend:$<TARGET_FILE_DIR:quaternion>" |
There was a problem hiding this comment.
| 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 |
| if(WIN32) | ||
| string(REPLACE "\\" "/" Python_SITELIB "${Python_SITELIB}") | ||
| if(BUILD_WITH_CHOLMOD_SUPPORT) | ||
| jrl_find_package(CHOLMOD CONFIG REQUIRED) |
This PR is a full rewrite of the CMake files with the JRL CMake Modules v2.
pytestNOTE: This the commit are cherry-picked and squashed from the previously accidentitaly merged #28