FindSUPERLU.cmake 1.55 KB
Newer Older
Jan Möbius's avatar
Jan Möbius committed
1 2 3 4 5 6
if (SUPERLU_INCLUDE_DIR)
  # in cache already
  set(SUPERLU_FOUND TRUE)
else (SUPERLU_INCLUDE_DIR)

if (WIN32)
7 8

   find_path(SUPERLU_INCLUDE_DIR NAMES SRC/supermatrix.h
Jan Möbius's avatar
Jan Möbius committed
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
     PATHS
     "C:\\libs\\SuperLU_3.0"
     ${SUPERLU_INCLUDE_PATH}
   )

   find_library( SUPERLU_LIBRARY_RELEASE 
                 SuperLU
                 PATHS "C:\\libs\\SuperLU_3.0\\lib" )
   find_library( SUPERLU_LIBRARY_DEBUG
                   SuperLUd
                   PATHS "C:\\libs\\SuperLU_3.0\\lib" )


   set ( SUPERLU_LIBRARY "optimized;${SUPERLU_LIBRARY_RELEASE};debug;${SUPERLU_LIBRARY_DEBUG}" CACHE  STRING "SuperLU Libraries" )

ELSEIF(APPLE)

26
   find_path(SUPERLU_INCLUDE_DIR NAMES superlu/supermatrix.h
Jan Möbius's avatar
Jan Möbius committed
27 28
	     PATHS "${CMAKE_SOURCE_DIR}/MacOS/Libs/SuperLU_3.0.64-bit.snow_leopard/SuperLU"
	     	   ${SUPERLU_INCLUDE_PATH}
29
                   ~/sw/SuperLU_4.2/include
30
                   ~/sw/SuperLU_4.1/include
Jan Möbius's avatar
Jan Möbius committed
31 32 33
            )

   find_library( SUPERLU_LIBRARY 
34
                 SuperLU libsuperlu_4.1.a SuperLU libsuperlu_4.2.a
35
                 PATHS "${CMAKE_SOURCE_DIR}/MacOS/Libs/SuperLU_3.0.64-bit.snow_leopard/SuperLU"
36
                       ~/sw/SuperLU_4.1/lib 
37
                       ~/sw/SuperLU_4.2/lib )
Jan Möbius's avatar
Jan Möbius committed
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55

ELSE( WIN32 )
   find_path(SUPERLU_INCLUDE_DIR NAMES supermatrix.h
     PATHS /usr/include/superlu
     ${SUPERLU_INCLUDE_PATH}
   )

   find_library( SUPERLU_LIBRARY 
                 superlu
                 PATHS /usr/lib )

ENDIF()

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SUPERLU DEFAULT_MSG SUPERLU_INCLUDE_DIR )

endif(SUPERLU_INCLUDE_DIR)