Files
dsd-fme/CMakeLists.txt
Dylan Reinhold 2f6214fe72 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
2013-12-19 08:49:49 -08:00

38 lines
983 B
CMake

project(dsd)
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}"
"${LIBMBE_INCLUDE_DIR}"
)
SET(LIBS ${LIBS} ${LIBMBE_LIBRARY} ${LIBSNDFILE_LIBRARY})
ADD_EXECUTABLE(dsd ${SRCS})
TARGET_LINK_LIBRARIES(dsd ${LIBS})
install(TARGETS dsd DESTINATION bin)
# uninstall target
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)