2016-02-22 17:44:29 +00: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.
|
|
|
|
|
|
|
|
if (UMFPACK_INCLUDES AND UMFPACK_LIBRARIES)
|
|
|
|
set(UMFPACK_FIND_QUIETLY TRUE)
|
|
|
|
endif (UMFPACK_INCLUDES AND UMFPACK_LIBRARIES)
|
|
|
|
|
|
|
|
find_path(UMFPACK_INCLUDES
|
|
|
|
NAMES
|
|
|
|
umfpack.h
|
|
|
|
PATHS
|
|
|
|
$ENV{UMFPACKDIR}
|
|
|
|
${INCLUDE_INSTALL_DIR}
|
|
|
|
PATH_SUFFIXES
|
|
|
|
suitesparse
|
|
|
|
ufsparse
|
|
|
|
)
|
|
|
|
|
|
|
|
find_library(UMFPACK_LIBRARIES umfpack PATHS $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
|
|
|
|
|
|
|
|
if(UMFPACK_LIBRARIES)
|
|
|
|
|
2018-04-04 05:14:58 +00:00
|
|
|
if(NOT UMFPACK_LIBDIR)
|
2016-02-22 17:44:29 +00:00
|
|
|
get_filename_component(UMFPACK_LIBDIR ${UMFPACK_LIBRARIES} PATH)
|
|
|
|
endif(NOT UMFPACK_LIBDIR)
|
|
|
|
|
|
|
|
find_library(COLAMD_LIBRARY colamd PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
|
2018-04-04 05:14:58 +00:00
|
|
|
if(COLAMD_LIBRARY)
|
2016-02-22 17:44:29 +00:00
|
|
|
set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${COLAMD_LIBRARY})
|
2018-04-04 05:14:58 +00:00
|
|
|
endif ()
|
2016-02-22 17:44:29 +00:00
|
|
|
|
|
|
|
find_library(AMD_LIBRARY amd PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
|
2018-04-04 05:14:58 +00:00
|
|
|
if(AMD_LIBRARY)
|
2016-02-22 17:44:29 +00:00
|
|
|
set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${AMD_LIBRARY})
|
2018-04-04 05:14:58 +00:00
|
|
|
endif ()
|
2016-02-22 17:44:29 +00:00
|
|
|
|
|
|
|
find_library(SUITESPARSE_LIBRARY SuiteSparse PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
|
2018-04-04 05:14:58 +00:00
|
|
|
if(SUITESPARSE_LIBRARY)
|
2016-02-22 17:44:29 +00:00
|
|
|
set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${SUITESPARSE_LIBRARY})
|
2018-04-04 05:14:58 +00: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()
|
2016-02-22 17:44:29 +00:00
|
|
|
|
|
|
|
endif(UMFPACK_LIBRARIES)
|
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(UMFPACK DEFAULT_MSG
|
|
|
|
UMFPACK_INCLUDES UMFPACK_LIBRARIES)
|
|
|
|
|
2018-04-04 05:14:58 +00:00
|
|
|
mark_as_advanced(UMFPACK_INCLUDES UMFPACK_LIBRARIES AMD_LIBRARY COLAMD_LIBRARY CHOLMOD_LIBRARY SUITESPARSE_LIBRARY)
|