Add git tag / SHA1 as a build string

Every build from commit 20271c6 (Apr 10 2013) is versioned as 1.6.0.
Add a build version after the version number
Digital Speech Decoder 1.6.0 (build:v1.6.0-20-g16110bd)

The build string uses git describe to list the tag closest to head,
and the number of commits past that tag, the a litteral g and ending
with the current SHA1
This commit is contained in:
Dylan Reinhold
2013-12-18 23:07:12 -08:00
parent 271a7e459a
commit 2f6214fe72
6 changed files with 179 additions and 1 deletions

View File

@@ -3,11 +3,17 @@ cmake_minimum_required(VERSION 2.6)
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${dsd_SOURCE_DIR}/cmake/")
include(git_revision)
git_describe(GIT_TAG)
find_package(LibSndFile REQUIRED)
find_package(LibMbe REQUIRED)
FILE(GLOB SRCS *.c)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/git_ver.c.in" "${CMAKE_CURRENT_BINARY_DIR}/git_ver.c" @ONLY)
list(APPEND SRCS "${CMAKE_CURRENT_BINARY_DIR}/git_ver.c" git_ver.h)
INCLUDE_DIRECTORIES(
"${PROJECT_SOURCE_DIR}"
"${LIBSNDFILE_INCLUDE_DIR}"