You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.4 KiB

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