fix(build): Update version on configure
This commit is contained in:
parent
c5bc338ae3
commit
ad772edc39
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,4 +1,4 @@
|
|||||||
build*/
|
/build*/
|
||||||
!cmake/build/
|
!cmake/build/
|
||||||
tags
|
tags
|
||||||
*.bak
|
*.bak
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
#include "version.hpp"
|
#include "version.hpp"
|
||||||
|
|
||||||
#define APP_NAME "@PROJECT_NAME@"
|
#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@"
|
#define BASE_PATH "@PROJECT_SOURCE_DIR@"
|
||||||
|
|
||||||
#cmakedefine01 ENABLE_ALSA
|
#cmakedefine01 ENABLE_ALSA
|
||||||
@ -52,7 +56,7 @@ auto version_details = [](const std::vector<std::string>& args) {
|
|||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
auto print_build_info = [](bool extended = false) {
|
auto print_build_info = [](bool extended = false) {
|
||||||
std::cout << APP_NAME << " " << GIT_TAG << " " << "\n"
|
std::cout << APP_NAME << " " << APP_VERSION << " " << "\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "Features: "
|
<< "Features: "
|
||||||
<< (ENABLE_ALSA ? "+" : "-") << "alsa "
|
<< (ENABLE_ALSA ? "+" : "-") << "alsa "
|
||||||
|
@ -2,6 +2,11 @@
|
|||||||
# Create executable
|
# 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(
|
configure_file(
|
||||||
${PROJECT_SOURCE_DIR}/include/config.hpp.cmake
|
${PROJECT_SOURCE_DIR}/include/config.hpp.cmake
|
||||||
${CMAKE_SOURCE_DIR}/include/config.hpp
|
${CMAKE_SOURCE_DIR}/include/config.hpp
|
||||||
|
Loading…
Reference in New Issue
Block a user