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.

48 lines
1.5 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(COLAMD_LIBRARY colamd PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
  22. if (COLAMD_LIBRARY)
  23. set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${COLAMD_LIBRARY})
  24. endif (COLAMD_LIBRARY)
  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. endif (AMD_LIBRARY)
  29. find_library(SUITESPARSE_LIBRARY SuiteSparse PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
  30. if (SUITESPARSE_LIBRARY)
  31. set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${SUITESPARSE_LIBRARY})
  32. endif (SUITESPARSE_LIBRARY)
  33. endif(UMFPACK_LIBRARIES)
  34. include(FindPackageHandleStandardArgs)
  35. find_package_handle_standard_args(UMFPACK DEFAULT_MSG
  36. UMFPACK_INCLUDES UMFPACK_LIBRARIES)
  37. mark_as_advanced(UMFPACK_INCLUDES UMFPACK_LIBRARIES AMD_LIBRARY COLAMD_LIBRARY SUITESPARSE_LIBRARY)