1 # Umfpack lib usually requires linking to a blas library.
2 # It is up to the user of this module to find a BLAS and link to it.
4 if (UMFPACK_INCLUDES AND UMFPACK_LIBRARIES)
5 set(UMFPACK_FIND_QUIETLY TRUE)
6 endif (UMFPACK_INCLUDES AND UMFPACK_LIBRARIES)
8 find_path(UMFPACK_INCLUDES
13 ${INCLUDE_INSTALL_DIR}
19 find_library(UMFPACK_LIBRARIES umfpack PATHS $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
23 if(NOT UMFPACK_LIBDIR)
24 get_filename_component(UMFPACK_LIBDIR ${UMFPACK_LIBRARIES} PATH)
25 endif(NOT UMFPACK_LIBDIR)
27 find_library(COLAMD_LIBRARY colamd PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
29 set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${COLAMD_LIBRARY})
32 find_library(AMD_LIBRARY amd PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
34 set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${AMD_LIBRARY})
37 find_library(SUITESPARSE_LIBRARY SuiteSparse PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
38 if(SUITESPARSE_LIBRARY)
39 set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${SUITESPARSE_LIBRARY})
42 find_library(CHOLMOD_LIBRARY cholmod PATHS $ENV{UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
44 set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${CHOLMOD_LIBRARY})
47 endif(UMFPACK_LIBRARIES)
49 include(FindPackageHandleStandardArgs)
50 find_package_handle_standard_args(UMFPACK DEFAULT_MSG
51 UMFPACK_INCLUDES UMFPACK_LIBRARIES)
53 mark_as_advanced(UMFPACK_INCLUDES UMFPACK_LIBRARIES AMD_LIBRARY COLAMD_LIBRARY CHOLMOD_LIBRARY SUITESPARSE_LIBRARY)