Lemma is an Electromagnetics API
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.

FindUmfpack.cmake 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 ()
  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 ()
  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 ()
  33. find_library(CHOLMOD_LIBRARY cholmod PATHS $ENV{UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
  34. if(CHOLMOD_LIBRARY)
  35. set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${CHOLMOD_LIBRARY})
  36. endif()
  37. endif(UMFPACK_LIBRARIES)
  38. include(FindPackageHandleStandardArgs)
  39. find_package_handle_standard_args(UMFPACK DEFAULT_MSG
  40. UMFPACK_INCLUDES UMFPACK_LIBRARIES)
  41. mark_as_advanced(UMFPACK_INCLUDES UMFPACK_LIBRARIES AMD_LIBRARY COLAMD_LIBRARY CHOLMOD_LIBRARY SUITESPARSE_LIBRARY)