2021-02-24 12:16:52 +08:00
|
|
|
# CHOLMOD lib usually requires linking to a blas and lapack library.
|
2011-02-18 18:23:27 +08:00
|
|
|
# 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 (CHOLMOD_INCLUDES AND CHOLMOD_LIBRARIES)
|
|
|
|
set(CHOLMOD_FIND_QUIETLY TRUE)
|
2019-11-01 00:36:27 +08:00
|
|
|
endif ()
|
2008-10-20 18:43:11 +08:00
|
|
|
|
|
|
|
find_path(CHOLMOD_INCLUDES
|
|
|
|
NAMES
|
|
|
|
cholmod.h
|
|
|
|
PATHS
|
|
|
|
$ENV{CHOLMODDIR}
|
|
|
|
${INCLUDE_INSTALL_DIR}
|
|
|
|
PATH_SUFFIXES
|
|
|
|
suitesparse
|
2011-09-21 16:28:09 +08:00
|
|
|
ufsparse
|
2008-10-20 18:43:11 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
find_library(CHOLMOD_LIBRARIES cholmod PATHS $ENV{CHOLMODDIR} ${LIB_INSTALL_DIR})
|
|
|
|
|
|
|
|
if(CHOLMOD_LIBRARIES)
|
|
|
|
|
|
|
|
get_filename_component(CHOLMOD_LIBDIR ${CHOLMOD_LIBRARIES} PATH)
|
|
|
|
|
|
|
|
find_library(AMD_LIBRARY amd PATHS ${CHOLMOD_LIBDIR} $ENV{CHOLMODDIR} ${LIB_INSTALL_DIR})
|
|
|
|
if (AMD_LIBRARY)
|
|
|
|
set(CHOLMOD_LIBRARIES ${CHOLMOD_LIBRARIES} ${AMD_LIBRARY})
|
2010-10-06 23:38:02 +08:00
|
|
|
else ()
|
2008-10-21 04:58:43 +08:00
|
|
|
set(CHOLMOD_LIBRARIES FALSE)
|
2010-10-06 23:38:02 +08:00
|
|
|
endif ()
|
2008-10-21 04:58:43 +08:00
|
|
|
|
2019-11-01 00:36:27 +08:00
|
|
|
endif()
|
2008-10-20 18:43:11 +08:00
|
|
|
|
|
|
|
if(CHOLMOD_LIBRARIES)
|
|
|
|
|
|
|
|
find_library(COLAMD_LIBRARY colamd PATHS ${CHOLMOD_LIBDIR} $ENV{CHOLMODDIR} ${LIB_INSTALL_DIR})
|
|
|
|
if (COLAMD_LIBRARY)
|
|
|
|
set(CHOLMOD_LIBRARIES ${CHOLMOD_LIBRARIES} ${COLAMD_LIBRARY})
|
2010-10-06 23:38:02 +08:00
|
|
|
else ()
|
2008-10-21 04:58:43 +08:00
|
|
|
set(CHOLMOD_LIBRARIES FALSE)
|
2010-10-06 23:38:02 +08:00
|
|
|
endif ()
|
2008-10-20 18:43:11 +08:00
|
|
|
|
2019-11-01 00:36:27 +08:00
|
|
|
endif()
|
2008-10-20 18:43:11 +08:00
|
|
|
|
|
|
|
if(CHOLMOD_LIBRARIES)
|
2008-10-21 04:58:43 +08:00
|
|
|
|
2008-10-20 18:43:11 +08:00
|
|
|
find_library(CAMD_LIBRARY camd PATHS ${CHOLMOD_LIBDIR} $ENV{CHOLMODDIR} ${LIB_INSTALL_DIR})
|
|
|
|
if (CAMD_LIBRARY)
|
|
|
|
set(CHOLMOD_LIBRARIES ${CHOLMOD_LIBRARIES} ${CAMD_LIBRARY})
|
2010-10-06 23:38:02 +08:00
|
|
|
else ()
|
2008-10-21 04:58:43 +08:00
|
|
|
set(CHOLMOD_LIBRARIES FALSE)
|
2010-10-06 23:38:02 +08:00
|
|
|
endif ()
|
2008-10-21 04:58:43 +08:00
|
|
|
|
2019-11-01 00:36:27 +08:00
|
|
|
endif()
|
2008-10-20 18:43:11 +08:00
|
|
|
|
|
|
|
if(CHOLMOD_LIBRARIES)
|
2008-10-21 04:58:43 +08:00
|
|
|
|
2010-10-06 23:38:02 +08:00
|
|
|
find_library(CCOLAMD_LIBRARY ccolamd PATHS ${CHOLMOD_LIBDIR} $ENV{CHOLMODDIR} ${LIB_INSTALL_DIR})
|
2008-10-20 18:43:11 +08:00
|
|
|
if (CCOLAMD_LIBRARY)
|
|
|
|
set(CHOLMOD_LIBRARIES ${CHOLMOD_LIBRARIES} ${CCOLAMD_LIBRARY})
|
2010-10-06 23:38:02 +08:00
|
|
|
else ()
|
2008-10-21 04:58:43 +08:00
|
|
|
set(CHOLMOD_LIBRARIES FALSE)
|
2010-10-06 23:38:02 +08:00
|
|
|
endif ()
|
|
|
|
|
2019-11-01 00:36:27 +08:00
|
|
|
endif()
|
2010-10-06 23:38:02 +08:00
|
|
|
|
|
|
|
if(CHOLMOD_LIBRARIES)
|
|
|
|
|
|
|
|
find_library(CHOLMOD_METIS_LIBRARY metis PATHS ${CHOLMOD_LIBDIR} $ENV{CHOLMODDIR} ${LIB_INSTALL_DIR})
|
|
|
|
if (CHOLMOD_METIS_LIBRARY)
|
|
|
|
set(CHOLMOD_LIBRARIES ${CHOLMOD_LIBRARIES} ${CHOLMOD_METIS_LIBRARY})
|
|
|
|
endif ()
|
2008-10-20 18:43:11 +08:00
|
|
|
|
2019-11-01 00:36:27 +08:00
|
|
|
endif()
|
2008-10-20 18:43:11 +08:00
|
|
|
|
2013-06-12 16:12:05 +08:00
|
|
|
if(CHOLMOD_LIBRARIES)
|
|
|
|
|
|
|
|
find_library(SUITESPARSE_LIBRARY SuiteSparse PATHS ${CHOLMOD_LIBDIR} $ENV{CHOLMODDIR} ${LIB_INSTALL_DIR})
|
|
|
|
if (SUITESPARSE_LIBRARY)
|
|
|
|
set(CHOLMOD_LIBRARIES ${CHOLMOD_LIBRARIES} ${SUITESPARSE_LIBRARY})
|
2019-11-01 00:36:27 +08:00
|
|
|
endif ()
|
2013-06-12 16:12:05 +08:00
|
|
|
|
2019-11-01 00:36:27 +08:00
|
|
|
endif()
|
2013-06-12 16:12:05 +08:00
|
|
|
|
2008-10-20 18:43:11 +08:00
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(CHOLMOD DEFAULT_MSG
|
|
|
|
CHOLMOD_INCLUDES CHOLMOD_LIBRARIES)
|
|
|
|
|
2014-07-09 22:54:15 +08:00
|
|
|
mark_as_advanced(CHOLMOD_INCLUDES CHOLMOD_LIBRARIES AMD_LIBRARY COLAMD_LIBRARY SUITESPARSE_LIBRARY CAMD_LIBRARY CCOLAMD_LIBRARY CHOLMOD_METIS_LIBRARY)
|