The TS-GitLab will have to shut down towards the end of the year — please think about migrating your projects to GitLab.com or GitHub.
(This is still a very early message, meant to keep you informed. There will be more urgent ones in the future.)

CMakeLists.txt 1.66 KB
Newer Older
Dion Haefner's avatar
Dion Haefner committed
1 2 3
cmake_minimum_required(VERSION 2.8.12)
project(dorie CXX)

Dion Haefner's avatar
Dion Haefner committed
4 5 6 7 8 9 10 11 12
# set build type
if(NOT CMAKE_BUILD_TYPE)
	set(CMAKE_BUILD_TYPE "Release")
endif()

string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UPPER)
if(CMAKE_BUILD_TYPE_UPPER MATCHES DEBUG)
	set(CMAKE_VERBOSE_MAKEFILE ON)
endif()
13
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Werror")
Dion Haefner's avatar
Dion Haefner committed
14

15 16 17 18 19 20 21 22
# option to change DG scheme via config file
option(EXPERIMENTAL_DG_FEATURES
  "Set DG method and upwinding scheme in config file"
  OFF)
if(EXPERIMENTAL_DG_FEATURES)
  add_definitions(-DEXPERIMENTAL_DG_FEATURES)
endif()

Dion Haefner's avatar
Dion Haefner committed
23
# 
Dion Haefner's avatar
Dion Haefner committed
24 25 26 27 28 29
if(NOT (dune-common_DIR 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()

Dion Haefner's avatar
Dion Haefner committed
30
# find dune-common and set the module path
Dion Haefner's avatar
Dion Haefner committed
31 32 33 34
find_package(dune-common REQUIRED)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules"
  ${dune-common_MODULE_PATH})

Dion Haefner's avatar
Dion Haefner committed
35
# include the dune macros
Dion Haefner's avatar
Dion Haefner committed
36 37 38 39 40 41 42
include(DuneMacros)

# start a dune project with information from dune.module
dune_project()
dune_enable_all_packages()
dune_require_cxx_standard(MODULE "dorie" VERSION 14)

43 44 45
# avoid the executables from being 'excluded from all'
set(DUNE_BUILD_TESTS_ON_MAKE_ALL TRUE)

Dion Haefner's avatar
Dion Haefner committed
46 47 48 49
# add subdirectories
add_subdirectory("bin")
add_subdirectory("m4")
add_subdirectory("dune")
50
add_subdirectory("lib")
Dion Haefner's avatar
Dion Haefner committed
51 52 53 54 55 56 57 58 59
add_subdirectory("python")
add_subdirectory("doc")
if(dune-testtools_FOUND)
    add_subdirectory("testing")
endif()
add_subdirectory("cmake/modules")
                  
# finalize the dune project, e.g. generating config.h etc.
finalize_dune_project(GENERATE_CONFIG_H_CMAKE)
60

Dion Haefner's avatar
Dion Haefner committed
61
message(STATUS "Build Type: ${CMAKE_BUILD_TYPE}")