Commit de19c20f authored by Nabil Chouika's avatar Nabil Chouika
Browse files

Merge branch 'implementation_of_version_information' into 'master'

Implement version information

See merge request !2
parents 538d3497 b7f9691b
......@@ -9,6 +9,21 @@ project(ElementaryUtils CXX)
# define c++ standard and issue all the warning demanded by this standard
add_definitions(-std=c++98 -pedantic)
# VERSION ==================================================================================
# read file
file(READ ${CMAKE_SOURCE_DIR}/data/version.txt VERSION_STR)
# strip spaces
string(STRIP ${VERSION_STR} VERSION_STR)
# get major and minor versions
string(REGEX REPLACE "\\.[0-9]*" "" ELEMENTARY_UTILS_VERSION_MAJOR ${VERSION_STR})
string(REGEX REPLACE "[0-9]*\\." "" ELEMENTARY_UTILS_VERSION_MINOR ${VERSION_STR})
# configure
configure_file(${CMAKE_SOURCE_DIR}/cmake/Version/ElementaryUtilsVersion.h_in ${CMAKE_SOURCE_DIR}/include/ElementaryUtils/ElementaryUtilsVersion.h)
# AUTOMOC ==================================================================================
# tell cmake to run Qt moc when necessary
......
/**
* @file ElementaryUtilsVersion.h
* @author Pawel Sznajder (NCBJ, Warsaw)
* @date August 8, 2017
* @version 1.0
*
* This file is used to define ElementaryUtils version number and it is set by CMake.
*/
#define ELEMENTARY_UTILS_VERSION(major,minor) (((major) << 8) + (minor))
#define ELEMENTARY_UTILS_VERSION_MAJOR @ELEMENTARY_UTILS_VERSION_MAJOR@
#define ELEMENTARY_UTILS_VERSION_MINOR @ELEMENTARY_UTILS_VERSION_MINOR@
#define ELEMENTARY_UTILS_VERSION_CODE ELEMENTARY_UTILS_VERSION(ELEMENTARY_UTILS_VERSION_MAJOR, ELEMENTARY_UTILS_VERSION_MINOR)
\ No newline at end of file
/ElementaryUtilsVersion.h
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment