Просмотр исходного кода

Merge topic 'externalproject-download-git-2.20-fix' into release-3.18

8dbefc3ca6 ExternalProject: omit --no-checkout from git clone when using git 2.20.x.

Acked-by: Kitware Robot <[email protected]>
Merge-request: !5054
Brad King 5 лет назад
Родитель
Сommit
90c88302b5
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      Modules/ExternalProject.cmake

+ 5 - 1
Modules/ExternalProject.cmake

@@ -1124,7 +1124,11 @@ function(_ep_write_gitclone_script script_filename source_dir git_EXECUTABLE git
     message(FATAL_ERROR "Tag for git checkout should not be empty.")
   endif()
 
-  set(git_clone_options "--no-checkout")
+  if(GIT_VERSION_STRING VERSION_LESS 2.20 OR 2.21 VERSION_LESS_EQUAL GIT_VERSION_STRING)
+    set(git_clone_options "--no-checkout")
+  else()
+    set(git_clone_options)
+  endif()
   if(git_shallow)
     if(NOT GIT_VERSION_STRING VERSION_LESS 1.7.10)
       list(APPEND git_clone_options "--depth 1 --no-single-branch")