]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Improve readability of version detection for p4est and Trilinos
authordaniel.arndt <daniel.arndt@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 25 Jun 2014 11:47:16 +0000 (11:47 +0000)
committerdaniel.arndt <daniel.arndt@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 25 Jun 2014 11:47:16 +0000 (11:47 +0000)
git-svn-id: https://svn.dealii.org/trunk@33083 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/modules/FindP4EST.cmake
deal.II/cmake/modules/FindTRILINOS.cmake

index 640fb91c04183c8710f2a57dc13c611b4af4c844..f2bf417e1635e3e2d4946fe46d0dbd0ef2a04eab 100644 (file)
@@ -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()
index 51b627064ebbd37d911b8403263a5b4cf4b135c9..165715c2f50cfdff7c585691687c7cf457b6e051 100644 (file)
@@ -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()
 
 #

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.