CMake: Don't run 'git svn' if there is no .git/svn directory.

If the local checkout does not have 'git svn' references set up, don't try
to use 'git svn' for version information.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169749 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jim Grosbach 2012-12-10 19:03:37 +00:00
parent 6ac81f59a7
commit 0a2e27d964

View File

@ -20,6 +20,7 @@ function(add_version_info_from_vcs VERS)
elseif( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git )
set(result "${result}git")
# Try to get a ref-id
if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git/svn )
find_program(git_executable NAMES git git.exe git.cmd)
if( git_executable )
set(is_git_svn_rev_exact false)
@ -66,5 +67,6 @@ function(add_version_info_from_vcs VERS)
endif()
endif()
endif()
endif()
set(${VERS} ${result} PARENT_SCOPE)
endfunction(add_version_info_from_vcs)