Commit 4846888e authored by Max Lyon's avatar Max Lyon

update FindSUITSPARSE to not require a library dir

parent 7829f410
Pipeline #9084 passed with stages
in 6 minutes and 46 seconds
...@@ -94,6 +94,11 @@ else( WIN32 ) ...@@ -94,6 +94,11 @@ else( WIN32 )
FIND_PATH( CHOLMOD_INCLUDE_DIR cholmod.h FIND_PATH( CHOLMOD_INCLUDE_DIR cholmod.h
PATHS /opt/local/include/ufsparse ) PATHS /opt/local/include/ufsparse )
FIND_LIBRARY(SUITESPARSE_LIBRARY
NAMES libSuiteSparse.dylib
PATHS /opt/local/lib)
message("SUITESPARSE_LIBRARY: ${SUITESPARSE_LIBRARY}")
FIND_PATH( SUITESPARSE_LIBRARY_DIR FIND_PATH( SUITESPARSE_LIBRARY_DIR
NAMES libSuiteSparse.dylib NAMES libSuiteSparse.dylib
PATHS /opt/local/lib ) PATHS /opt/local/lib )
...@@ -101,7 +106,7 @@ else( WIN32 ) ...@@ -101,7 +106,7 @@ else( WIN32 )
message("SUITESPARSE_LIBRARY_DIR: ${SUITESPARSE_LIBRARY_DIR}") message("SUITESPARSE_LIBRARY_DIR: ${SUITESPARSE_LIBRARY_DIR}")
list ( APPEND SUITESPARSE_LIBRARY_DIRS ${SUITESPARSE_LIBRARY_DIR} ) list ( APPEND SUITESPARSE_LIBRARY_DIRS ${SUITESPARSE_LIBRARY_DIR} )
list ( APPEND SUITESPARSE_LIBRARIES SuiteSparse) list ( APPEND SUITESPARSE_LIBRARIES ${SUITESPARSE_LIBRARY})
else(APPLE) else(APPLE)
FIND_PATH( CHOLMOD_INCLUDE_DIR cholmod.h FIND_PATH( CHOLMOD_INCLUDE_DIR cholmod.h
...@@ -131,20 +136,41 @@ else( WIN32 ) ...@@ -131,20 +136,41 @@ else( WIN32 )
# if we found the library, add it to the defined libraries # if we found the library, add it to the defined libraries
if ( SUITESPARSE_LIBRARY_DIR ) if ( SUITESPARSE_LIBRARY_DIR )
# Skipped, as this is set for apple in the block above FIND_LIBRARY(SUITESPARSE_AMD_LIBRARY
# if (NOT APPLE) NAMES amd
list ( APPEND SUITESPARSE_LIBRARIES amd) PATHS ${SUITESPARSE_LIBRARY_DIR})
list ( APPEND SUITESPARSE_LIBRARIES btf) list ( APPEND SUITESPARSE_LIBRARIES ${SUITESPARSE_AMD_LIBRARY})
list ( APPEND SUITESPARSE_LIBRARIES camd) FIND_LIBRARY(SUITESPARSE_CAMD_LIBRARY
list ( APPEND SUITESPARSE_LIBRARIES ccolamd) NAMES camd
list ( APPEND SUITESPARSE_LIBRARIES cholmod) PATHS ${SUITESPARSE_LIBRARY_DIR})
list ( APPEND SUITESPARSE_LIBRARIES colamd) list ( APPEND SUITESPARSE_LIBRARIES ${SUITESPARSE_CAMD_LIBRARY})
FIND_LIBRARY(SUITESPARSE_CCOLAMD_LIBRARY
NAMES ccolamd
PATHS ${SUITESPARSE_LIBRARY_DIR})
list ( APPEND SUITESPARSE_LIBRARIES ${SUITESPARSE_CCOLAMD_LIBRARY})
FIND_LIBRARY(SUITESPARSE_CHOLMOD_LIBRARY
NAMES cholmod
PATHS ${SUITESPARSE_LIBRARY_DIR})
list ( APPEND SUITESPARSE_LIBRARIES ${SUITESPARSE_CHOLMOD_LIBRARY})
FIND_LIBRARY(SUITESPARSE_COLAMD_LIBRARY
NAMES cholmod
PATHS ${SUITESPARSE_LIBRARY_DIR})
list ( APPEND SUITESPARSE_LIBRARIES ${SUITESPARSE_COLAMD_LIBRARY})
FIND_LIBRARY(SUITESPARSE_CXSPARSE_LIBRARY
NAMES cxsparse
PATHS ${SUITESPARSE_LIBRARY_DIR})
list ( APPEND SUITESPARSE_LIBRARIES ${SUITESPARSE_CXSPARSE_LIBRARY})
FIND_LIBRARY(SUITESPARSE_KLU_LIBRARY
NAMES klu
PATHS ${SUITESPARSE_LIBRARY_DIR})
list ( APPEND SUITESPARSE_LIBRARIES ${SUITESPARSE_KLU_LIBRARY})
FIND_LIBRARY(SUITESPARSE_UMFPACK_LIBRARY
NAMES umfpack
PATHS ${SUITESPARSE_LIBRARY_DIR})
list ( APPEND SUITESPARSE_LIBRARIES ${SUITESPARSE_UMFPACK_LIBRARY})
# list ( APPEND SUITESPARSE_LIBRARIES csparse) # list ( APPEND SUITESPARSE_LIBRARIES csparse)
list ( APPEND SUITESPARSE_LIBRARIES cxsparse)
list ( APPEND SUITESPARSE_LIBRARIES klu)
# list ( APPEND SUITESPARSE_LIBRARIES spqr) # list ( APPEND SUITESPARSE_LIBRARIES spqr)
list ( APPEND SUITESPARSE_LIBRARIES umfpack)
# endif()
# Metis and spqr are optional # Metis and spqr are optional
FIND_LIBRARY( SUITESPARSE_METIS_LIBRARY FIND_LIBRARY( SUITESPARSE_METIS_LIBRARY
...@@ -165,7 +191,7 @@ else( WIN32 ) ...@@ -165,7 +191,7 @@ else( WIN32 )
NAMES spqr NAMES spqr
PATHS ${SUITESPARSE_LIBRARY_DIR} ) PATHS ${SUITESPARSE_LIBRARY_DIR} )
if (SUITESPARSE_SPQR_LIBRARY) if (SUITESPARSE_SPQR_LIBRARY)
list ( APPEND SUITESPARSE_LIBRARIES spqr) list ( APPEND SUITESPARSE_LIBRARIES ${SUITESPARSE_SPQR_LIBRARY})
endif (SUITESPARSE_SPQR_LIBRARY) endif (SUITESPARSE_SPQR_LIBRARY)
endif() endif()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment