eigen/cmake/FindSPQR.cmake
Hans Johnson 6fb3e5f176 STYLE: Remove CMake-language block-end command arguments
Ancient versions of CMake required else(), endif(), and similar block
termination commands to have arguments matching the command starting the block.
This is no longer the preferred style.
2019-10-31 11:36:27 -05:00

41 lines
1.1 KiB
CMake

# SPQR lib usually requires linking to a blas and lapack library.
# It is up to the user of this module to find a BLAS and link to it.
# SPQR lib requires Cholmod, colamd and amd as well.
# FindCholmod.cmake can be used to find those packages before finding spqr
if (SPQR_INCLUDES AND SPQR_LIBRARIES)
set(SPQR_FIND_QUIETLY TRUE)
endif ()
find_path(SPQR_INCLUDES
NAMES
SuiteSparseQR.hpp
PATHS
$ENV{SPQRDIR}
${INCLUDE_INSTALL_DIR}
PATH_SUFFIXES
suitesparse
ufsparse
)
find_library(SPQR_LIBRARIES spqr $ENV{SPQRDIR} ${LIB_INSTALL_DIR})
if(SPQR_LIBRARIES)
find_library(SUITESPARSE_LIBRARY SuiteSparse PATHS $ENV{SPQRDIR} ${LIB_INSTALL_DIR})
if (SUITESPARSE_LIBRARY)
set(SPQR_LIBRARIES ${SPQR_LIBRARIES} ${SUITESPARSE_LIBRARY})
endif()
find_library(CHOLMOD_LIBRARY cholmod PATHS $ENV{UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
if(CHOLMOD_LIBRARY)
set(SPQR_LIBRARIES ${SPQR_LIBRARIES} ${CHOLMOD_LIBRARY})
endif()
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SPQR DEFAULT_MSG SPQR_INCLUDES SPQR_LIBRARIES)
mark_as_advanced(SPQR_INCLUDES SPQR_LIBRARIES)