|
| 1 | +## |
| 2 | +# CMake script for the MPI_heat_eqn tutorial program: |
| 3 | +## |
| 4 | + |
| 5 | +# Set the name of the project and target: |
| 6 | +SET(TARGET "MPI_heat_eqn") |
| 7 | + |
| 8 | +# Declare all source files the target consists of. Here, this is only |
| 9 | +# the one step-X.cc file, but as you expand your project you may wish |
| 10 | +# to add other source files as well. If your project becomes much larger, |
| 11 | +# you may want to either replace the following statement by something like |
| 12 | +# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") |
| 13 | +# FILE(GLOB_RECURSE TARGET_INC "include/*.h") |
| 14 | +# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) |
| 15 | +# or switch altogether to the large project CMakeLists.txt file discussed |
| 16 | +# in the "CMake in user projects" page accessible from the "User info" |
| 17 | +# page of the documentation. |
| 18 | +SET(TARGET_SRC |
| 19 | + ${TARGET}.cc |
| 20 | + ) |
| 21 | + |
| 22 | +# Usually, you will not need to modify anything beyond this point... |
| 23 | + |
| 24 | +CMAKE_MINIMUM_REQUIRED(VERSION 3.13.4) |
| 25 | + |
| 26 | +FIND_PACKAGE(deal.II 9.5.0 |
| 27 | + HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} |
| 28 | + ) |
| 29 | +IF(NOT ${deal.II_FOUND}) |
| 30 | + MESSAGE(FATAL_ERROR "\n" |
| 31 | + "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" |
| 32 | + "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" |
| 33 | + "or set an environment variable \"DEAL_II_DIR\" that contains this path." |
| 34 | + ) |
| 35 | +ENDIF() |
| 36 | + |
| 37 | +# |
| 38 | +# Are all dependencies fulfilled? |
| 39 | +# |
| 40 | +if(NOT ((DEAL_II_WITH_PETSC AND NOT DEAL_II_PETSC_WITH_COMPLEX) OR DEAL_II_WITH_TRILINOS) OR NOT DEAL_II_WITH_P4EST) |
| 41 | + message(FATAL_ERROR " |
| 42 | +Error! This tutorial requires a deal.II library that was configured with the following options: |
| 43 | + DEAL_II_WITH_PETSC = ON |
| 44 | + DEAL_II_PETSC_WITH_COMPLEX = OFF |
| 45 | + DEAL_II_WITH_P4EST = ON |
| 46 | +or |
| 47 | + DEAL_II_WITH_TRILINOS = ON |
| 48 | + DEAL_II_WITH_P4EST = ON |
| 49 | +However, the deal.II library found at ${DEAL_II_PATH} was configured with these options: |
| 50 | + DEAL_II_WITH_PETSC = ${DEAL_II_WITH_PETSC} |
| 51 | + DEAL_II_PETSC_WITH_COMPLEX = ${DEAL_II_PETSC_WITH_COMPLEX} |
| 52 | + DEAL_II_WITH_P4EST = ${DEAL_II_WITH_P4EST} |
| 53 | + DEAL_II_WITH_TRILINOS = ${DEAL_II_WITH_TRILINOS} |
| 54 | +This conflicts with the requirements. |
| 55 | +One or both of the aforementioned combinations of prerequisites are not met by your installation, but at least one is required for this tutorial step." |
| 56 | + ) |
| 57 | + |
| 58 | +endif() |
| 59 | +DEAL_II_INITIALIZE_CACHED_VARIABLES() |
| 60 | +PROJECT(${TARGET}) |
| 61 | +DEAL_II_INVOKE_AUTOPILOT() |
0 commit comments