mirror of
https://github.com/pocoproject/poco.git
synced 2025-01-06 00:31:10 +01:00
cmake: read the version information from VERSION
The version inforamtion for CMake is extracted from the VERSION file not hardcoded in CMakeLists.txt Reviewed-by: Roger Meier <r.meier@siemens.com>
This commit is contained in:
parent
5d7d1d3c07
commit
74397ccbe3
@ -9,9 +9,13 @@ cmake_minimum_required(VERSION 2.8.0)
|
|||||||
|
|
||||||
set(SHARED_LIBRARY_VERSION "22")
|
set(SHARED_LIBRARY_VERSION "22")
|
||||||
|
|
||||||
set(CPACK_PACKAGE_VERSION_MAJOR "1")
|
# Read the version information from the VERSION file
|
||||||
set(CPACK_PACKAGE_VERSION_MINOR "5")
|
file (STRINGS "${CMAKE_SOURCE_DIR}/VERSION" PACKAGE_VERSION )
|
||||||
set(CPACK_PACKAGE_VERSION_PATCH "2")
|
message(STATUS "Poco package version: ${PACKAGE_VERSION}")
|
||||||
|
string(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" CPACK_PACKAGE_VERSION_MAJOR ${PACKAGE_VERSION})
|
||||||
|
string(REGEX REPLACE "[0-9]+\\.([0-9])+\\.[0-9]+" "\\1" CPACK_PACKAGE_VERSION_MINOR ${PACKAGE_VERSION})
|
||||||
|
string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" CPACK_PACKAGE_VERSION_PATCH ${PACKAGE_VERSION})
|
||||||
|
|
||||||
SET(COMPLETE_VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
|
SET(COMPLETE_VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
|
||||||
SET(RELEASE_NAME "Unstable-trunk")
|
SET(RELEASE_NAME "Unstable-trunk")
|
||||||
SET(PROJECT_VERSION ${COMPLETE_VERSION})
|
SET(PROJECT_VERSION ${COMPLETE_VERSION})
|
||||||
|
Loading…
Reference in New Issue
Block a user