cmake: Additional controls to customize required/optional dependencies #2507
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.
New cmake variables
REQUIRED_DEPS
andOPTIONAL_DEPS
.REQUIRED_DEPS
is a list of individual package dependencies that areordinarily optional (meaning, if not found, the build continues,
possibly disabling some functionality or format support), and forcing
them to be required (build failure if not found). Note that "ALL"
means everying.
OPTIONAL_DEPS
is a list of individual package dependencies thatmakes them optional even if ordinarily (or via
REQUIRED_DEPS
) wouldbe treated as optional. Extreme caution necessary! If you take
something required and force it to be optional, there's no telling
what else in the build might break as a result.
A typical use case might be if you have automated builds and want to be
sure that if for some reason they can't find all the dependencies (even the
optional ones), you will definitely fail the build. But maybe you have some
exceptions. For example,
That means that you want any missing package dependencies to cause the build
to fail, except for missing DCMTK and R3DSDK, which you don't care about.
Also did some cleanup to turn PNG into an optional dependency, including
graceful disabling of ICO if libpng is not found.