Skip to content
Snippets Groups Projects
Commit aaee7793 authored by Valerio Mariani's avatar Valerio Mariani
Browse files

Support for library versioning

Version is now defined only in the CMakeList.txt at the top level. Everything in OpenStructure picks it up from there
parent a983f0c0
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,10 @@
cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR)
project(OpenStructure CXX C)
set (OST_VERSION_MAJOR 1)
set (OST_VERSION_MINOR 2)
set (OST_VERSION_PATCH 0)
set (OST_VERSION_STRING ${OST_VERSION_MAJOR}.${OST_VERSION_MINOR}.${OST_VERSION_PATCH} )
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake_support)
include(OST)
......
......@@ -187,6 +187,9 @@ macro(module)
get_target_property(_DEFS ${_LIB_NAME} COMPILE_DEFINITIONS)
set_target_properties(${_LIB_NAME} PROPERTIES
COMPILE_DEFINITIONS OST_MODULE_${_UPPER_LIB_NAME})
set_target_properties(${_LIB_NAME} PROPERTIES
VERSION ${OST_VERSION_STRING}
SOVERSION ${OST_VERSION_MAJOR})
set_target_properties(${_LIB_NAME} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${LIB_STAGE_PATH}
ARCHIVE_OUTPUT_DIRECTORY ${LIB_STAGE_PATH}
......
set(SUBST_DICT OST_VERSION_MAJOR=${OST_VERSION_MAJOR} OST_VERSION_MINOR=${OST_VERSION_MINOR}
OST_VERSION_PATCH=${OST_VERSION_PATCH})
set(OST_CONFIG_HEADERS
base.hh
config.hh
......@@ -57,7 +60,9 @@ endif()
set(config_hh_generator "CMake")
set(CONFIG_HH_FILE "${CMAKE_CURRENT_SOURCE_DIR}/config.hh")
set(VERSION_HH_FILE "${CMAKE_CURRENT_SOURCE_DIR}/version.hh")
configure_file(config.hh.in ${CONFIG_HH_FILE})
configure_file(version.hh.in ${VERSION_HH_FILE})
add_custom_target(ost_config)
stage_headers("${OST_CONFIG_HEADERS}" "ost"
"ost_config" "" "ost")
......
......@@ -19,9 +19,9 @@
#ifndef OST_VERSION_HH_
#define OST_VERSION_HH_
#define OST_VERSION_MAJOR 1
#define OST_VERSION_MINOR 2
#define OST_VERSION_PATCH 0
#define OST_VERSION_STRING "1.2.0"
#define OST_VERSION_MAJOR @OST_VERSION_MAJOR@
#define OST_VERSION_MINOR @OST_VERSION_MINOR@
#define OST_VERSION_PATCH @OST_VERSION_PATCH@
#define OST_VERSION_STRING "@OST_VERSION_STRING@"
#endif /* OST_VERSION_HH_ */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment