The URL understood by the git command can be in the format HTTPS or SSH.
In CMake, using ExternalProject_Add for the specified GIT_REPOSITORY any URL understood by the git command may be used.
Using HTTPS user credentials must be given in order to "clone" a private repository. For ExternalProject_Add, such mechanism exists in the form of HTTP_USERNAME and HTTP_PASSWORD when using DOWNLOAD_COMMAND.
For GIT_REPOSITORY there doesn't seem to be such a method. When using:
include( ExternalProject )
ExternalProject_Add(test
GIT_REPOSITORY git@github.com:myuser/myprivaterepo.git
GIT_REMOTE_NAME origin
)
on a private repository the following error is given:
fatal: could not read Username for 'https://github.com': No such device or address
Question
How can I make CMake request a password for GIT_REPOSITORY when using HTTPS connections to a private repository on ExternalProject_Add?