AmdisMacros.cmake 1.06 KB
Newer Older
1
2
include(AmdisCXXFeatures)
include(AddAmdisExecutable)
3

4
5
set(BACKEND "ISTL" CACHE STRING "LinearAlgebra backend. One of MTL, EIGEN, ISTL")
set_property(CACHE BACKEND PROPERTY STRINGS "MTL" "EIGEN" "ISTL")
Praetorius, Simon's avatar
Praetorius, Simon committed
6

7
if (BACKEND STREQUAL "MTL" OR BACKEND STREQUAL "MTL4")
8
  find_package(MTL REQUIRED)
9
10
  set(HAVE_MTL MTL_FOUND)
  if (MTL_FOUND)
11
12
    message(STATUS "  Found MTL, version: ${MTL_VERSION}")
    dune_register_package_flags(LIBRARIES MTL::MTL COMPILE_DEFINITIONS "ENABLE_MTL=1")
13
  endif (MTL_FOUND)
14
elseif (BACKEND STREQUAL "EIGEN" OR BACKEND STREQUAL "EIGEN3")
15
  find_package(Eigen3 REQUIRED 3.3.5)
16
17
  set(HAVE_EIGEN EIGEN_FOUND)
  if (EIGEN3_FOUND)
18
19
    message(STATUS "  Found Eigen3, version: ${Eigen3_VERSION}")
    dune_register_package_flags(LIBRARIES Eigen3::Eigen COMPILE_DEFINITIONS "ENABLE_EIGEN=1")
20
  endif (EIGEN3_FOUND)
21
22
23
24
25
26
elseif (BACKEND STREQUAL "ISTL")
  if (NOT dune-istl_FOUND)
    message(FATAL_ERROR "Need dune-istl, MTL, or Eigen3 as linear algebra backend. Change flag BACKEND!")
  endif ()
else ()
  message(FATAL_ERROR "BACKEND must be one of MTL, EIGEN, ISTL")
27
endif ()