summaryrefslogtreecommitdiffstats
path: root/Modules/ExternalProject.cmake
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2012-04-25 21:30:18 (GMT)
committerDavid Cole <david.cole@kitware.com>2012-04-25 21:30:18 (GMT)
commit987c017f6b1b49ab832c244166e30e07260432da (patch)
tree40c658d2ba59598f736cf16a6fe552fc176f3e1f /Modules/ExternalProject.cmake
parent8bb46ee787828c75b825d72b7121296d91bef7d6 (diff)
downloadCMake-987c017f6b1b49ab832c244166e30e07260432da.zip
CMake-987c017f6b1b49ab832c244166e30e07260432da.tar.gz
CMake-987c017f6b1b49ab832c244166e30e07260432da.tar.bz2
ExternalProject: Avoid unnecessary git clones (#12564)
In the case of git, only track the repository in the repository info dependency tracking file. Not the tag. The download step should only re-run if the repository changes. The download step should NOT re-run if the tag changes. The update step is an 'always' re-running step, and so should already re-run, unless it's been eliminated by use of UPDATE_COMMAND ""
Diffstat (limited to 'Modules/ExternalProject.cmake')
-rw-r--r--Modules/ExternalProject.cmake8
1 files changed, 7 insertions, 1 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 301d1fc..1997572 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -1079,9 +1079,15 @@ function(_ep_add_download_command name)
set(git_tag "master")
endif()
+ # For the download step, and the git clone operation, only the repository
+ # should be recorded in a configured RepositoryInfo file. If the repo
+ # changes, the clone script should be run again. But if only the tag
+ # changes, avoid running the clone script again. Let the 'always' running
+ # update step checkout the new tag.
+ #
set(repository ${git_repository})
set(module)
- set(tag ${git_tag})
+ set(tag)
configure_file(
"${CMAKE_ROOT}/Modules/RepositoryInfo.txt.in"
"${stamp_dir}/${name}-gitinfo.txt"