We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2347727 commit ad126e7Copy full SHA for ad126e7
CMakeLists.txt
@@ -170,8 +170,12 @@ include(GetGitRevisionDescription)
170
git_get_exact_tag(TAG)
171
if(NOT TAG MATCHES "NOTFOUND")
172
if(TAG MATCHES "v[0-9].*")
173
- # For a version tag, remove the leading 'v'.
174
- 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
175
+ # out.
176
+ string(LENGTH "${TAG}" taglen)
177
+ MATH(EXPR taglen "${taglen} - 1")
178
+ string(SUBSTRING "${TAG}" 1 ${taglen} LDC_VERSION)
179
else()
180
set(LDC_VERSION "${TAG}")
181
endif()
0 commit comments