cmake: Remove REQUIRED from find_dependency() call in package configuration#261
Merged
ethanmusser merged 3 commits intomasterfrom Jan 26, 2026
Merged
Conversation
REQUIRED from find_dependency() call in package configurationREQUIRED from find_dependency() call in package configuration
7 tasks
| find_dependency(MultiSenseWire) | ||
| if (@BUILD_JSON_SERIALIZATION@) | ||
| find_dependency(nlohmann_json 3.9 REQUIRED) | ||
| find_dependency(nlohmann_json 3.9) |
Collaborator
There was a problem hiding this comment.
Why remove the required flag here? I figured if the user wanted to build serialization, they should know if they are missing the associated dependencies
Contributor
Author
There was a problem hiding this comment.
It's just a misuse of the find_dependency() macro. The REQUIRED flag is automatically forwarded from the corresponding find_package() call made by the user in their CMake.
From the CMake docs:
The find_dependency() macro wraps a find_package() call for a package dependency:
find_dependency( [...])
It is designed to be used in a Package Configuration File (Config.cmake). find_dependency forwards the correct parameters for QUIET and REQUIRED which were passed to the original find_package() call.
mattalvarado
approved these changes
Jan 26, 2026
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.
Resolves #245.