diff options
author | Christian Fetzer <fetzer.ch@gmail.com> | 2016-11-07 20:53:23 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-11-09 20:54:13 (GMT) |
commit | 2be9d85af8caddb26936279a2ed9b226e97ea410 (patch) | |
tree | 77cb62810a2a082d21cba71722b77e713d7bf180 /Tests/ExternalProject | |
parent | 88f38a2bb42599561e685dfba956866d857fe518 (diff) | |
download | CMake-2be9d85af8caddb26936279a2ed9b226e97ea410.zip CMake-2be9d85af8caddb26936279a2ed9b226e97ea410.tar.gz CMake-2be9d85af8caddb26936279a2ed9b226e97ea410.tar.bz2 |
ExternalProject: Allow passing config flags to git clone
Add a `GIT_CONFIG` parameter that allows to specify `--config` flags
that are passed to the git clone command. This can be used to specify
for example `core.autocrlf=true`. The `--config` parameter is supported
since Git 1.7.7.
Diffstat (limited to 'Tests/ExternalProject')
-rw-r--r-- | Tests/ExternalProject/CMakeLists.txt | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt index ca6462d..72c20eb 100644 --- a/Tests/ExternalProject/CMakeLists.txt +++ b/Tests/ExternalProject/CMakeLists.txt @@ -363,6 +363,23 @@ if(do_git_tests) ) set_property(TARGET ${proj} PROPERTY FOLDER "GIT") + # Live git / master (no GIT_TAG), but git config flags + # + # The `git clone --config` parameter has been introduced in Git 1.7.7 + if(NOT git_version VERSION_LESS 1.7.7) + set(proj TutorialStep1-GIT-config) + ExternalProject_Add(${proj} + GIT_REPOSITORY "${local_git_repo}" + GIT_CONFIG core.eol=lf core.autocrlf=input + CMAKE_GENERATOR "${CMAKE_GENERATOR}" + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> + INSTALL_COMMAND "" + DEPENDS "SetupLocalGITRepository" + LOG_UPDATE 1 + ) + set_property(TARGET ${proj} PROPERTY FOLDER "GIT") + endif() + # git by explicit branch/tag with empty submodule list # set(proj TutorialStep1-GIT-bytag-withsubmodules) |