[cmake] fix MUMPS detection on zesty
@@ -12,17 +12,22 @@ INCLUDE(FindPackageHandleStandardArgs)
IF(MUMPS_LIBRARY_DIRECTORY)
FIND_LIBRARY(MUMPS_LIBRARY dmumps PATHS "${MUMPS_LIBRARY_DIRECTORY}" NO_DEFAULT_PATH)
+ IF(NOT MUMPS_LIBRARY)
+ SET(_MUMPS_DEFAULT_SEARCH_DIR TRUE)
+ MESSAGE("Could not find MUMPS in directory ${MUMPS_LIBRARY_DIRECTORY}")
+ FIND_LIBRARY(MUMPS_LIBRARY dmumps)
+ ENDIF()
ELSE(MUMPS_LIBRARY_DIRECTORY)
FIND_LIBRARY(MUMPS_LIBRARY dmumps)
ENDIF(MUMPS_LIBRARY_DIRECTORY)
-IF(MUMPS_LIBRARY_DIRECTORY)
+IF(MUMPS_LIBRARY_DIRECTORY AND NOT _MUMPS_DEFAULT_SEARCH_DIR)
FIND_LIBRARY(MUMPS_COMMON_LIBRARY mumps_common PATHS "${MUMPS_LIBRARY_DIRECTORY}" NO_DEFAULT_PATH)
-ELSE(MUMPS_LIBRARY_DIRECTORY)
+ELSE()
FIND_LIBRARY(MUMPS_COMMON_LIBRARY mumps_common)
-ENDIF(MUMPS_LIBRARY_DIRECTORY)
+ENDIF()
IF(MUMPS_LIBRARY_DIRECTORY)
FIND_LIBRARY(METIS_LIBRARY metis PATHS "${MUMPS_LIBRARY_DIRECTORY}" NO_DEFAULT_PATH)
