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

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

25 26
target_link_libraries(amdis fmt)

27 28 29 30 31
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)

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