[CMake] externalproject fails on submodule

hex hex7c3 at gmail.com
Mon Jul 8 09:07:56 EDT 2019


hello CMake community,


I am using a private git repository with SSH URL with two different git 
remote server. The repository on github is using an git submodule on 
bitbucket.


/include( ExternalProject )//
//
//ExternalProject_Add(test//
//    GIT_REPOSITORY git at github.com:myuser/myprivaterepo.git//
//    GIT_REMOTE_NAME origin//
//)/


1. Cloning the repository 'origin/master' is successful

2. Cloning into the submodule fails: it is unable to check out a git commit

3. To test my SSH connection I tried above CMake commands cloning solely 
the submodule, which is successful (see below with different URL)


/include( ExternalProject )//
////
//ExternalProject_Add(test//
//    GIT_REPOSITORY git at bitbucket.org:myusername/mysubmodule.git//
//    GIT_REMOTE_NAME origin//
//)/


The complete error message from first example is given below:



Scanning dependencies of target test
[ 12%] Creating directories for 'test'
[ 25%] Performing download step (git clone) for 'test'
Cloning into 'test'...
Already on 'master'
Your branch is up-to-date with 'origin/master'.
Submodule 'mysubmodule' (git at bitbucket.org:myusername/mysubmodule.git) 
registered for path 'mysubmodule'
Cloning into 'mysubmodule'...
fatal: reference is not a tree: 6a0b950ed42ce225cc2df0
Unable to checkout '6a0b950ed42ce225cc2df0' in submodule path 'mysubmodule'
CMake Error at 
/home/user/testing/build/test-prefix/tmp/test-gitclone.cmake:49 (message):
   Failed to update submodules in:
   '/home/user/testing/build/test-prefix/src/test'


How can I use the repository with submodules?


thank you

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20190708/202667ef/attachment.html>


More information about the CMake mailing list