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

[Feature request] Add support for OVERRIDE_FIND_PACKAGE #619

Closed
Jazzinghen opened this issue Nov 18, 2024 · 3 comments
Closed

[Feature request] Add support for OVERRIDE_FIND_PACKAGE #619

Jazzinghen opened this issue Nov 18, 2024 · 3 comments

Comments

@Jazzinghen
Copy link

When adding a package using CPM is not possible to use that package to override the results of find_package, which generates issues with third-party packages using it to find dependencies.

CMake added the option OVERRIDE_FIND_PACKAGE to FetchContent_Declare to help in this case by automatically updating some read-only properties. Would it be possible to support this option?

@Avus-c
Copy link
Contributor

Avus-c commented Nov 18, 2024

This is already supported :)
All arguments that aren't parsed by CPM directly / CPM doesn't know about, are passed directly to FetchContent_Declare.

Something like this should work.

CPMFindPackage(
  ....
  OVERRIDE_FIND_PACKAGE <name>
  ...
)

@patstew
Copy link
Contributor

patstew commented Dec 12, 2024

It isn't, CPM avoids parts of FetchContent that prevent OVERRIDE_FIND_PACKAGE from working.
This PR fixes it. #604
See also #498

@TheLartians
Copy link
Member

As I understand it this should now be resolved by #604, otherwise please re-open the issue.

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

No branches or pull requests

4 participants