rapids-cmake icon indicating copy to clipboard operation
rapids-cmake copied to clipboard

[FEA] Make version optional in `rapids_cpm_find()` and friends

Open Jacobfaib opened this issue 2 months ago • 0 comments

Is your feature request related to a problem? Please describe.

I would like to be able to find a package and not care about what version is found. find_package() allows you to omit specifying a version, as does CPM. rapids_cpm_find() requires that a version be passed in.

Describe the solution you'd like

Either some kind of DONT_CARE option:

rapids_cpm_find(Foo /* version = */DONT_CARE)

or perhaps add special meaning to specific versions. CPM does this, for example: when passing VERSION 0, to CPMAddPackage() it is equivalent to omitting the version entirely:

rapids_cpm_find(Foo /* version = */ 0)
# or
rapids_cpm_find(Foo /* version = */ 0.0.0)

Describe alternatives you've considered

You can get the same effect today by passing in 0.0.0 to rapids_cpm_find(), but then you get somewhat weird output in the logs:

...
... Adding [email protected] (<SHA>)
...

If there were first-class support for this, perhaps rapids-cmake could print a nicer message here ("Adding Foo@<actual detected version> (<SHA>)")

Jacobfaib avatar Nov 14 '25 15:11 Jacobfaib