2011-02-18 18:23:27 +08:00
|
|
|
# Umfpack lib usually requires linking to a blas library.
|
|
|
|
# It is up to the user of this module to find a BLAS and link to it.
|
2008-10-20 18:43:11 +08:00
|
|
|
|
|
|
|
if (UMFPACK_INCLUDES AND UMFPACK_LIBRARIES)
|
|
|
|
set(UMFPACK_FIND_QUIETLY TRUE)
|
2019-11-01 00:36:27 +08:00
|
|
|
endif ()
|
2008-10-20 18:43:11 +08:00
|
|
|
|
2011-02-18 18:23:27 +08:00
|
|
|
find_path(UMFPACK_INCLUDES
|
|
|
|
NAMES
|
|
|
|
umfpack.h
|
|
|
|
PATHS
|
|
|
|
$ENV{UMFPACKDIR}
|
|
|
|
${INCLUDE_INSTALL_DIR}
|
|
|
|
PATH_SUFFIXES
|
|
|
|
suitesparse
|
2011-09-21 16:28:09 +08:00
|
|
|
ufsparse
|
2011-02-18 18:23:27 +08:00
|
|
|
)
|
2008-11-05 21:47:55 +08:00
|
|
|
|
2011-02-18 18:23:27 +08:00
|
|
|
find_library(UMFPACK_LIBRARIES umfpack PATHS $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
|
2008-10-20 18:43:11 +08:00
|
|
|
|
2011-02-18 18:23:27 +08:00
|
|
|
if(UMFPACK_LIBRARIES)
|
2013-06-12 16:12:05 +08:00
|
|
|
|
2015-11-05 19:05:02 +08:00
|
|
|
if(NOT UMFPACK_LIBDIR)
|
2012-08-02 16:00:23 +08:00
|
|
|
get_filename_component(UMFPACK_LIBDIR ${UMFPACK_LIBRARIES} PATH)
|
2019-11-01 00:36:27 +08:00
|
|
|
endif()
|
2008-10-20 18:43:11 +08:00
|
|
|
|
2011-02-18 18:23:27 +08:00
|
|
|
find_library(COLAMD_LIBRARY colamd PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
|
2015-11-05 19:05:02 +08:00
|
|
|
if(COLAMD_LIBRARY)
|
2011-02-18 18:23:27 +08:00
|
|
|
set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${COLAMD_LIBRARY})
|
2015-11-05 19:05:02 +08:00
|
|
|
endif ()
|
2013-01-23 05:53:28 +08:00
|
|
|
|
2013-06-12 16:12:05 +08:00
|
|
|
find_library(AMD_LIBRARY amd PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
|
2015-11-05 19:05:02 +08:00
|
|
|
if(AMD_LIBRARY)
|
2013-06-12 16:12:05 +08:00
|
|
|
set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${AMD_LIBRARY})
|
2015-11-05 19:05:02 +08:00
|
|
|
endif ()
|
2013-06-12 16:12:05 +08:00
|
|
|
|
2013-01-23 05:53:28 +08:00
|
|
|
find_library(SUITESPARSE_LIBRARY SuiteSparse PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
|
2015-11-05 19:05:02 +08:00
|
|
|
if(SUITESPARSE_LIBRARY)
|
2013-01-23 05:53:28 +08:00
|
|
|
set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${SUITESPARSE_LIBRARY})
|
2015-11-05 19:05:02 +08:00
|
|
|
endif ()
|
|
|
|
|
|
|
|
find_library(CHOLMOD_LIBRARY cholmod PATHS $ENV{UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
|
|
|
|
if(CHOLMOD_LIBRARY)
|
|
|
|
set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${CHOLMOD_LIBRARY})
|
|
|
|
endif()
|
2008-10-20 18:43:11 +08:00
|
|
|
|
2019-11-01 00:36:27 +08:00
|
|
|
endif()
|
2008-12-02 20:20:13 +08:00
|
|
|
|
2009-02-05 17:36:52 +08:00
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(UMFPACK DEFAULT_MSG
|
|
|
|
UMFPACK_INCLUDES UMFPACK_LIBRARIES)
|
2008-10-20 18:43:11 +08:00
|
|
|
|
2015-11-05 19:05:02 +08:00
|
|
|
mark_as_advanced(UMFPACK_INCLUDES UMFPACK_LIBRARIES AMD_LIBRARY COLAMD_LIBRARY CHOLMOD_LIBRARY SUITESPARSE_LIBRARY)
|