]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Parse p4est versions like 0.3.4 and get patch numbers correct.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 2 Sep 2013 03:21:11 +0000 (03:21 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 2 Sep 2013 03:21:11 +0000 (03:21 +0000)
git-svn-id: https://svn.dealii.org/trunk@30545 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/modules/FindP4EST.cmake

index 32a6f08497e86f978e5a9093301da39e038d2eed..c7cab6ed1fc61f9670aa456d515bf4d4578ee7ea 100644 (file)
@@ -179,9 +179,18 @@ IF(P4EST_FOUND)
   STRING(REGEX REPLACE
     "^[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1"
     P4EST_VERSION_SUBMINOR "${P4EST_VERSION}")
+
+  # Now for the patch number such as in 0.3.4.1. If there
+  # is no patch number, then the REGEX REPLACE will fail,
+  # setting P4EST_VERSION_PATCH to P4EST_VERSION. If that
+  # is the case, then set the patch number to zero
   STRING(REGEX REPLACE
-    "^[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1"
+    "^[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+)?.*$" "\\1"
     P4EST_VERSION_PATCH "${P4EST_VERSION}")
+  IF(${P4EST_VERSION_PATCH} STREQUAL "${P4EST_VERSION}")
+    SET(P4EST_VERSION_PATCH "0")
+  ENDIF()
+
 
   MARK_AS_ADVANCED(P4EST_DIR)
 ELSE()

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.