From f00638bb860183f900d7c396d2f7f444821e1db3 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Tue, 19 Jun 2018 20:34:31 +0200 Subject: DEBUG Initial idea for #119. Better would be having default values in version.cc in repository and overwriting it with CMake via configure file. Signed-off-by: Szczepan Zalega --- libnitrokey.pro | 1 + version.cc.in | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/libnitrokey.pro b/libnitrokey.pro index ea86294..6db0468 100644 --- a/libnitrokey.pro +++ b/libnitrokey.pro @@ -40,6 +40,7 @@ SOURCES = \ $$PWD/DeviceCommunicationExceptions.cpp \ $$PWD/log.cc \ $$PWD/misc.cc \ + $$PWD/version.cc \ $$PWD/NitrokeyManager.cc \ $$PWD/NK_C_API.cc diff --git a/version.cc.in b/version.cc.in index 0eae647..07ae8e7 100644 --- a/version.cc.in +++ b/version.cc.in @@ -23,15 +23,27 @@ namespace nitrokey { unsigned int get_major_library_version() { + #ifndef PROJECT_VERSION_MAJOR return @PROJECT_VERSION_MAJOR@; + #else + return PROJECT_VERSION_MAJOR; + #endif } unsigned int get_minor_library_version() { + #ifndef PROJECT_VERSION_MINOR return @PROJECT_VERSION_MINOR@; + #else + return PROJECT_VERSION_MINOR; + #endif } const char* get_library_version() { + #ifndef PROJECT_VERSION_GIT return "@PROJECT_VERSION_GIT@"; + #else + return PROJECT_VERSION_GIT; + #endif } } -- cgit v1.2.3