Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] rapids_find_package() called with explicit version and REQUIRED should fail #214

Conversation

trxcllnt
Copy link
Contributor

Calling rapids_find_package(<pkg> <version> EXACT REQUIRED) should cause find_package to fail due to not finding the specified version, but it doesn't because the REQUIRED flag is placed in front of the version in the find_package() call.

@trxcllnt trxcllnt requested a review from a team as a code owner July 13, 2022 19:54
@trxcllnt trxcllnt added improvement Improves an existing functionality 3 - Ready for Review Ready for review by team non-breaking Introduces a non-breaking change labels Jul 13, 2022
@robertmaynard
Copy link
Contributor

The documentation for rapids_find_package states the arguments are:

rapids_find_package(<PackageName> [REQUIRED] ... [ FIND_ARGS])

Which would mean that REQUIRED is supported before a version value.

We have a couple of options:

  1. We remove REQUIRED from the documented supported values to rapids_find_package
  2. We add a single parameter field VERSION which we use to properly propagate the version value (
  3. We magically see if we can find a version value in the user arguments.

In addition the tests should be using the FIND_ARGS positional sentinal value before the version value, EXACT, and config.

@@ -47,6 +47,17 @@ so users have consistency. List all targets used by your project in `GLOBAL_TARG
If the project/package you are looking for doesn't have an existing
CMake Find module, please look at using :cmake:command:`rapids_find_generate_module`.

.. note::
This function supports two call modes:
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks good, but can we add in-line examples to these

@robertmaynard
Copy link
Contributor

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 9d214c3 into rapidsai:branch-22.08 Jul 20, 2022
@trxcllnt trxcllnt deleted the fix/rapids-find-package-version-required-not-found branch September 9, 2022 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review Ready for review by team improvement Improves an existing functionality non-breaking Introduces a non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants