From: Wolfgang Bangerth Date: Mon, 2 Sep 2013 03:21:11 +0000 (+0000) Subject: Parse p4est versions like 0.3.4 and get patch numbers correct. X-Git-Tag: v8.1.0~915 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8163c71e5655f77000d7258ae3a70c1e5a3eb8be;p=dealii.git Parse p4est versions like 0.3.4 and get patch numbers correct. git-svn-id: https://svn.dealii.org/trunk@30545 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/cmake/modules/FindP4EST.cmake b/deal.II/cmake/modules/FindP4EST.cmake index 32a6f08497..c7cab6ed1f 100644 --- a/deal.II/cmake/modules/FindP4EST.cmake +++ b/deal.II/cmake/modules/FindP4EST.cmake @@ -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()