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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

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.

2 participants