[cmake] MUMPS ordering on debian : add scotch+ptscotch
@@ -32,18 +32,35 @@ ENDIF(MUMPS_LIBRARY_DIRECTORY)
# Try to be smart and detect whether the MUMPS lib file has a "_seq" suffix. If yes, we add it to all the other library
IF(IDONTWANTMPI AND MUMPS_LIBRARY MATCHES "dmumps_seq")
- SET(__SUFFIX "_seq")
+ SET(__MUMPS_COMMON_NAMES mumps_common_seq mumps_common)
ELSE()
- SET(__SUFFIX "")
+ SET(__MUMPS_COMMON_NAMES mumps_common_ptscotch mumps_common_scotch mumps_common)
ENDIF()
-
-
IF(MUMPS_LIBRARY_DIRECTORY AND NOT _MUMPS_DEFAULT_SEARCH_DIR)
- FIND_LIBRARY(MUMPS_COMMON_LIBRARY mumps_common${__SUFFIX} PATHS "${MUMPS_LIBRARY_DIRECTORY}" NO_DEFAULT_PATH)
+ FIND_LIBRARY(MUMPS_COMMON_LIBRARY ${__MUMPS_COMMON_NAMES} PATHS "${MUMPS_LIBRARY_DIRECTORY}" NO_DEFAULT_PATH)
ELSE()
- FIND_LIBRARY(MUMPS_COMMON_LIBRARY mumps_common${__SUFFIX})
+ FIND_LIBRARY(MUMPS_COMMON_LIBRARY ${__MUMPS_COMMON_NAMES})
+ENDIF()
+
+IF(MUMPS_LIBRARY_DIRECTORY)
+ FIND_LIBRARY(METIS_LIBRARY ptscotch PATHS "${MUMPS_LIBRARY_DIRECTORY}" NO_DEFAULT_PATH)
+ IF(NOT METIS_LIBRARY)
+ FIND_LIBRARY(METIS_LIBRARY ptscotch)
ENDIF()
+ELSE(MUMPS_LIBRARY_DIRECTORY)
+ FIND_LIBRARY(METIS_LIBRARY ptscotch)
+ENDIF(MUMPS_LIBRARY_DIRECTORY)
+
+IF(MUMPS_LIBRARY_DIRECTORY)
+ FIND_LIBRARY(METIS_LIBRARY scotch PATHS "${MUMPS_LIBRARY_DIRECTORY}" NO_DEFAULT_PATH)
+ IF(NOT METIS_LIBRARY)
+ FIND_LIBRARY(METIS_LIBRARY scotch)
+ ENDIF()
+ELSE(MUMPS_LIBRARY_DIRECTORY)
+ FIND_LIBRARY(METIS_LIBRARY scotch)
+ENDIF(MUMPS_LIBRARY_DIRECTORY)
+
IF(MUMPS_LIBRARY_DIRECTORY)
FIND_LIBRARY(METIS_LIBRARY metis PATHS "${MUMPS_LIBRARY_DIRECTORY}" NO_DEFAULT_PATH)
