rsys

Basic data structures and low-level features
git clone git://git.meso-star.fr/rsys.git
Log | Files | Refs | README | LICENSE

commit 95980b85dea784d2e7883d7de07babe271577f86
parent 35725afcf89c11e2c98af8703c62ddc62bd0e34b
Author: vaplv <vaplv@free.fr>
Date:   Thu, 12 Dec 2013 18:56:21 +0100

Fixed the versionning

Diffstat:
M.gitignore | 1+
Msrc/CMakeLists.txt | 22+++++++---------------
Asrc/rsys_version.h.in | 9+++++++++
3 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -10,3 +10,4 @@ tmp *.cmake tags cmake_build +rsys_version.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt @@ -25,20 +25,12 @@ add_definitions(-D_POSIX_C_SOURCE=200112L) ################################################################################ # Define targets ################################################################################ -macro(version_get component) - file(STRINGS "rsys.h" RSYS_VERSION_${component}_LINE - REGEX "^#define[ \t]+RSYS_VERSION_${component}[ \t]+[0-9]+$") - string(REGEX REPLACE "^#define[ \t]+RSYS_VERSION_${component}[ \t]+([0-9]+)$" "\\1" - RSYS_VERSION_${component} "${RSYS_VERSION_${component}_LINE}") - if(RSYS_VERSION_${component} STREQUAL "") - message(FATAL_ERROR "The ${component} version of the library can't be defined") - endif() -endmacro() -version_get(MAJOR) -version_get(MINOR) -version_get(PATCH) - -set(RSYS_VERSION ${RSYS_VERSION_MAJOR}.${RSYS_VERSION_MINOR}.${RSYS_VERSION_PATCH}) +set(VERSION_MAJOR 0) +set(VERSION_MINOR 0) +set(VERSION_PATCH 0) +configure_file(rsys_version.h.in ${CMAKE_CURRENT_SOURCE_DIR}/rsys_version.h) + +set(RSYS_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) message(STATUS "Current library version: ${RSYS_VERSION}") set(RSYS_FILES_SRC @@ -64,7 +56,7 @@ target_link_libraries(rsys dl rt) set_target_properties(rsys PROPERTIES DEFINE_SYMBOL RSYS_SHARED_BUILD VERSION ${RSYS_VERSION} - SOVERSION ${RSYS_VERSION_MAJOR}) + SOVERSION ${VERSION_MAJOR}) ################################################################################ # Add tests diff --git a/src/rsys_version.h.in b/src/rsys_version.h.in @@ -0,0 +1,9 @@ +#ifndef RSYS_VERSION_H +#define RSYS_VERSION_H + +#define RSYS_VERSION_MAJOR @VERSION_MAJOR@ +#define RSYS_VERSION_MINOR @VERSION_MINOR@ +#define RSYS_VERSION_PATCH @VERSION_PATCH@ + +#endif /* RSYS_VERSION_H */ +