forked from bilke/cmake-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FindCVODE.cmake
50 lines (41 loc) · 1.35 KB
/
FindCVODE.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Tries to find Sundials CVODE.
#
# This module will define the following variables:
# CVODE_INCLUDE_DIRS - Location of the CVODE includes
# CVODE_FOUND - true if CVODE was found on the system
# CVODE_LIBRARIES - Required libraries for all requested components
#
# This module accepts the following environment or CMake vars
# CVODE_ROOT - Install location to search for
include(FindPackageHandleStandardArgs)
if(NOT "$ENV{CVODE_ROOT}" STREQUAL "" OR NOT "${CVODE_ROOT}" STREQUAL "")
list(APPEND CMAKE_INCLUDE_PATH "$ENV{CVODE_ROOT}" "${CVODE_ROOT}")
list(APPEND CMAKE_LIBRARY_PATH "$ENV{CVODE_ROOT}" "${CVODE_ROOT}")
endif()
find_path(CVODE_INCLUDE_DIRS sundials/sundials_types.h
ENV CVODE_ROOT
PATH_SUFFIXES include
)
find_library(CVODE_LIBRARY
NAMES sundials_cvode
ENV CVODE_ROOT
PATH_SUFFIXES lib Lib
)
find_library(CVODE_NVECSERIAL
NAMES sundials_nvecserial
ENV CVODE_ROOT
PATH_SUFFIXES lib Lib
)
find_library(CVODE_KLU klu)
find_package_handle_standard_args(CVODE DEFAULT_MSG
CVODE_LIBRARY
CVODE_NVECSERIAL
CVODE_INCLUDE_DIRS
)
if(CVODE_FOUND)
set(CVODE_LIBRARIES ${CVODE_LIBRARY} ${CVODE_NVECSERIAL} CACHE INTERNAL "")
if(CVODE_KLU)
set(CVODE_LIBRARIES ${CVODE_LIBRARIES} ${CVODE_KLU} CACHE INTERNAL "")
endif()
endif()
mark_as_advanced(CVODE_INCLUDE_DIRS CVODE_LIBRARY CVODE_NVECSERIAL)