version defines prefixed with name, full version

now the version variables will be prefixed with 'tmux-mem-cpu-load'. This way we
won't clash with any future dependency that might redefine those variables.
This is exactly how CMake does it in their code, see:

f3e92d2816/Source/CMakeVersion.cmake
6ae98ee18f/Source/cmVersionConfig.h.in
6ae98ee18f/Source/CMakeVersionCompute.cmake

the only difference is that they have functions that return the versions and I
use those variables directly.

6ae98ee18f/Source/cmVersion.cxx

Since the partial version variables are not used anywhere in the code we might
as well remove them from version.h.in. I've deciced to leave them for now, since
we might need them in the future.
This commit is contained in:
Pawel "l0ner" Soltys 2015-01-18 14:51:27 +01:00
parent 51f85ba032
commit 89a4b0c048
3 changed files with 12 additions and 11 deletions

@ -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(

@ -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 );

@ -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@"