1
0
Fork 0
forked from lthn/blockchain

fix "git describe" parsing regexp (issue with wrong commit id in build numbers)

This commit is contained in:
sowle 2020-09-21 14:39:21 +03:00
parent 9f964860f3
commit 0186d4619b
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC

View file

@ -4,8 +4,7 @@ if(RET)
set(VERSION "${COMMIT}")
configure_file("src/version.h.in" "${TO}")
else()
string(REGEX MATCH "([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f])?(-dirty)? $" COMMIT "${DESCRIPTION} ")
string(STRIP "${COMMIT}" COMMIT)
set(VERSION "${COMMIT}")
string(REGEX MATCH "[^0-9a-f]([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f])[0-9a-f]*(-dirty)?" STUB_VAR "${DESCRIPTION}")
set(VERSION "${CMAKE_MATCH_1}${CMAKE_MATCH_2}")
configure_file("src/version.h.in" "${TO}")
endif()
endif()