]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Unify version variables
authorMatthias Maier <tamiko@kyomu.43-1.org>
Fri, 16 Aug 2013 21:32:45 +0000 (21:32 +0000)
committerMatthias Maier <tamiko@kyomu.43-1.org>
Fri, 16 Aug 2013 21:32:45 +0000 (21:32 +0000)
git-svn-id: https://svn.dealii.org/trunk@30319 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/configure/configure_2_metis.cmake
deal.II/cmake/modules/FindMETIS.cmake

index 92a1f10880435ab8969ad5efba384b1b0e8c237a..8d83b9661d61d70fa8d1a7df3d2060186f7f0b7f 100644 (file)
@@ -22,7 +22,7 @@ MACRO(FEATURE_METIS_FIND_EXTERNAL var)
   FIND_PACKAGE(METIS)
 
   IF(METIS_FOUND)
-    IF(METIS_MAJOR GREATER 4)
+    IF(METIS_VERSION_MAJOR GREATER 4)
       SET(${var} TRUE)
     ELSE()
       MESSAGE(STATUS "Insufficient metis installation found: "
index f0cfa9eba7c7271bbc5a774510af4b9729c51849..80cbd97d478f612d006d51dbc861ec738a21e5cb 100644 (file)
@@ -21,6 +21,9 @@
 #
 #   METIS_LIBRARIES
 #   METIS_INCLUDE_DIRS
+#   METIS_VERSION
+#   METIS_VERSION_MAJOR
+#   METIS_VERSION_MINOR
 #
 
 INCLUDE(FindPackageHandleStandardArgs)
@@ -87,13 +90,27 @@ IF(METIS_FOUND)
   #
   # Extract the version number out of metis.h
   #
-  FILE(STRINGS "${METIS_INCLUDE_DIR}/metis.h" METIS_MAJOR_STRING
-    REGEX "METIS_VER_MAJOR")
-  STRING(REGEX REPLACE "^.*METIS_VER_MAJOR.* ([0-9]+).*" "\\1" METIS_MAJOR "${METIS_MAJOR_STRING}")
-
-  FILE(STRINGS "${METIS_INCLUDE_DIR}/metis.h" METIS_MINOR_STRING
-    REGEX "METIS_VER_MINOR")
-  STRING(REGEX REPLACE "^.*METIS_VER_MINOR.* ([0-9]+).*" "\\1" METIS_MINOR "${METIS_MINOR_STRING}")
+  FILE(STRINGS "${METIS_INCLUDE_DIR}/metis.h" _metis_major_string
+    REGEX "METIS_VER_MAJOR"
+    )
+  STRING(REGEX REPLACE "^.*METIS_VER_MAJOR.* ([0-9]+).*" "\\1"
+    METIS_VERSION_MAJOR "${_metis_major_string}"
+    )
+  FILE(STRINGS "${METIS_INCLUDE_DIR}/metis.h" _metis_minor_string
+    REGEX "METIS_VER_MINOR"
+    )
+  STRING(REGEX REPLACE "^.*METIS_VER_MINOR.* ([0-9]+).*" "\\1"
+    METIS_VERSION_MINOR "${_metis_minor_string}"
+    )
+  FILE(STRINGS "${METIS_INCLUDE_DIR}/metis.h" _metis_subminor_string
+    REGEX "METIS_VER_SUBMINOR"
+    )
+  STRING(REGEX REPLACE "^.*METIS_VER_SUBMINOR.* ([0-9]+).*" "\\1"
+    METIS_VERSION_SUBMINOR "${_metis_subminor_string}"
+    )
+  SET(METIS_VERSION
+    "${METIS_VERSION_MAJOR}.${METIS_VERSION_MINOR}.${METIS_VERSION_SUBMINOR}"
+    )
 
   MARK_AS_ADVANCED(METIS_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.