From 54cf4c5ef2c76f0222f236d5c3c8ba82d3744ce8 Mon Sep 17 00:00:00 2001 From: jakcron Date: Sun, 17 Feb 2019 15:18:24 +0800 Subject: [PATCH] Program version is now determined from makefile. --- src/UserSettings.cpp | 2 +- src/version.h | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/UserSettings.cpp b/src/UserSettings.cpp index bf97fb8..6c5914b 100644 --- a/src/UserSettings.cpp +++ b/src/UserSettings.cpp @@ -45,7 +45,7 @@ void UserSettings::parseCmdArgs(const std::vector& arg_list) void UserSettings::showHelp() { - printf("%s v%d.%d.%d (C) %s\n", APP_NAME, VER_MAJOR, VER_MINOR, VER_PATCH, AUTHORS); + printf("%s v%d.%d.%d (C) %s\n", APP_NAME, PROJECT_VER_MAJOR, PROJECT_VER_MINOR, PROJECT_VER_PATCH, PROJECT_AUTHORS); printf("Built: %s %s\n\n", __TIME__, __DATE__); printf("Usage: %s [options... ] \n", BIN_NAME); diff --git a/src/version.h b/src/version.h index 4773fb4..13d5c57 100644 --- a/src/version.h +++ b/src/version.h @@ -1,7 +1,15 @@ #pragma once #define APP_NAME "NSTool" #define BIN_NAME "nstool" -#define VER_MAJOR 1 -#define VER_MINOR 0 -#define VER_PATCH 5 -#define AUTHORS "jakcron" \ No newline at end of file + +#ifndef PROJECT_VER_MAJOR +#define PROJECT_VER_MAJOR 0 +#endif +#ifndef PROJECT_VER_MINOR +#define PROJECT_VER_MINOR 0 +#endif +#ifndef PROJECT_VER_PATCH +#define PROJECT_VER_PATCH 0 +#endif + +#define PROJECT_AUTHORS "jakcron" \ No newline at end of file