mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-04-05 02:58:37 -04:00
cmake: sdrangel_VERSION_SUFFIX add the number of commits from last tag
Example: SDRangel Version: 4.8.0-53-gc24a37d01
This commit is contained in:
parent
c24a37d011
commit
e29500fc6d
@ -55,14 +55,15 @@ add_definitions("-DIDENTIFIER=\"${IDENTIFIER}\"")
|
||||
|
||||
find_package(Git)
|
||||
if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git/")
|
||||
execute_process(COMMAND "${GIT_EXECUTABLE}" rev-parse --short HEAD
|
||||
execute_process(COMMAND "${GIT_EXECUTABLE}" describe --tags
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||
RESULT_VARIABLE res
|
||||
OUTPUT_VARIABLE out
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if(NOT res)
|
||||
set(sdrangel_VERSION_SUFFIX "-${out}")
|
||||
string(REGEX REPLACE "^v([0-9]+)\.([0-9]+)\.([0-9]+)-" "" git_commit ${out})
|
||||
set(sdrangel_VERSION_SUFFIX "-${git_commit}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user