fix(build): Update version on configure

This commit is contained in:
Michael Carlberg 2016-11-26 15:30:08 +01:00
parent c5bc338ae3
commit ad772edc39
3 changed files with 11 additions and 2 deletions

2
.gitignore vendored
View File

@ -1,4 +1,4 @@
build*/
/build*/
!cmake/build/
tags
*.bak

View File

@ -6,6 +6,10 @@
#include "version.hpp"
#define APP_NAME "@PROJECT_NAME@"
#cmakedefine APP_VERSION "@APP_VERSION@"
#ifndef APP_VERSION
#define APP_VERSION GIT_TAG
#endif
#define BASE_PATH "@PROJECT_SOURCE_DIR@"
#cmakedefine01 ENABLE_ALSA
@ -52,7 +56,7 @@ auto version_details = [](const std::vector<std::string>& args) {
// clang-format off
auto print_build_info = [](bool extended = false) {
std::cout << APP_NAME << " " << GIT_TAG << " " << "\n"
std::cout << APP_NAME << " " << APP_VERSION << " " << "\n"
<< "\n"
<< "Features: "
<< (ENABLE_ALSA ? "+" : "-") << "alsa "

View File

@ -2,6 +2,11 @@
# Create executable
#
execute_process(COMMAND git describe --tags --dirty=-git
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE APP_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
configure_file(
${PROJECT_SOURCE_DIR}/include/config.hpp.cmake
${CMAKE_SOURCE_DIR}/include/config.hpp