diff --git a/CMakeLists.txt b/CMakeLists.txt index eb2213c4e..2a26bafa5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,9 +9,13 @@ cmake_minimum_required(VERSION 2.8.0) set(SHARED_LIBRARY_VERSION "22") -set(CPACK_PACKAGE_VERSION_MAJOR "1") -set(CPACK_PACKAGE_VERSION_MINOR "5") -set(CPACK_PACKAGE_VERSION_PATCH "2") +# Read the version information from the VERSION file +file (STRINGS "${CMAKE_SOURCE_DIR}/VERSION" PACKAGE_VERSION ) +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(RELEASE_NAME "Unstable-trunk") SET(PROJECT_VERSION ${COMPLETE_VERSION})