Commit f50e5ec4 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

CMake warnings reduced

parent dc27612b
cmake_minimum_required(VERSION 3.13)
project(amdis LANGUAGES CXX VERSION 0.3)
#find dune-common and set the module path
# 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 the dune macros
include(DuneMacros)
# some options to control the cmake behvior
option(ENABLE_ALL_WARNINGS "enable all meaningful warnings" OFF)
option(ENABLE_CCACHE "enable compiler cache" ON)
# start a dune project with information from dune.module
dune_project()
dune_add_library(amdis)
......@@ -42,7 +47,6 @@ if (PETSc_FOUND)
endif (PETSc_FOUND)
option(ENABLE_ALL_WARNINGS "enable all meaningful warnings" OFF)
if (ENABLE_ALL_WARNINGS)
target_compile_options(amdis PUBLIC "-Wall" "-Wpedantic"
"-Wextra" "-Wnon-virtual-dtor"
......
......@@ -82,7 +82,7 @@ function(add_amdis_executable)
# add all flags to the target!
add_dune_all_flags(${ADDEXE_NAME})
target_link_dune_default_libraries(${ADDEXE_NAME})
target_link_libraries(${ADDEXE_NAME} amdis)
dune_target_link_libraries(${ADDEXE_NAME} amdis)
if(ADDEXE_DIM)
set(GRIDDIM ${ADDEXE_DIM})
......
......@@ -3,7 +3,7 @@ include(AddAmdisExecutable)
# some optimization of the compile times
find_program(CCACHE_PROGRAM ccache)
if (CCACHE_PROGRAM)
if (ENABLE_CCACHE AND CCACHE_PROGRAM)
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
add_compile_options("-fdiagnostics-color")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment