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. 3 4 if (UMFPACK_INCLUDES AND UMFPACK_LIBRARIES) 5 set(UMFPACK_FIND_QUIETLY TRUE) 6 endif (UMFPACK_INCLUDES AND UMFPACK_LIBRARIES) 7 8 find_path(UMFPACK_INCLUDES 9 NAMES 10 umfpack.h 11 PATHS 12 $ENV{UMFPACKDIR} 13 ${INCLUDE_INSTALL_DIR} 14 PATH_SUFFIXES 15 suitesparse 16 ufsparse 17 ) 18 19 find_library(UMFPACK_LIBRARIES umfpack PATHS $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR}) 20 21 if(UMFPACK_LIBRARIES) 22 23 get_filename_component(UMFPACK_LIBDIR ${UMFPACK_LIBRARIES} PATH) 24 25 find_library(AMD_LIBRARY amd PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR}) 26 if (AMD_LIBRARY) 27 set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${AMD_LIBRARY}) 28 #else (AMD_LIBRARY) 29 # set(UMFPACK_LIBRARIES FALSE) 30 endif (AMD_LIBRARY) 31 32 endif(UMFPACK_LIBRARIES) 33 34 if(UMFPACK_LIBRARIES) 35 36 find_library(COLAMD_LIBRARY colamd PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR}) 37 if (COLAMD_LIBRARY) 38 set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${COLAMD_LIBRARY}) 39 #else (COLAMD_LIBRARY) 40 # set(UMFPACK_LIBRARIES FALSE) 41 endif (COLAMD_LIBRARY) 42 43 endif(UMFPACK_LIBRARIES) 44 45 46 include(FindPackageHandleStandardArgs) 47 find_package_handle_standard_args(UMFPACK DEFAULT_MSG 48 UMFPACK_INCLUDES UMFPACK_LIBRARIES) 49 50 mark_as_advanced(UMFPACK_INCLUDES UMFPACK_LIBRARIES AMD_LIBRARY COLAMD_LIBRARY) 51