Commit 60faf281 authored by Dominic Kempf's avatar Dominic Kempf

Add CMake support

parent a56cc0da
cmake_minimum_required(VERSION 2.8.6)
project(pdelab-exercise2-sol CXX)
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()
#find dune-common and set the module path
find_package(dune-common REQUIRED)
list(APPEND CMAKE_MODULE_PATH ${dune-common_MODULE_PATH})
#include the dune macros
include(DuneMacros)
# start a dune project with information from dune.module
dune_project()
# start of the block specific to this project
add_subdirectory(src)
# end of the block specific to this project
# finalize the dune project, e.g. generating config.h etc.
finalize_dune_project(GENERATE_CONFIG_H_CMAKE)
add_executable(example02 example02.cc)
target_link_libraries(example02 ${DUNE_LIBS})
add_executable(example02b example02b.cc)
target_link_libraries(example02b ${DUNE_LIBS})
add_dune_superlu_flags(example02b)
add_executable(example02c example02c.cc)
target_link_libraries(example02c ${DUNE_LIBS})
add_dune_alugrid_flags(example02c)
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