[cmake] FindMUMPS: add missing steps for scotch and ptscotch linking
@@ -54,22 +54,26 @@ IF(NOT MUMPS_COMMON_LIBRARY)
FIND_LIBRARY(MUMPS_COMMON_LIBRARY NAMES ${__MUMPS_COMMON_NAMES})
ENDIF()
+IF(MUMPS_COMMON_LIBRARY)
+ MESSAGE(STATUS "Found ${MUMPS_COMMON_LIBRARY}")
+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)
+ FIND_LIBRARY(PTSCOTCH_LIBRARY ptscotch PATHS "${MUMPS_LIBRARY_DIRECTORY}" NO_DEFAULT_PATH)
+ IF(NOT PTSCOTCH_LIBRARY)
+ FIND_LIBRARY(PTSCOTCH_LIBRARY ptscotch)
ENDIF()
ELSE(MUMPS_LIBRARY_DIRECTORY)
- FIND_LIBRARY(METIS_LIBRARY ptscotch)
+ FIND_LIBRARY(PTSCOTCH_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)
+ FIND_LIBRARY(SCOTCH_LIBRARY scotch PATHS "${MUMPS_LIBRARY_DIRECTORY}" NO_DEFAULT_PATH)
+ IF(NOT SCOTCH_LIBRARY)
+ FIND_LIBRARY(SCOTCH_LIBRARY scotch)
ENDIF()
ELSE(MUMPS_LIBRARY_DIRECTORY)
- FIND_LIBRARY(METIS_LIBRARY scotch)
+ FIND_LIBRARY(SCOTCH_LIBRARY scotch)
ENDIF(MUMPS_LIBRARY_DIRECTORY)
@@ -113,6 +117,14 @@ IF(MUMPS_LIBRARY)
GET_FILENAME_COMPONENT(MUMPS_LIBRARY_DIRS ${MUMPS_LIBRARY} PATH)
SET(MUMPS_LIBRARIES ${MUMPS_LIBRARY} ${MUMPS_COMMON_LIBRARY})
+ IF(PTSCOTCH_LIBRARY)
+ SET(MUMPS_LIBRARIES ${MUMPS_LIBRARIES} ${PTSCOTCH_LIBRARY})
+ ENDIF(PTSCOTCH_LIBRARY)
+
+ IF(SCOTCH_LIBRARY)
+ SET(MUMPS_LIBRARIES ${MUMPS_LIBRARIES} ${SCOTCH_LIBRARY})
+ ENDIF(SCOTCH_LIBRARY)
+
IF(METIS_LIBRARY)
SET(MUMPS_LIBRARIES ${MUMPS_LIBRARIES} ${METIS_LIBRARY})
ENDIF(METIS_LIBRARY)
