]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Also handle subminor version number 398/head
authorMatthias Maier <tamiko@kyomu.43-1.org>
Fri, 2 Jan 2015 11:43:21 +0000 (12:43 +0100)
committerMatthias Maier <tamiko@kyomu.43-1.org>
Sat, 3 Jan 2015 08:28:46 +0000 (09:28 +0100)
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
cmake/config/Make.global_options.in
cmake/setup_deal_ii.cmake
doc/news/changes.h
doc/users/cmakelists.html
include/deal.II/base/config.h.in

index 220252a7fd174e20f7e7869c61afe9bd385e0048..81744120dd161970e4a00a29189660d5423e953a 100644 (file)
@@ -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@")
index 6c6052bbae65f0bb52ff3d7c6f81a408f7ba8821..d1b98ce3328c4a7796520f69234ec73859676a74 100644 (file)
@@ -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
 
index d073cd2125e588502bb8d71783e6c88e8f7712cc..641d02128481b762a99874a1cc7c87c0dfd7e5ee 100644 (file)
@@ -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:
 
 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 <http://www.dealii.org/>"
   )
-
 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})
 
 
 ########################################################################
index a7f2cf58d7c46b67cf841c1b087da285c9b23e7c..88d59451c1896baae6b990b46282946da7a21f75 100644 (file)
@@ -65,6 +65,12 @@ inconvenience this causes.
 <h3>Specific improvements</h3>
 
 <ol>
+  <li> Fixed: CMake now also handles and exports the subminor version
+  number correctly ("pre" and "rc?" are replaced by "0").
+  <br>
+  (Matthias Maier, 2015/01/02)
+  </li>
+
   <li> Fixed: VectorTools::interpolate_to_different_mesh() was accidentally
   only instantiated for dealii::Vector arguments, rather than all vector
   classes. This is now fixed.
index a0bfb3f17b81de89abad34d5591424a3a6d9b1d0..04a9d651817186dc9c6ae8b72c913069056b28bc 100644 (file)
@@ -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,
index 9a6028e65fd36a11c6d2a3697d6093b2145c671a..520d0c0f4bc0a6c28386f1ed9cf6bb24a6ad8db4 100644 (file)
@@ -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 + \

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.