diff --git a/CMakeLists.txt b/CMakeLists.txt index 69478ff..75079e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,9 +24,12 @@ endif(COMMAND cmake_policy) ### General Package stuff project( tmux-mem-cpu-load ) -set(VERSION_MAJOR 2) -set(VERSION_MINOR 3) -set(VERSION_PATCH 0) +set(tmux-mem-cpu-load_VERSION_MAJOR 2) +set(tmux-mem-cpu-load_VERSION_MINOR 3) +set(tmux-mem-cpu-load_VERSION_PATCH 0) +#Compute full version string +set(tmux-mem-cpu-load_VERSION + ${tmux-mem-cpu-load_VERSION_MAJOR}.${tmux-mem-cpu-load_VERSION_MINOR}.${tmux-mem-cpu-load_VERSION_PATCH}) # generate header file to handle version configure_file( diff --git a/tmux-mem-cpu-load.cpp b/tmux-mem-cpu-load.cpp index a859889..15d090f 100644 --- a/tmux-mem-cpu-load.cpp +++ b/tmux-mem-cpu-load.cpp @@ -96,10 +96,8 @@ int main( int argc, char** argv ) // ugly, I know std::string intro = "tmux-mem-cpu-load v"; - intro += std::to_string( VERSION_MAJOR ) + "."; - intro += std::to_string( VERSION_MINOR ) + "."; - intro += std::to_string( VERSION_PATCH ) + "\n"; - intro += "Usage: tmux-mem-cpu-load [OPTIONS]"; + intro += tmux_mem_cpu_load_VERSION; + intro += "\nUsage: tmux-mem-cpu-load [OPTIONS]"; arg.setIntroduction( intro ); diff --git a/version.h.in b/version.h.in index 81a4c45..c46dd04 100644 --- a/version.h.in +++ b/version.h.in @@ -17,7 +17,7 @@ */ // the configured options and settings for sysstat -#define VERSION_MAJOR @VERSION_MAJOR@ -#define VERSION_MINOR @VERSION_MINOR@ -#define VERSION_PATCH @VERSION_PATCH@ - +#define tmux_mem_cpu_load_VERSION_MAJOR @tmux-mem-cpu-load_VERSION_MAJOR@ +#define tmux_mem_cpu_load_VERSION_MINOR @tmux-mem-cpu-load_VERSION_MINOR@ +#define tmux_mem_cpu_load_VERSION_PATCH @tmux-mem-cpu-load_VERSION_PATCH@ +#define tmux_mem_cpu_load_VERSION "@tmux-mem-cpu-load_VERSION@"