How downloading a single file from GitHub/GitLab using FetchContent

Hello all,

I’m failing using

FetchContent_Declare(
myArchive
URL https://somerepo_on_gitlab/link_of_an_archive.zip)

to provide an archive for my project.

What is downloaded is the website, not the archive.

Using a local path works as expected. The link is valid. When passed to my
browser, the file is being downloaded.

FILE(DOWNLOAD …) fails as well - for the same reasons I guess.

How to tell CMake, to follow the given link to download that file?

Sorry for this stupid question that certainly has been answered many times.

Thanks in advance!
Roman

FetchContent_Populate(
myArchive
URL https://somerepo_on_gitlab/link_of_an_archive.zip)

Tried it out - but the same result. I get a 13 kb file named as the archive but containing HTML code.
I looks like it’s a login site. So, that’s the problem. I wonder, because using FetchContent for Git repositories on the same server that require the same authentification works (authentification done using OpenSSH-Agent in the Bash).