Do not call find_package(<pkg>) if FRAMEWORK_USE_<pkg> is defined #930
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Mitigation for #929 .
Before the PR, find_package() was always called for all optional dependencies, even if
FRAMEWORK_USE_<dep>
is set toOFF
. 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 directoriesfind_package(<dep> QUIET)
can result in a fatal error, instead of just resulting in a failure in finding the packageThis PR changes the CMake logic to avoid to call
find_package
ifFRAMEWORK_USE_<dep>
is already defined.