mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-01-18 14:34:17 +08:00
clean FindUmfpack.cmake wrt enable_language(Fortran)
This commit is contained in:
parent
6b3d0e68e2
commit
eb9dadf3b2
@ -3,55 +3,58 @@ if (UMFPACK_INCLUDES AND UMFPACK_LIBRARIES)
|
||||
set(UMFPACK_FIND_QUIETLY TRUE)
|
||||
endif (UMFPACK_INCLUDES AND UMFPACK_LIBRARIES)
|
||||
|
||||
enable_language(Fortran)
|
||||
find_package(BLAS)
|
||||
if(CMAKE_Fortran_COMPILER_WORKS)
|
||||
|
||||
if(BLAS_FOUND)
|
||||
find_package(BLAS)
|
||||
|
||||
find_path(UMFPACK_INCLUDES
|
||||
NAMES
|
||||
umfpack.h
|
||||
PATHS
|
||||
$ENV{UMFPACKDIR}
|
||||
${INCLUDE_INSTALL_DIR}
|
||||
PATH_SUFFIXES
|
||||
suitesparse
|
||||
)
|
||||
if(BLAS_FOUND)
|
||||
|
||||
find_library(UMFPACK_LIBRARIES umfpack PATHS $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
|
||||
find_path(UMFPACK_INCLUDES
|
||||
NAMES
|
||||
umfpack.h
|
||||
PATHS
|
||||
$ENV{UMFPACKDIR}
|
||||
${INCLUDE_INSTALL_DIR}
|
||||
PATH_SUFFIXES
|
||||
suitesparse
|
||||
)
|
||||
|
||||
if(UMFPACK_LIBRARIES)
|
||||
find_library(UMFPACK_LIBRARIES umfpack PATHS $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
|
||||
|
||||
get_filename_component(UMFPACK_LIBDIR ${UMFPACK_LIBRARIES} PATH)
|
||||
if(UMFPACK_LIBRARIES)
|
||||
|
||||
find_library(AMD_LIBRARY amd PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
|
||||
if (AMD_LIBRARY)
|
||||
set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${AMD_LIBRARY})
|
||||
else (AMD_LIBRARY)
|
||||
set(UMFPACK_LIBRARIES FALSE)
|
||||
endif (AMD_LIBRARY)
|
||||
get_filename_component(UMFPACK_LIBDIR ${UMFPACK_LIBRARIES} PATH)
|
||||
|
||||
endif(UMFPACK_LIBRARIES)
|
||||
find_library(AMD_LIBRARY amd PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
|
||||
if (AMD_LIBRARY)
|
||||
set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${AMD_LIBRARY})
|
||||
else (AMD_LIBRARY)
|
||||
set(UMFPACK_LIBRARIES FALSE)
|
||||
endif (AMD_LIBRARY)
|
||||
|
||||
if(UMFPACK_LIBRARIES)
|
||||
endif(UMFPACK_LIBRARIES)
|
||||
|
||||
find_library(COLAMD_LIBRARY colamd PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
|
||||
if (COLAMD_LIBRARY)
|
||||
set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${COLAMD_LIBRARY})
|
||||
else (COLAMD_LIBRARY)
|
||||
set(UMFPACK_LIBRARIES FALSE)
|
||||
endif (COLAMD_LIBRARY)
|
||||
if(UMFPACK_LIBRARIES)
|
||||
|
||||
endif(UMFPACK_LIBRARIES)
|
||||
find_library(COLAMD_LIBRARY colamd PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
|
||||
if (COLAMD_LIBRARY)
|
||||
set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${COLAMD_LIBRARY})
|
||||
else (COLAMD_LIBRARY)
|
||||
set(UMFPACK_LIBRARIES FALSE)
|
||||
endif (COLAMD_LIBRARY)
|
||||
|
||||
if(UMFPACK_LIBRARIES)
|
||||
set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${BLAS_LIBRARIES})
|
||||
endif(UMFPACK_LIBRARIES)
|
||||
endif(UMFPACK_LIBRARIES)
|
||||
|
||||
endif(BLAS_FOUND)
|
||||
if(UMFPACK_LIBRARIES)
|
||||
set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${BLAS_LIBRARIES})
|
||||
endif(UMFPACK_LIBRARIES)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(UMFPACK DEFAULT_MSG
|
||||
UMFPACK_INCLUDES UMFPACK_LIBRARIES)
|
||||
endif(BLAS_FOUND)
|
||||
|
||||
endif(CMAKE_Fortran_COMPILER_WORKS)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(UMFPACK DEFAULT_MSG
|
||||
UMFPACK_INCLUDES UMFPACK_LIBRARIES)
|
||||
|
||||
mark_as_advanced(UMFPACK_INCLUDES UMFPACK_LIBRARIES AMD_LIBRARY COLAMD_LIBRARY)
|
||||
|
@ -25,6 +25,7 @@ else(CHOLMOD_FOUND)
|
||||
message("CHOLMOD not found, this optional backend won't be tested")
|
||||
endif(CHOLMOD_FOUND)
|
||||
|
||||
enable_language(Fortran OPTIONAL)
|
||||
find_package(Umfpack)
|
||||
if(UMFPACK_FOUND)
|
||||
add_definitions("-DEIGEN_UMFPACK_SUPPORT")
|
||||
|
Loading…
Reference in New Issue
Block a user