Fix find_package cache pollution#20384
Merged
opencv-pushbot merged 1 commit intoopencv:masterfrom Aug 3, 2021
Merged
Conversation
alalek
reviewed
Jul 12, 2021
| @@ -1,34 +1,34 @@ | |||
| # VTK 9.0 | |||
| if(NOT VTK_FOUND) | |||
| find_package(VTK 9 QUIET NAMES vtk COMPONENTS | |||
Member
There was a problem hiding this comment.
Can we save/restore VTK_DIR variable instead?
Member
Author
There was a problem hiding this comment.
It would work, but I think the approach used in this PR better conveys the intent to select appropriate version of a library as opposed to finding any version of a library with required list of components. Besides, saving and restoring VTK_DIR looks like a workaround, whereas the current implementation simply avoids this problem.
mshabunin
approved these changes
Jul 29, 2021
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Find_package sets VTK_DIR to VTK_DIR-NOTFOUND if we didn't find VTK 9, which leads us to not being able to find VTK 8.2 in custom directory as described in #20314.
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.