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

Dion Haefner's avatar
Dion Haefner committed
4 5 6 7 8 9 10 11 12 13
# 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()

Lukas Riedel's avatar
Lukas Riedel committed
14 15
# add extra flags to debug compiler flags
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall")
Dion Haefner's avatar
Dion Haefner committed
16

17 18
# option to change DG scheme via config file
option(EXPERIMENTAL_DG_FEATURES
19
  "Enable experimental DG settings through the config file"
20 21
  OFF
)
22

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 43
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)

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

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