cpm-cmake / CPM.cmake

📦 CMake's missing package manager. A small CMake script for setup-free, cross-platform, reproducible dependency management.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow shorthand syntax for SSH URIs

olafmustafar opened this issue · comments

I'm trying to add an internal repository using the ssh protocol:
I know it will work if write

 CPMAddPackage(
     GIT_REPOSITORY "git@github.com:xxxxxx/yyyyyy.git"
     GIT_TAG master
 )

I think it would be nice if it could be done using oneline like this:

  CPMAddPackage( "git@github.com:xxxxxx/yyyyyy.git#master")
  #or
  CPMAddPackage( "ssh:git@github.com:xxxxxx/yyyyyy.git#master")

Is it possible?
// I took a look into the code and know there can be some issues parsing the '@' char, maybe some improvments on the regex could fix this.

One possibility to use the shorthand syntax in the current version of CPM would be to locally configure git to use ssh instead of https for all Github requests. E.g. by running

git config --global url."ssh://git@github.com".insteadOf "https://github.com"

Note however that this will globally affect all git calls on your current user's account.

Yes, this would work. But its preferable if i could use the shorthand syntax without changing the global configurations