From 7b00c926076138282244e45d85e473b27bc27fc3 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Fri, 2 Jan 2015 12:43:21 +0100 Subject: [PATCH] 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. --- cmake/config/Config.cmake.in | 3 ++- cmake/config/Make.global_options.in | 3 ++- cmake/setup_deal_ii.cmake | 37 +++++++++++++++++++++-------- doc/news/changes.h | 6 +++++ doc/users/cmakelists.html | 6 +++-- include/deal.II/base/config.h.in | 5 +++- 6 files changed, 45 insertions(+), 15 deletions(-) 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/news/changes.h b/doc/news/changes.h index a7f2cf58d7..88d59451c1 100644 --- a/doc/news/changes.h +++ b/doc/news/changes.h @@ -65,6 +65,12 @@ inconvenience this causes.

Specific improvements

    +
  1. Fixed: CMake now also handles and exports the subminor version + number correctly ("pre" and "rc?" are replaced by "0"). +
    + (Matthias Maier, 2015/01/02) +
  2. +
  3. Fixed: VectorTools::interpolate_to_different_mesh() was accidentally only instantiated for dealii::Vector arguments, rather than all vector classes. This is now fixed. 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 9a6028e65f..520d0c0f4b 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 + \ -- 2.39.5