CMakeLists.txt 1023 Bytes
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
dune_enable_all_packages(MODULE_LIBRARIES amdis fmt)
16

17
add_subdirectory("src")
18
add_subdirectory("test")
19
add_subdirectory("examples" EXCLUDE_FROM_ALL)
20
21
add_subdirectory("doc")
add_subdirectory("cmake/modules")
22
add_subdirectory("externals")
23

24
25
target_link_libraries(amdis fmt)

26
27
28
29
30
option(ENABLE_ALL_WARNINGS "enable all meaningful warnings" OFF)
if (ENABLE_ALL_WARNINGS)
  target_compile_options(amdis PUBLIC "-Wall" "-Wextra" "-pedantic" "-Wnon-virtual-dtor" "-Wold-style-cast" "-Wcast-align" "-Woverloaded-virtual" "-Wpedantic" "-Wconversion")
endif (ENABLE_ALL_WARNINGS)

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