From 8163c71e5655f77000d7258ae3a70c1e5a3eb8be Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 2 Sep 2013 03:21:11 +0000 Subject: [PATCH] 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 --- deal.II/cmake/modules/FindP4EST.cmake | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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() -- 2.39.5