[cmake-developers] Patch for ExternalProject_Add git clone -o support

Adam Rankin arankin at robarts.ca
Fri Jan 15 12:50:57 EST 2016


Hello all,

As per my inquiry on the users mailing list, I have implemented support for the -origin parameter of git clone. It is backwards compatible as the parameter is optional and defaults to "origin".

Example use case:
After using ExternalProject_Add to download and built a supporting library, development of that library is needed. In the case of github/bitbucket, the cloned repository can be a fork. To simplify management, providing a more descriptive remote name is desired.

Usage:
  ExternalProject_Add( OpenIGTLink
    "${PLUSBUILD_EXTERNAL_PROJECT_CUSTOM_COMMANDS}"
    SOURCE_DIR "${PLUS_OpenIGTLink_SRC_DIR}"
    BINARY_DIR "${PLUS_OpenIGTLink_DIR}"
    #--Download step--------------
    GIT_REPOSITORY "${GIT_PROTOCOL}://github.com/adamrankin/OpenIGTLink.git"
    GIT_TAG "master"
    GIT_REMOTE_NAME "adamrankin_igtl"
    #--Configure step-------------
...

I have attached a patch that provides an implementation of this parameter and tested it for both cloning and updating.

Feedback is appreciated and I hope this is of use for others.

Kind regards,
Adam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20160115/476715c8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: git_remote_name_support.patch
Type: application/octet-stream
Size: 4557 bytes
Desc: git_remote_name_support.patch
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20160115/476715c8/attachment.obj>


More information about the cmake-developers mailing list