From 70b1eed6b951df99dfa39d8bd2f05fc8e13e50bd Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Wed, 25 Jun 2014 11:47:16 +0000 Subject: [PATCH] Improve readability of version detection for p4est and Trilinos git-svn-id: https://svn.dealii.org/trunk@33083 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/cmake/modules/FindP4EST.cmake | 8 ++++---- deal.II/cmake/modules/FindTRILINOS.cmake | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/deal.II/cmake/modules/FindP4EST.cmake b/deal.II/cmake/modules/FindP4EST.cmake index 640fb91c04..f2bf417e16 100644 --- a/deal.II/cmake/modules/FindP4EST.cmake +++ b/deal.II/cmake/modules/FindP4EST.cmake @@ -136,13 +136,13 @@ IF(EXISTS ${P4EST_INCLUDE_DIR}/p4est_config.h) 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 no patch number, then REGEX REPLACE will set + # P4EST_VERSION_PATCH to an empty string. 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}") + IF("${P4EST_VERSION_PATCH}" STREQUAL "") SET(P4EST_VERSION_PATCH "0") ENDIF() ENDIF() diff --git a/deal.II/cmake/modules/FindTRILINOS.cmake b/deal.II/cmake/modules/FindTRILINOS.cmake index 51b627064e..165715c2f5 100644 --- a/deal.II/cmake/modules/FindTRILINOS.cmake +++ b/deal.II/cmake/modules/FindTRILINOS.cmake @@ -65,15 +65,15 @@ IF(DEFINED Trilinos_VERSION) "^[0-9]+\\.([0-9]+).*$" "\\1" TRILINOS_VERSION_MINOR "${Trilinos_VERSION}") - # If there is no subminor number, then the REGEX REPLACE will fail, - # setting TRILINOS_VERSION_PATCH to TRILINOS_VERSION. If that - # is the case, then set the subminor number to zero + # If there is no subminor number, + # TRILINOS_VERSION_SUBMINOR is set to an empty string. + # If that is the case, set the subminor number to zero STRING(REGEX REPLACE - "^[0-9]+\\.[0-9]+\\.([0-9]+)?.*$" "\\1" + "^[0-9]+\\.[0-9]+\\.?(([0-9]+)?).*$" "\\1" TRILINOS_VERSION_SUBMINOR "${Trilinos_VERSION}") - IF(${TRILINOS_VERSION_SUBMINOR} STREQUAL "${Trilinos_VERSION}") + IF("${TRILINOS_VERSION_SUBMINOR}" STREQUAL "") SET(TRILINOS_VERSION_SUBMINOR "0") - ENDIF() + ENDIF() ENDIF() # -- 2.39.5