From 8cb8ccc5712da169518bb5be7c23bd7d20530818 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 10 Jan 2012 14:38:22 -0500 Subject: [PATCH 1/2] ExternalProject: Fix git.cmd version detection When GIT_EXECUTABLE points at ".../Git/cmd/git.cmd" in an msysGit installation we previously failed to detect the version number in a subtle case. The "git.cmd" assumes 'chcp' is in PATH. It is typically available at "C:\Windows\System32\chcp.com". On 64-bit Windows the File System Redirector maps this location to "C:\Windows\SysWOW64\chcp.com" for 32-bit processes. However, some Windows installations fail to provide chcp.com at this path. Whenever git.cmd runs in a 32-bit command shell, as it does under a 32-bit CMake binary, it reports 'chcp' is not recognized as an internal or external command, operable program or batch file. on stderr. Capture stderr separately so it does not affect parsing of the version number. See also msysGit issue 358: http://code.google.com/p/msysgit/issues/detail?id=358 Note that FindGit prefers "git.cmd" over "git.exe" because it sets up the proper HOME environment variable necessary for Git ssh connections to work the same as they do from the Git bash prompt. --- Modules/ExternalProject.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index a37771b929..308dc704a6 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -954,6 +954,7 @@ function(_ep_get_git_version git_EXECUTABLE git_version_var) execute_process( COMMAND "${git_EXECUTABLE}" --version OUTPUT_VARIABLE ov + ERROR_VARIABLE ev OUTPUT_STRIP_TRAILING_WHITESPACE ) string(REGEX REPLACE "^git version (.+)$" "\\1" version "${ov}") From 4ac6ba2bb8d032cf8a6f5d3073ee8ad3853e0313 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 10 Jan 2012 15:02:56 -0500 Subject: [PATCH 2/2] ExternalProject: Update copyright year --- Modules/ExternalProject.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 308dc704a6..fb55d3bf38 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -144,7 +144,7 @@ # set_property(DIRECTORY PROPERTY EP_STEP_TARGETS configure build test) #============================================================================= -# Copyright 2008-2009 Kitware, Inc. +# Copyright 2008-2012 Kitware, Inc. # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details.