FetchContent: Allow alternative URLs
This is a feature request to allow alternative URLs in FetchContent_Declare. My use case is that I have a local network file server which if available, has orders of magnitude faster access. For users which are not on this network, naturally it's not available, but I can provide an alternative link to a public file server. Sot it would be nice if I could provide alternative URLs for the content in case the main one is not available
Here is a proposed syntax
FetchContent_Declare(
myCompanyIcons
URL http://192.168.0.145/iconset_1.12.tar.gz
URL_ALT
https://public.mycompany.com/iconset_1.12.tar.gz
https://public.mycompany-backup.com/iconset_1.12.tar.gz
URL_HASH 5588a7b18261c20068beabfb4f530b87
)
Or, maybe, alternatively just make URL a list:
FetchContent_Declare(
myCompanyIcons
URL http://192.168.0.145/iconset_1.12.tar.gz
https://public.mycompany.com/iconset_1.12.tar.gz
https://public.mycompany-backup.com/iconset_1.12.tar.gz
URL_HASH 5588a7b18261c20068beabfb4f530b87
)
I don't think there should be a way to define separate hashes for the alternative URLs, but perhaps there may be also use cases for this (maybe support an alternative with a different version?). I'm not sure what would be a good syntax for them.