From 4cd52dc5511c8c3809b7cb260ac6afa7eec65f2e Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 15 Oct 2015 08:56:53 -0400 Subject: [PATCH 1/2] ExternalProject: Fix Git version report in error message (#15791) Refactoring in commit v3.4.0-rc1~77^2~1 (ExternalProject: Use GIT_VERSION_STRING instead of custom method, 2015-09-17) forgot to update the variable name used in an error message. --- Modules/ExternalProject.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 90ceedf4c..dda45b9dc 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -1739,7 +1739,7 @@ function(_ep_add_download_command name) # The git submodule update '--recursive' flag requires git >= v1.6.5 # if(GIT_VERSION_STRING VERSION_LESS 1.6.5) - message(FATAL_ERROR "error: git version 1.6.5 or later required for 'git submodule update --recursive': git_version='${git_version}'") + message(FATAL_ERROR "error: git version 1.6.5 or later required for 'git submodule update --recursive': GIT_VERSION_STRING='${GIT_VERSION_STRING}'") endif() get_property(git_tag TARGET ${name} PROPERTY _EP_GIT_TAG) From c9e0173e6fb3ddefb43edaa5235eef2c7b31ad67 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 15 Oct 2015 09:34:46 -0400 Subject: [PATCH 2/2] ExternalProject: Always use CMake builtin FindGit (#15791) Unset CMAKE_MODULE_PATH before calling find_package(Git) to ensure we do not get a project-provided FindGit module that may not provide the GIT_VERSION_STRING that we need. We do not need to restore the value explicitly because this occurs inside the _ep_add_download_command function call scope. --- Modules/ExternalProject.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index dda45b9dc..c822bdb97 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -1731,6 +1731,7 @@ function(_ep_add_download_command name) --non-interactive ${svn_trust_cert_args} ${svn_user_pw_args} ${src_name}) list(APPEND depends ${stamp_dir}/${name}-svninfo.txt) elseif(git_repository) + unset(CMAKE_MODULE_PATH) # Use CMake builtin find module find_package(Git QUIET) if(NOT GIT_EXECUTABLE) message(FATAL_ERROR "error: could not find git for clone of ${name}")