Prevent fatal_error on FetchContent_Declare

How do you use FetchContent_Declare/FetchContent_MakeAvailable (FetchContent_Populate) without having it throw a fatal_error if the download fails ?

The use case is like so:
find_package, if it fails do
a FetchContent_Declare/FetchContent_MakeAvailable using a git url, if it fails do
a FetchContent_Declare/FetchContent_MakeAvailable using a targz url, if it fails do
a FetchContent_Declare/FetchContent_MakeAvailable using a filesystem targz, etc…

You may need to implement your own DOWNLOAD_COMMAND to do that. You are allowed to have multiple URLs to download though (I think file:// works), but mixing GIT_REPOSITORY and URL doesn’t seem to be trivial (as the ordering likely needs to be explicit or remembered when parsing arguments).

FetchContent_MakeAvailable() always succeeds or issues a fatal error. It does not support the “optional” finding behavior like you have with find_package(). I have no plans to change that, it would add significant complexity, but for implementing the feature and all projects which would then have to potentially handle such a case.