Refactor CMake with JRL CMake Modules v2#612
Conversation
e114b10 to
7d7943a
Compare
jorisv
left a comment
There was a problem hiding this comment.
Nice work, the CMakeLists are way clearer.
b8cf5d4 to
c8bb47e
Compare
82e628b to
d588970
Compare
567f237 to
41bfb1e
Compare
original is from templates/deprecated.hpp.in
they are now autogenerated by jrl v2
configure_file will overrite boost_optional.cpp only if the content changes. This allow to a quick check on the actual code, and simplifies the cmake
| set(CMAKE_MODULE_PATH ${JRL_CMAKE_MODULES}/find-external/CHOLMOD | ||
| ${CMAKE_MODULE_PATH}) |
There was a problem hiding this comment.
CHOLMODConfig.cmake is not packaged on Ubuntu 22.04 (libsuitesparse-dev).
We must provide it to avoid regressions.
To avoid using our custom CHOMODConfig.cmake on all system we can use the same strategy than aligator : creating an explicit EIGENPY_BUILD_WITH_UBUNTU_22_COMPATIBILITY option that must be activated on this system.
| INSTALL_CPP_PACKAGE_FILES [[NOT BUILD_STANDALONE_PYTHON_INTERFACE]] | ||
| INSTALL_PYTHON_PACKAGE_FILES [[BUILD_PYTHON_INTERFACE]] |
There was a problem hiding this comment.
| INSTALL_CPP_PACKAGE_FILES [[NOT BUILD_STANDALONE_PYTHON_INTERFACE]] | |
| INSTALL_PYTHON_PACKAGE_FILES [[BUILD_PYTHON_INTERFACE]] | |
| INSTALL_CPP_PACKAGE_FILES ON | |
| INSTALL_PYTHON_PACKAGE_FILES ON |
There is no BUILD_STANDALONE_PYTHON_INTERFACE and BUILD_PYTHON_INTERFACE
| set(script_path ${CMAKE_CURRENT_SOURCE_DIR}/test_${name}.py) | ||
| endif() | ||
|
|
||
| set(test_name "Eigenpy: test_${name}.py") |
There was a problem hiding this comment.
| set(test_name "Eigenpy: test_${name}.py") | |
| set(test_name "eigenpy: test_${name}.py") |
for consistency with cpp test and other project tests
| - run: sudo apt install libboost-all-dev libeigen3-dev python3-numpy python3-scipy | ||
| - run: cmake -B build -S eigenpy | ||
| - run: grep -qvz CMAKE_PROJECT_VERSION:STATIC=0.0 build/CMakeCache.txt | ||
| repository: ahoarau/jrl-cmakemodules |
There was a problem hiding this comment.
Update after jrl-next release
| matrix: | ||
| python: [3] | ||
| ubuntu: [22, 24] | ||
| os: [ubuntu-22.04, ubuntu-24.04] |
There was a problem hiding this comment.
Use docker container ubuntu:22.04 and `ubuntu:24.04' instead of Github image to have right package version.
| - run: make -j2 | ||
| - run: ctest --output-on-failure | ||
| path: ${{ env.CCACHE_DIR }} | ||
| key: ccache-${{ matrix.os }}-${{ matrix.build_type }}-${{ github.sha }} |
There was a problem hiding this comment.
Find an unique prefix (cf github cache discussion in macos-linux-windows-pixi workflow)
| env: | ||
| CMAKE_BUILD_PARALLEL_LEVEL: 2 | ||
| run: | | ||
| pixi run -e ${{ matrix.environment }} build --verbose --parallel 2 |
There was a problem hiding this comment.
By running pixi run build you will rerun pixi run configure.
Pixi can't detect this first step is already done.
| 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 after jrl-next release
| numpy = ">=1.22.0" | ||
| python = ">=3.9.0" | ||
| python = ">=3.10" | ||
| scipy = ">=1.10.0" |
There was a problem hiding this comment.
Add jrl-cmakemodules = ">=2.0" when jrl-next is released
| @@ -48,19 +47,19 @@ extra-args = [ | |||
| pkg-config = ">=0.29.2" | |||
There was a problem hiding this comment.
Remove pkg-config and add jrl-cmakemodules = ">=2.0" when jrl-next is released
| add_test(NAME ${test_name} COMMAND $<TARGET_FILE:Python::Interpreter> ${script_path}) | ||
| set_tests_properties( | ||
| ${test_name} | ||
| PROPERTIES ENVIRONMENT PYTHONPATH=$<TARGET_FILE_DIR:eigenpy_pywrap>/.. DEPENDS eigenpy_pywrap |
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:eigenpy_pywrap>/.."
This PR is a full rewrite of the CMake files with the JRL CMake Modules v2.
c++17minimum required