This repository was archived by the owner on Apr 15, 2020. It is now read-only.
Fix location of version_not_found check#1342
Merged
ruslo merged 2 commits intoruslo:masterfrom Feb 4, 2018
Merged
Conversation
If a hunter_config() call specifies a VERSION that isn’t defined in a hunter_add_version() call (hunter/cmake/<package>/hunter.cmake), then a call to hunter_download_server_url() is made with an empty VERSION, and the reported error looks like this:
```
-- [hunter *** DEBUG *** 2018-02-03T17:12:33] FunctionalPlus versions available: [B.A.D]
[hunter ** INTERNAL **] 'hunter_download_server_url' incorrect usage
[hunter ** INTERNAL **] option 'SHA1' with one argument is mandatory.
```
This PR moves the existing HUNTER_PACKAGE_SHA1 version_not_found test above the call to hunter_download_server_url, such that the more intuitive error:
```
"Version not found: ${ver}. See 'hunter_config' command.")
```
occurs first, instead of the indirect error that is reported inside hunter_download_server_url.
The error then becomes more human readable:
```
-- [hunter *** DEBUG *** 2018-02-03T17:15:09] FunctionalPlus versions available: [B.A.D]
[hunter ** FATAL ERROR **] Version not found: 1.0.0. See 'hunter_config' command.
```
ruslo
approved these changes
Feb 4, 2018
Owner
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
If a
hunter_config()call specifies aVERSIONthat isn’t defined by ahunter_add_version()call (hunter/cmake//hunter.cmake), perhaps due to a typo, then a call tohunter_download_server_url()will be made with an emptyVERSION, and the reported error looks like this:In this case may have asked for something like
hunter_config(Foo VERSION 1.0.0), or a typohunter_config(FOO VERSION 1.0.0y), but only a validVERSION1.0.9999999exists.This PR moves the existing HUNTER_PACKAGE_SHA1 version_not_found test above the call to
hunter_download_server_url(), such that a more intuitive error is reported with the strong: "Version not found: ${ver}. See 'hunter_config' command."With this change, the log listed above then becomes more human readable:
and the developer can more easily diagnose and fix the source of the VERSION mismatch error.