ExternalProject: DOWNLOAD_NAME is ignored in some scenarios
Split out from #25062 to focus on a specific bug identified there.
If a call to ExternalProject_Add()
uses the URL
download method, and if a DOWNLOAD_NAME
is also provided, that name might be ignored in some situations. If DOWNLOAD_NO_EXTRACT
is not set to true, and if the URL
does not end in a recognised archive file extension (the regular expression used is currently 7z|tar|tar\.bz2|tar\.gz|tar\.xz|tbz2|tgz|txz|zip
), then the download file name is forced to be archive.tar
, discarding any DOWNLOAD_NAME
which may have been provided. If a DOWNLOAD_NAME
is given, we should always use that.