FetchContent documentation does not explain how git-ssh public keys are chosen
In my CMakeLists, I have a line like:
FetchContent_Declare( holoplaycoresdk GIT_REPOSITORY firstname.lastname@example.org:excessive/cpml.git GIT_TAG ddb80f48e6a3f7d9b98aa45b6feeb461db3d0c6a # tag 1.0.0 ) FetchContent_MakeAvailable(holoplaycoresdk)
(In the actual CMakeLists, the URL goes to a special repo that requires access to a particular Git organization, which is why I must use the git protocol instead of https://. However, I have replaced it with a generic git repo here for illustration.)
On a Windows 10 machine, in a WSL Bash window, I invoke
cmake.exe to run my CMakeLists for a Windows build. I am using cmake version 3.17.0-rc1 downloaded using the installer from the cmake.org site. I get an error:
Performing download step (git clone) for 'holoplaycoresdk-populate' Cloning into 'holoplaycoresdk-src'... Host key verification failed. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
This error is printed 3 times. The meaning of the error message is clear. CMakeLists is connecting to github using the git+ssh protocol. Doing this requires an ssh public key associated with a real github account. My SSH keys are stored in WSL ~/.ssh, but Windows CMake probably doesn't have any idea where to find those. The solution would be equally clear: Register my github ssh public key with Windows git. Except:
I don't know where to put the SSH keys that Windows CMake could find them. I don't have any Windows git installed, so CMake must be vending its own git, which implies(?) it is probably vending its own ssh. But I don't know where CMake's ssh stores its public keys. If I look in the FetchContent documentation, and scrub the entire page for mentions of "git", "ssh", "download" or "FetchContent_", I find no mention of where the ssh configuration comes from.
Without this information, I cannot access the needed git repo using FetchContent.
There should be a discoverable line in the FetchContent documentation explaining what git/ssh it uses, how to configure that git/ssh, and ideally (because this is necessary for github, a very commonly used site) a brief mention of how to set ssh keys. If you are shelling out to the system git then you can simply say that the user should set ssh keys in their system git, but if on some platforms you are installing your own version, more explanation or a link to other resources is needed.
More than one bug?
The above issue report assumes it is possible to set SSH keys in the git vended by Windows CMake. If this is not currently possible, then I think this is a functional issue in addition to the documentation issue.