mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-13 19:33:13 +01:00
Fix Git tag -> version string conversion on CMake 2.8.0.
This version is notably shipped with Ubuntu 10.04 LTS, used for building the Linux release binaries.
This commit is contained in:
@@ -170,8 +170,12 @@ include(GetGitRevisionDescription)
|
||||
git_get_exact_tag(TAG)
|
||||
if(NOT TAG MATCHES "NOTFOUND")
|
||||
if(TAG MATCHES "v[0-9].*")
|
||||
# For a version tag, remove the leading 'v'.
|
||||
string(SUBSTRING "${TAG}" 1 -1 LDC_VERSION)
|
||||
# For a version tag, remove the leading 'v'. CMake 2.8.0 (e.g. Ubuntu
|
||||
# 10.04 LTS) doesn't support -1 in string(SUBSTRING ...), so spell it
|
||||
# out.
|
||||
string(LENGTH "${TAG}" taglen)
|
||||
MATH(EXPR taglen "${taglen} - 1")
|
||||
string(SUBSTRING "${TAG}" 1 ${taglen} LDC_VERSION)
|
||||
else()
|
||||
set(LDC_VERSION "${TAG}")
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user