Skip to content

jrl: Add cppad, cppadcg, gmp and mpfr find-modules - #868

Merged
nim65s merged 8 commits into
jrl-umi3218:masterfrom
ahoarau:add-cppad-gmp-mpfr-finders
Aug 20, 2026
Merged

jrl: Add cppad, cppadcg, gmp and mpfr find-modules#868
nim65s merged 8 commits into
jrl-umi3218:masterfrom
ahoarau:add-cppad-gmp-mpfr-finders

Conversation

@ahoarau

@ahoarau ahoarau commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Taken from stack-of-tasks/pinocchio#2923

Important note:
Initially the Findcppadcg.cmake was calling find_package(cppad REQUIRED) internally.
The issue is that our jrl_export_package() cannot detect transitive find-modules, it only reacts to jrl_find_package().
As we want to keep the find modules jrl-free, they have been edited to be autonomous: Findcppadcg.cmake will look for the cppad::cppad target internally, making it NOT depend on Findcppad.cmake.

An alternative explored was on the user side, with people having to call the required finder before the other:

jrl_find_package(cppad REQUIRED)
jrl_find_package(cppadcg REQUIRED)

So that the cppad find module would get exported. This is not ideal as its difficult to enforce.

@mergify

mergify Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@ahoarau
ahoarau force-pushed the add-cppad-gmp-mpfr-finders branch from 076c2b2 to 10175bf Compare August 13, 2026 10:16
@ahoarau

ahoarau commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator Author

@nim65s I need to invoke your nix magic powers on this one :-)
We need to add cppad, cppagcg, gmp and mpfr if they are available.

@nim65s nim65s left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I wonder if we should try pkg_check_modules(… IMPORTED_TARGET) (or In CMake >= 3.31, cmake_pkg_config(IMPORT …)) instead.

Some packages do not export cmake configs, but the .pc file they ship are good.

But probably we should continue using something similar to v1 find-external for now

@ahoarau

ahoarau commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator Author

I think the objective of the v2 was to drop pkg-config completely, but I like the idea.
Most probably in the future they will ship a cmake config, and drop pkg-config.

@nim65s

nim65s commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

probably not gmp or mpfr

@ahoarau

ahoarau commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator Author

probably not gmp or mpfr

if gmp and mpfr not possible, I need to add an aditionnal option OFF by default to avoid building this test. Let me know.

@nim65s

nim65s commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

I mean I don't think gmp and mpfr will ever switch to CMake

@nim65s
nim65s force-pushed the add-cppad-gmp-mpfr-finders branch 5 times, most recently from 10fee4a to 8f2e02c Compare August 13, 2026 11:57
@nim65s
nim65s marked this pull request as draft August 13, 2026 11:58
@ahoarau
ahoarau force-pushed the add-cppad-gmp-mpfr-finders branch from f53b99f to 7bdb1f5 Compare August 14, 2026 13:27
@nim65s
nim65s force-pushed the add-cppad-gmp-mpfr-finders branch from 7bdb1f5 to ebee581 Compare August 14, 2026 14:47
Comment thread v2/tests/find_modules/CMakeLists.txt
@ahoarau
ahoarau force-pushed the add-cppad-gmp-mpfr-finders branch 2 times, most recently from 8bcc798 to c5cda53 Compare August 17, 2026 11:54
@nim65s
nim65s marked this pull request as ready for review August 17, 2026 12:15
@ahoarau
ahoarau force-pushed the add-cppad-gmp-mpfr-finders branch 4 times, most recently from 80090c9 to a659a12 Compare August 18, 2026 08:43
@ahoarau
ahoarau force-pushed the add-cppad-gmp-mpfr-finders branch from a659a12 to 72da341 Compare August 18, 2026 08:58
@ahoarau
ahoarau force-pushed the add-cppad-gmp-mpfr-finders branch from 72da341 to 0910d3d Compare August 18, 2026 08:59
@nim65s
nim65s merged commit b075335 into jrl-umi3218:master Aug 20, 2026
43 checks passed
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.

2 participants