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

Do not call find_package(<pkg>) if FRAMEWORK_USE_<pkg> is defined #930

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

traversaro
Copy link
Collaborator

Mitigation for #929 .

Before the PR, find_package() was always called for all optional dependencies, even if FRAMEWORK_USE_<dep> is set to OFF. This is problematic for two reasons:

  • find_package() (especially the one that are not successful) are quite slow at each configure run, as they always search for files in a really long list of directories
  • If the CMake config files are malformed, even a find_package(<dep> QUIET) can result in a fatal error, instead of just resulting in a failure in finding the package

This PR changes the CMake logic to avoid to call find_package if FRAMEWORK_USE_<dep> is already defined.

@GiulioRomualdi GiulioRomualdi merged commit 9348058 into master Feb 6, 2025
11 of 13 checks passed
@GiulioRomualdi GiulioRomualdi deleted the workaround929 branch February 6, 2025 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants