CMakeLists.txt 1.12 KB
Newer Older
1
2
# set up project
project("dumux" C CXX)
3

4
# general stuff
5
cmake_minimum_required(VERSION 2.8.12)
Bernd Flemisch's avatar
Bernd Flemisch committed
6

7
if(NOT (dune-common_DIR
8
9
10
11
12
13
14
        OR dune-common_ROOT
        OR "${CMAKE_PREFIX_PATH}" MATCHES ".*dune-common.*"))
    string(REPLACE  ${CMAKE_PROJECT_NAME}
      dune-common dune-common_DIR
      ${PROJECT_BINARY_DIR})
endif()

15
16
#find dune-common and set the module path
find_package(dune-common)
17
18
list(APPEND CMAKE_MODULE_PATH ${dune-common_MODULE_PATH}
  "${PROJECT_SOURCE_DIR}/cmake/modules")
19
20
#include the dune macros
include(DuneMacros)
Bernd Flemisch's avatar
Bernd Flemisch committed
21

22
23
# start a dune project with information from dune.module
dune_project()
24
dune_enable_all_packages()
Bernd Flemisch's avatar
Bernd Flemisch committed
25

26
27
28
# enforce C++-14
dune_require_cxx_standard(MODULE "DuMuX" VERSION 14)

29
30
add_subdirectory(cmake/modules)
add_subdirectory(doc)
31
add_subdirectory(dumux)
32
33
add_subdirectory(test EXCLUDE_FROM_ALL)
add_subdirectory(tutorial EXCLUDE_FROM_ALL)
Bernd Flemisch's avatar
Bernd Flemisch committed
34

35
if(DUNE_COMMON_VERSION VERSION_LESS 2.5)
36
37
38
39
  # de-activate testing the DUNE way
  # now ctest (aka make test) does not build the tests
  set(DUNE_TEST_MAGIC OFF)
endif()
40

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