CMakeLists.txt 2.65 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
cmake_minimum_required(VERSION 3.10)
project(CatalystExamples C CXX)

include(CMakeDependentOption)
cmake_dependent_option(USE_CATALYST "Link the simulator with Catalyst" ON
  "NOT WIN32" OFF)
if (USE_CATALYST)
  find_package(ParaView REQUIRED)

  if (NOT TARGET ParaView::PythonCatalyst)
    message(STATUS
      "${CMAKE_PROJECT_NAME} requires ParaView to be built with Catalyst and "
      "Python support enabled. Please rebuild ParaView (or point to a "
      "different build of ParaView) with PARAVIEW_ENABLE_CATALYST and "
      "PARAVIEW_ENABLE_PYTHON set to TRUE")
    return ()
17
  endif()
18
19
20
21
22
23
24
25
26
27
28
29

  if (NOT PARAVIEW_USE_MPI)
    message(STATUS
      "${CMAKE_PROJECT_NAME} requires ParaView to be built with MPI support "
      "enabled. Please rebuild ParaView (or point to a different build of "
      "ParaView) with PARAVIEW_USE_MPI set to TRUE")
    return ()
  endif ()

  # FIXME: This should really be fixed to instead be done per-target.
  add_definitions(-DUSE_CATALYST)
else ()
30
31
32
33
34
35
36
  find_package(MPI COMPONENTS C)
  if (NOT MPI_FOUND)
    message(STATUS
      "${CMAKE_PROJECT_NAME} requires MPI support, but none was found. "
      "Skipping ${CMAKE_PROJECT_NAME} examples.")
    return ()
  endif ()
37
endif ()
38
39
40
41
42
43
44

option(BUILD_TESTING "Build Testing" OFF)
# Setup testing.
if (BUILD_TESTING)
  include(CTest)
endif()

45
add_subdirectory(CFullExample)
46
47
add_subdirectory(CFullExample2)
add_subdirectory(CxxFullExample)
48
49
50
add_subdirectory(CxxGhostCellsExample)
# FIXME: HTG API has changed since this was written.
#add_subdirectory(CxxHyperTreeGridExample)
51
add_subdirectory(CxxImageDataExample)
52
53
add_subdirectory(CxxMappedDataArrayExample)
add_subdirectory(CxxMultiChannelInputExample)
54
add_subdirectory(CxxMultiPieceExample)
55
56
add_subdirectory(CxxNonOverlappingAMRExample)
add_subdirectory(CxxOverlappingAMRExample)
57
add_subdirectory(CxxPVSMPipelineExample)
58
59
60
add_subdirectory(CxxParticlePathExample)
add_subdirectory(CxxSOADataArrayExample)
add_subdirectory(CxxVTKPipelineExample)
61
62
add_subdirectory(MPISubCommunicatorExample)
add_subdirectory(PythonDolfinExample)
63
#add_subdirectory(PythonFullExample)
64

65
66
option(BUILD_FORTRAN_EXAMPLES "Build Fortran Catalyst Examples" OFF)
if (BUILD_FORTRAN_EXAMPLES)
67
68
  # Theoretically, CheckFortran should not be needed, but
  # enable_language(OPTIONAL) fails with Ninja generator.
69
70
  list(APPEND CMAKE_MODULE_PATH
    "${CMAKE_CURRENT_SOURCE_DIR}/../../CMake")
71
  include(CheckFortran)
72
73
  check_fortran_support()
  if (CMAKE_Fortran_COMPILER)
74
    enable_language(Fortran OPTIONAL)
75
76
77
78
  endif ()
  if (CMAKE_Fortran_COMPILER_WORKS)
    find_package(MPI REQUIRED COMPONENTS Fortran)

79
80
    add_subdirectory(Fortran90FullExample)
    add_subdirectory(FortranPoissonSolver)
81
82
  endif ()
endif ()