llvm.org GIT mirror llvm / f931261
cmake: work with CMake < 2.8.5 CMake versions 2.8.4 and earlier were giving this error since r146323: "string end index: -1 is out of range 0 - 6" Passing -1 as the length of the desired substring was a new feature added in CMake 2.8.5: http://www.cmake.org/Bug/view.php?id=10740 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146372 91177308-0d34-0410-b5e6-96231b3b80d8 Dylan Noblesmith 7 years ago
1 changed file(s) with 3 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
2929 OUTPUT_VARIABLE git_output)
3030 if( git_result EQUAL 0 )
3131 string(REGEX MATCH r[0-9]+ git_svn_rev ${git_output})
32 string(SUBSTRING "${git_svn_rev}" 1 -1 git_svn_rev_number)
32 string(LENGTH "${git_svn_rev}" rev_length)
33 math(EXPR rev_length "${rev_length}-1")
34 string(SUBSTRING "${git_svn_rev}" 1 ${rev_length} git_svn_rev_number)
3335 set(SVN_REVISION ${git_svn_rev_number} PARENT_SCOPE)
3436 set(git_svn_rev "-svn-${git_svn_rev}")
3537