Refactor CMake with JRL CMake Modules v2#437
Refactor CMake with JRL CMake Modules v2#437ahoarau wants to merge 150 commits intoSimple-Robotics:develfrom
Conversation
bd8de6d to
c36d61e
Compare
There was a problem hiding this comment.
This can be removed. Pixi CI replace the conda-ci.
There was a problem hiding this comment.
This should be removed. The Pixi CI will replace this workflow.
| import os | ||
|
|
||
| os.environ["KMP_DUPLICATE_LIB_OK"] = ( | ||
| "True" # to avoid issues with OpenMP in some environments | ||
| ) | ||
|
|
There was a problem hiding this comment.
Can you show me how to reproduce this issue ?
There was a problem hiding this comment.
It is simply ported from upstream https://github.com/Simple-Robotics/proxsuite/blob/devel/bindings/python/CMakeLists.txt#L254-L258
I have no way to verify if this is still useful/relevant.
Much better to put it here than the complicated code inside cmake with conditions. It should not hurt of not used.
| "${PROJECT_NAME}-example-py-${EXAMPLE_NAME}" | ||
| "${EXAMPLE_FILE}" | ||
| "bindings/python" | ||
| function(proxsuite_add_python_example name) |
There was a problem hiding this comment.
This should be added as a test
| function(proxsuite_add_example name) | ||
| add_executable(proxsuite-example-${name} ${name}.cpp) | ||
| target_link_libraries(proxsuite-example-${name} PRIVATE proxsuite) | ||
| add_dependencies(proxsuite-examples-cpp proxsuite-example-${name}) | ||
| endfunction() |
There was a problem hiding this comment.
This should be added as a test
There was a problem hiding this comment.
We must generate ament file before merging this PR
There was a problem hiding this comment.
We must prefix all option with PROXSUITE_ when jrl_option support back compatibility option.
There was a problem hiding this comment.
Let's keep that for another PR. the cmake dependent options is not ported yet.
| include(FetchContent) | ||
| FetchContent_Declare( | ||
| "jrl-cmakemodules" | ||
| GIT_REPOSITORY "https://github.com/jrl-umi3218/jrl-cmakemodules.git" | ||
| catch2 | ||
| URL https://github.com/catchorg/Catch2/archive/refs/tags/v3.11.0.zip | ||
| URL_HASH MD5=ce96600812f04d19694f488ed2de75c5 | ||
| EXCLUDE_FROM_ALL | ||
| ) | ||
| FetchContent_MakeAvailable("jrl-cmakemodules") | ||
| FetchContent_GetProperties("jrl-cmakemodules" SOURCE_DIR JRL_CMAKE_MODULES) | ||
| FetchContent_MakeAvailable(catch2) | ||
| include(${catch2_SOURCE_DIR}/extras/Catch.cmake) |
There was a problem hiding this comment.
Add a comment to know when we can remove this part (on the next Ubuntu LTS ?)
| if(NOT cereal_FOUND) | ||
| message( | ||
| WARNING | ||
| "[proxsuite] cereal library not found. Falling back to FetchContent to get cereal v1.3.2" | ||
| ) | ||
| include(FetchContent) | ||
| FetchContent_Declare( | ||
| cereal | ||
| URL https://github.com/USCiLab/cereal/archive/refs/tags/v1.3.2.zip | ||
| URL_HASH MD5=953a872cd3d78abf2e29212987a0ba71 | ||
| SOURCE_SUBDIR | ||
| download_only | ||
| EXCLUDE_FROM_ALL | ||
| ) | ||
| FetchContent_MakeAvailable(cereal) | ||
| add_library(cereal::cereal INTERFACE IMPORTED) | ||
| target_include_directories(cereal::cereal SYSTEM INTERFACE ${cereal_SOURCE_DIR}/include) | ||
| endif() |
There was a problem hiding this comment.
Add a comment to know when we can remove this part (on the next Ubuntu LTS ?)
| if(NOT nanobind_FOUND) | ||
| message( | ||
| WARNING | ||
| "[proxsuite] nanobind library not found. Falling back to FetchContent to get nanobind v2.9.2" | ||
| ) | ||
| include(FetchContent) | ||
| FetchContent_Declare( | ||
| nanobind | ||
| GIT_REPOSITORY https://github.com/wjakob/nanobind.git | ||
| GIT_TAG v2.9.2 | ||
| EXCLUDE_FROM_ALL | ||
| ) | ||
| FetchContent_MakeAvailable(nanobind) | ||
| endif() |
There was a problem hiding this comment.
Add a comment to know when we can remove this part (on the next Ubuntu LTS ?)
930496b to
e4a6dd2
Compare
remove custom functions as they format in a strange way when favour-inlining (the default) is used.
and submodule dirs
seen with sarah
fixes warnings in the proxsuite-test-utils
…erred otherwise we need to add set_target_properties(run-proxqp PROPERTIES CXX_SCAN_FOR_MODULES OFF)
This PR is a full rewrite of the CMake files with the JRL CMake Modules v2.
c++17minimum requiredpixisupportfind_packagecomponentsfind_package(proxsuite 0.7.1 CONFIG REQUIRED COMPONENTS proxsuite vectorized)TODO