I am trying to get FetchContent to download a pre-compiled library from a gitlab repository that requires authentication.
On command line it looks like this:
curl --header ‘PRIVATE-TOKEN: afw7f9sd87f’ https://repo.url/api/v4/projects/mylib
I tried the following, but neither an error message, nor the file downloaded.
FetchContent_Declare(MyLib DOWNLOAD_COMMAND /usr/bin/curl --header 'PRIVATE-TOKEN: afw7f9sd87f' https://repo.url/api/v4/projects/bla-bla ) FetchContent_MakeAvailable(MyLib)
- Is it possible to use a custom command to download?
- How to halt configuration if download fails?
- is there a better way to get third party, closed source pre-compiled binaries into a build?