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.
Issue:
If I installed aws-c-cal (along with aws-lc and aws-c-common), and then built a simple CMake application that did
find_package(aws-c-cal REQUIRED)
, the application would fail to configure with error message:I could fix the application by explicitly depending on crypto, like:
but that shouldn't be necessary. The application should only need to depend on aws-c-cal, and crypto should be pulled in transitively.
Analysis:
I sprinkled a bunch of print statements around. The failure occurred when
aws-c-cal-config.cmake
includedaws-c-cal-targets.cmake
. CMake would notice that "AWS::crypto" was required, but not yet defined, and so mark aws-c-cal for failure. Later,find_dependency(crypto)
would get run and it would find "AWS::Crypto", but it was too late, aws-c-cal was already marked for failure.Apparently, you must call
find_dependency(crypto)
BEFORE callinginclude(aws-c-cal-targets.cmake)
.Description of changes:
find_dependency()
calls beforeinclude(aws-c-cal-targets.cmake)
@VAR@
style variables in the config file, so that it's simpler for the installed config file to remember how it was originally built.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.