CMakeLists.txt 898 Bytes
Newer Older
1
cmake_minimum_required(VERSION 2.8.6)
2
project(dune-solvers CXX)
3

4 5 6 7
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})
8 9
endif()

10
#find dune-common and set the module path
11
find_package(dune-common REQUIRED)
12 13 14 15
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules"
  ${dune-common_MODULE_PATH})

#include the dune macros
16 17
include(DuneMacros)

18
# start a dune project with information from dune.module
19 20
dune_project()

21 22 23 24
# Optional packages that are only needed for tests:
find_package(SuiteSparse OPTIONAL_COMPONENTS UMFPACK)
include(AddSuiteSparseFlags)

25 26 27
add_subdirectory("dune")
add_subdirectory("doc")
add_subdirectory("cmake/modules")
28

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