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.

50 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. get_filename_component(UMFPACK_LIBDIR ${UMFPACK_LIBRARIES} PATH)
  19. find_library(AMD_LIBRARY amd PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
  20. if (AMD_LIBRARY)
  21. set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${AMD_LIBRARY})
  22. #else (AMD_LIBRARY)
  23. # set(UMFPACK_LIBRARIES FALSE)
  24. endif (AMD_LIBRARY)
  25. endif(UMFPACK_LIBRARIES)
  26. if(UMFPACK_LIBRARIES)
  27. find_library(COLAMD_LIBRARY colamd PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
  28. if (COLAMD_LIBRARY)
  29. set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${COLAMD_LIBRARY})
  30. #else (COLAMD_LIBRARY)
  31. # set(UMFPACK_LIBRARIES FALSE)
  32. endif (COLAMD_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)