]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Bugfix: Only try to extract the metis version number out of a file if it is
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 23 Sep 2012 16:27:03 +0000 (16:27 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 23 Sep 2012 16:27:03 +0000 (16:27 +0000)
actually found.

git-svn-id: https://svn.dealii.org/branches/branch_cmake@26644 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/modules/FindMETIS.cmake

index a1dc23ed5a3bdcd9b81f9671cd4b0973200a8ebe..ac25f0c713555e43fd9adbae556619bed843e0a2 100644 (file)
@@ -13,21 +13,20 @@ FIND_LIBRARY(METIS_LIBRARY
   PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
   )
 
-#
-# 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}")
-
-
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(METIS DEFAULT_MSG METIS_LIBRARY METIS_INCLUDE_DIR)
 
 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}")
+
   MARK_AS_ADVANCED(
     METIS_LIBRARY
     METIS_INCLUDE_DIR

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.