LP-311 Remove basic/advanced stabilization tab auto-switch (autotune/txpid lock issues)
[librepilot.git] / ground / gcs / src / libs / eigen / cmake / FindUmfpack.cmake
blob53cf0b49b2e23d3b8e8334e2ee53e69e313f6fbd
1 # Umfpack lib usually requires linking to a blas library.
2 # It is up to the user of this module to find a BLAS and link to it.
4 if (UMFPACK_INCLUDES AND UMFPACK_LIBRARIES)
5   set(UMFPACK_FIND_QUIETLY TRUE)
6 endif (UMFPACK_INCLUDES AND UMFPACK_LIBRARIES)
8 find_path(UMFPACK_INCLUDES
9   NAMES
10   umfpack.h
11   PATHS
12   $ENV{UMFPACKDIR}
13   ${INCLUDE_INSTALL_DIR}
14   PATH_SUFFIXES
15   suitesparse
16   ufsparse
19 find_library(UMFPACK_LIBRARIES umfpack PATHS $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
21 if(UMFPACK_LIBRARIES)
23   if(NOT UMFPACK_LIBDIR)
24     get_filename_component(UMFPACK_LIBDIR ${UMFPACK_LIBRARIES} PATH)
25   endif(NOT UMFPACK_LIBDIR)
27   find_library(COLAMD_LIBRARY colamd PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
28   if(COLAMD_LIBRARY)
29     set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${COLAMD_LIBRARY})
30   endif ()
31   
32   find_library(AMD_LIBRARY amd PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
33   if(AMD_LIBRARY)
34     set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${AMD_LIBRARY})
35   endif ()
37   find_library(SUITESPARSE_LIBRARY SuiteSparse PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
38   if(SUITESPARSE_LIBRARY)
39     set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${SUITESPARSE_LIBRARY})
40   endif ()
42   find_library(CHOLMOD_LIBRARY cholmod PATHS $ENV{UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
43   if(CHOLMOD_LIBRARY)
44     set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${CHOLMOD_LIBRARY})
45   endif()
47 endif(UMFPACK_LIBRARIES)
49 include(FindPackageHandleStandardArgs)
50 find_package_handle_standard_args(UMFPACK DEFAULT_MSG
51                                   UMFPACK_INCLUDES UMFPACK_LIBRARIES)
53 mark_as_advanced(UMFPACK_INCLUDES UMFPACK_LIBRARIES AMD_LIBRARY COLAMD_LIBRARY CHOLMOD_LIBRARY SUITESPARSE_LIBRARY)