Also search for libscotchmetisv5 and libscotchmetisv3.
authorMarkus Blatt <markus@dr-blatt.de>
Fri, 18 Mar 2022 21:03:05 +0000 (22:03 +0100)
committerDrew Parsons <dparsons@debian.org>
Sat, 19 Mar 2022 12:10:34 +0000 (12:10 +0000)
On Debian these might be present instead of libscotchmetis,

Gbp-Pq: Name findmetis_scotch7.patch

cmake/modules/FindMETIS.cmake

index 338b09e55000dfe5d0d99004113b899a1f16f483..068b12171de84b6587e78a8eafa9328fe95af522 100644 (file)
@@ -87,12 +87,19 @@ if(METIS_HEADER_FILE)
     set(IS_SCOTCH_METIS_HEADER FALSE)
   else()
     set(IS_SCOTCH_METIS_HEADER TRUE)
+    string(REGEX REPLACE ".*#define SCOTCH_METIS_VERSION[ ]+([0-9]+).*" "\\1"
+      SCOTCH_METIS_VERSION "${metisheader}")
   endif()
 endif()
 unset(METIS_HEADER_FILE CACHE)
 
 # search for the METIS library or for the scotch-metis wrapper library
 if(IS_SCOTCH_METIS_HEADER)
+  # Debian bookworm has no scotchmetis library only scotchmetisv3
+  # and scotchmetisv5.
+  if(SCOTCH_METIS_VERSION)
+    find_library(METIS_LIBRARY scotchmetisv${SCOTCH_METIS_VERSION})
+  endif()
   find_library(METIS_LIBRARY scotchmetis)
 else()
   find_library(METIS_LIBRARY metis)