From: Matthias Maier Date: Fri, 2 Jan 2015 11:43:21 +0000 (+0100) Subject: CMake: Also handle subminor version number X-Git-Tag: v8.2.1~1^2~4 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=96b8c20d8588e1659628841e95cc7d243ccfc1d3;p=dealii.git CMake: Also handle subminor version number CMake now correctly queries the DEAL_II_PACKAGE_VERSION string for a subminor version replacing "pre" and "rc?" by "0". The subminor version number is also exported in the project configuration and the config.h header file. Conflicts: doc/news/changes.h --- diff --git a/cmake/config/Config.cmake.in b/cmake/config/Config.cmake.in index 220252a7fd..81744120dd 100644 --- a/cmake/config/Config.cmake.in +++ b/cmake/config/Config.cmake.in @@ -1,6 +1,6 @@ ## --------------------------------------------------------------------- ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2012 - 2015 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -32,6 +32,7 @@ SET(DEAL_II_PACKAGE_DESCRIPTION "@DEAL_II_PACKAGE_DESCRIPTION@") SET(DEAL_II_VERSION_MAJOR "@DEAL_II_VERSION_MAJOR@") SET(DEAL_II_VERSION_MINOR "@DEAL_II_VERSION_MINOR@") +SET(DEAL_II_VERSION_SUBMINOR "@DEAL_II_VERSION_SUBMINOR@") SET(DEAL_II_VERSION "@DEAL_II_VERSION@") SET(DEAL_II_PROJECT_CONFIG_NAME "@DEAL_II_PROJECT_CONFIG_NAME@") diff --git a/cmake/config/Make.global_options.in b/cmake/config/Make.global_options.in index 6c6052bbae..d1b98ce332 100644 --- a/cmake/config/Make.global_options.in +++ b/cmake/config/Make.global_options.in @@ -1,6 +1,6 @@ ## --------------------------------------------------------------------- ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2012 - 2015 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -46,6 +46,7 @@ enable-parser = @MAKEFILE_enableparser@ DEAL_II_VERSION = @DEAL_II_PACKAGE_VERSION@ DEAL_II_MAJOR = @DEAL_II_VERSION_MAJOR@ DEAL_II_MINOR = @DEAL_II_VERSION_MINOR@ +DEAL_II_SUBMINOR = @DEAL_II_VERSION_SUBMINOR@ PERL = perl diff --git a/cmake/setup_deal_ii.cmake b/cmake/setup_deal_ii.cmake index d073cd2125..641d021284 100644 --- a/cmake/setup_deal_ii.cmake +++ b/cmake/setup_deal_ii.cmake @@ -1,6 +1,6 @@ ## --------------------------------------------------------------------- ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2012 - 2015 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -32,6 +32,7 @@ # DEAL_II_PACKAGE_DESCRIPTION *) # DEAL_II_VERSION_MAJOR # DEAL_II_VERSION_MINOR +# DEAL_II_VERSION_SUBMINOR # DEAL_II_VERSION # # Information about paths, install locations and names: @@ -65,24 +66,40 @@ SET_IF_EMPTY(DEAL_II_PACKAGE_NAME "deal.II") -FILE(STRINGS "${CMAKE_SOURCE_DIR}/VERSION" _version LIMIT_COUNT 1) -SET_IF_EMPTY(DEAL_II_PACKAGE_VERSION "${_version}") - SET_IF_EMPTY(DEAL_II_PACKAGE_VENDOR "The deal.II Authors " ) - SET_IF_EMPTY(DEAL_II_PACKAGE_DESCRIPTION "Library for solving partial differential equations with the finite element method" ) -STRING(REGEX REPLACE - "^([0-9]+)\\..*" "\\1" DEAL_II_VERSION_MAJOR "${DEAL_II_PACKAGE_VERSION}" +FILE(STRINGS "${CMAKE_SOURCE_DIR}/VERSION" _version LIMIT_COUNT 1) +SET_IF_EMPTY(DEAL_II_PACKAGE_VERSION "${_version}") + +# +# We expect a version number of the form "X.Y.Z", where X and Y are always +# numbers and Z is either a third number (for a release version) or a short +# string. +# +STRING(REGEX REPLACE "^([0-9]+)\\..*" "\\1" + DEAL_II_VERSION_MAJOR "${DEAL_II_PACKAGE_VERSION}" ) -STRING(REGEX REPLACE - "^[0-9]+\\.([0-9]+).*" "\\1" DEAL_II_VERSION_MINOR "${DEAL_II_PACKAGE_VERSION}" +STRING(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" + DEAL_II_VERSION_MINOR "${DEAL_II_PACKAGE_VERSION}" ) -SET(DEAL_II_VERSION ${DEAL_II_VERSION_MAJOR}.${DEAL_II_VERSION_MINOR}) + +# +# If Z is not a number, replace it with "0", otherwise extract version +# number: +# +IF(DEAL_II_PACKAGE_VERSION MATCHES "^[0-9]+\\.[0-9]+.*\\.[0-9]+.*") + STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+.*\\.([0-9]+).*" "\\1" + DEAL_II_VERSION_SUBMINOR "${DEAL_II_PACKAGE_VERSION}" + ) +ELSE() + SET(DEAL_II_VERSION_SUBMINOR "0") +ENDIF() +SET(DEAL_II_VERSION ${DEAL_II_VERSION_MAJOR}.${DEAL_II_VERSION_MINOR}.${DEAL_II_VERSION_SUBMINOR}) ######################################################################## diff --git a/doc/users/cmakelists.html b/doc/users/cmakelists.html index a0bfb3f17b..04a9d65181 100644 --- a/doc/users/cmakelists.html +++ b/doc/users/cmakelists.html @@ -713,9 +713,11 @@ DEAL_II_PACKAGE_VERSION - the full package version string, e.g. "8.1.pre" DEAL_II_PACKAGE_VENDOR DEAL_II_PACKAGE_DESCRIPTION -DEAL_II_VERSION - version string without suffix, e.g. "8.1" +DEAL_II_VERSION - numerical version number (with "pre" and "rc?" + replaced by "0"), e.g. "8.2.0" DEAL_II_VERSION_MAJOR - the major number, e.g. "8" -DEAL_II_VERSION_MINOR - the minor version number, e.g. "1" +DEAL_II_VERSION_MINOR - the minor version number, e.g. "2" +DEAL_II_VERSION_SUBMINOR - the minor version number, e.g. "0" DEAL_II_BUILD_TYPE - the configured build type, e.g. "DebugRelease" DEAL_II_BUILD_TYPES - an all caps list of available configurations, diff --git a/include/deal.II/base/config.h.in b/include/deal.II/base/config.h.in index 8fa54ae9a5..1f11682086 100644 --- a/include/deal.II/base/config.h.in +++ b/include/deal.II/base/config.h.in @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 2012 - 2014 by the deal.II authors +// Copyright (C) 2012 - 2015 by the deal.II authors // // This file is part of the deal.II library. // @@ -50,6 +50,9 @@ #define DEAL_II_VERSION_MINOR @DEAL_II_VERSION_MINOR@ #define DEAL_II_MINOR @DEAL_II_VERSION_MINOR@ +/** Subminor version number of deal.II */ +#define DEAL_II_VERSION_SUBMINOR @DEAL_II_VERSION_SUBMINOR@ + #define DEAL_II_VERSION_GTE(major,minor,subminor) \ ((DEAL_II_VERSION_MAJOR * 10000 + \ DEAL_II_VERSION_MINOR * 100 + \