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.

40 lines
1.2 KiB

  1. # SPQR lib usually requires linking to a blas and lapack library.
  2. # It is up to the user of this module to find a BLAS and link to it.
  3. # SPQR lib requires Cholmod, colamd and amd as well.
  4. # FindCholmod.cmake can be used to find those packages before finding spqr
  5. if (SPQR_INCLUDES AND SPQR_LIBRARIES)
  6. set(SPQR_FIND_QUIETLY TRUE)
  7. endif (SPQR_INCLUDES AND SPQR_LIBRARIES)
  8. find_path(SPQR_INCLUDES
  9. NAMES
  10. SuiteSparseQR.hpp
  11. PATHS
  12. $ENV{SPQRDIR}
  13. ${INCLUDE_INSTALL_DIR}
  14. PATH_SUFFIXES
  15. suitesparse
  16. ufsparse
  17. )
  18. find_library(SPQR_LIBRARIES spqr $ENV{SPQRDIR} ${LIB_INSTALL_DIR})
  19. if(SPQR_LIBRARIES)
  20. find_library(SUITESPARSE_LIBRARY SuiteSparse PATHS $ENV{SPQRDIR} ${LIB_INSTALL_DIR})
  21. if (SUITESPARSE_LIBRARY)
  22. set(SPQR_LIBRARIES ${SPQR_LIBRARIES} ${SUITESPARSE_LIBRARY})
  23. endif()
  24. find_library(CHOLMOD_LIBRARY cholmod PATHS $ENV{UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
  25. if(CHOLMOD_LIBRARY)
  26. set(SPQR_LIBRARIES ${SPQR_LIBRARIES} ${CHOLMOD_LIBRARY})
  27. endif()
  28. endif(SPQR_LIBRARIES)
  29. include(FindPackageHandleStandardArgs)
  30. find_package_handle_standard_args(SPQR DEFAULT_MSG SPQR_INCLUDES SPQR_LIBRARIES)
  31. mark_as_advanced(SPQR_INCLUDES SPQR_LIBRARIES)