CMakeLists.txt 1.24 KB
Newer Older
1
cmake_minimum_required(VERSION 3.1)
2
project(amdis CXX)
3
4
5
6
7
8
9
10
11
12
13

#find dune-common and set the module path
find_package(dune-common REQUIRED)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules"
  ${dune-common_MODULE_PATH})

#include the dune macros
include(DuneMacros)

# start a dune project with information from dune.module
dune_project()
14

15
16
17
dune_enable_all_packages(MODULE_LIBRARIES amdis)

include(AmdisMacros)
18
add_subdirectory("src")
19
add_subdirectory("test")
20
add_subdirectory("examples")
21
22
23
add_subdirectory("doc")
add_subdirectory("cmake/modules")

24
25
26
27
28

# some additional packages and flags
find_package(MTL REQUIRED
             PATHS /usr/local/lib/mtl4 /opt/sources/mtl4 /opt/development/mtl4)
if (MTL_FOUND)
29
  target_include_directories(amdis PUBLIC ${MTL_INCLUDE_DIRS})
30
31
32

  set (CXX_ELEVEN_FEATURE_LIST "MOVE" "AUTO" "RANGEDFOR" "INITLIST" "STATICASSERT" "DEFAULTIMPL")
  foreach (feature ${CXX_ELEVEN_FEATURE_LIST})
33
      target_compile_definitions(amdis PUBLIC MTL_WITH_${feature})
34
35
36
  endforeach ()

  if (HAVE_UMFPACK OR ENABLE_SUITESPARSE OR SuiteSparse_FOUND)
37
      target_compile_definitions(amdis PUBLIC MTL_HAS_UMFPACK)
38
39
40
  endif ()
endif (MTL_FOUND)

41
42
# finalize the dune project, e.g. generating config.h etc.
finalize_dune_project(GENERATE_CONFIG_H_CMAKE)