diff --git a/CMakeLists.txt b/CMakeLists.txt index d877628..476ff9b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,10 +3,12 @@ if(COMMAND cmake_policy) cmake_policy(VERSION 2.6) endif(COMMAND cmake_policy) +### General Package stuff + project( tmux-mem-cpu-load ) -set(tmux-mem-cpu-load_VERSION_MAJOR 2) -set(tmux-mem-cpu-load_VERSION_MINOR 3) -set(tmux-mem-cpu-load_VERSION_PATCH 0) +set(VERSION_MAJOR 2) +set(VERSION_MINOR 3) +set(VERSION_PATCH 0) # generate header file to handle version configure_file( @@ -14,6 +16,8 @@ configure_file( "${PROJECT_SOURCE_DIR}/version.h" ) + + if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE MinSizeRel CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." diff --git a/tmux-mem-cpu-load.cpp b/tmux-mem-cpu-load.cpp index f525014..77a9d2f 100644 --- a/tmux-mem-cpu-load.cpp +++ b/tmux-mem-cpu-load.cpp @@ -24,6 +24,8 @@ // Tmux color lookup tables for the different metrics. #include "luts.h" +#include "version.h" + #if defined(__APPLE__) && defined(__MACH__) // Apple osx system #include "osx/cpu.h" diff --git a/version.h.in b/version.h.in index 23711c8..8bbfddb 100644 --- a/version.h.in +++ b/version.h.in @@ -1,5 +1,5 @@ // the configured options and settings for sysstat -#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 VERSION_MAJOR @VERSION_MAJOR@ +#define VERSION_MINOR @VERSION_MINOR@ +#define VERSION_PATCH @VERSION_PATCH@