summaryrefslogtreecommitdiffstats
path: root/Modules/ExternalProject.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-05-21 14:36:49 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-05-21 14:36:56 (GMT)
commitbd0ccb73f2e7a4589ceae5505a359442519c5684 (patch)
tree58482df7d99011543b39f2d2ce97a7530e15b416 /Modules/ExternalProject.cmake
parentf9067e806f7a7863cdb439e267750a2047814181 (diff)
parent8a9753e4279788ff30bd59c0a9f88392fa3cfd68 (diff)
downloadCMake-bd0ccb73f2e7a4589ceae5505a359442519c5684.zip
CMake-bd0ccb73f2e7a4589ceae5505a359442519c5684.tar.gz
CMake-bd0ccb73f2e7a4589ceae5505a359442519c5684.tar.bz2
Merge topic 'git-config-version-check'
8a9753e427 ExternalProject: Only add git config setting with git 1.7.7 or later Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6145
Diffstat (limited to 'Modules/ExternalProject.cmake')
-rw-r--r--Modules/ExternalProject.cmake8
1 files changed, 5 insertions, 3 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 026d1fc..9e25bee 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -2680,9 +2680,11 @@ function(_ep_add_download_command name)
get_property(git_progress TARGET ${name} PROPERTY _EP_GIT_PROGRESS)
get_property(git_config TARGET ${name} PROPERTY _EP_GIT_CONFIG)
- # Make checkouts quiet when checking out a git hash (this avoids the
- # very noisy detached head message)
- list(PREPEND git_config advice.detachedHead=false)
+ # If git supports it, make checkouts quiet when checking out a git hash.
+ # This avoids the very noisy detached head message.
+ if(GIT_VERSION_STRING VERSION_GREATER_EQUAL 1.7.7)
+ list(PREPEND git_config advice.detachedHead=false)
+ endif()
# For the download step, and the git clone operation, only the repository
# should be recorded in a configured RepositoryInfo file. If the repo