File: CMakeLists.txt

package info (click to toggle)
paraview 5.11.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 497,236 kB
  • sloc: cpp: 3,171,290; ansic: 1,315,072; python: 134,290; xml: 103,324; sql: 65,887; sh: 5,286; javascript: 4,901; yacc: 4,383; java: 3,977; perl: 2,363; lex: 1,909; f90: 1,255; objc: 143; makefile: 119; tcl: 59; pascal: 50; fortran: 29
file content (38 lines) | stat: -rw-r--r-- 1,164 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
vtk_module_third_party_external(
  PACKAGE       MPI
  COMPONENTS    C
  TARGETS       MPI::MPI_C
  INCLUDE_DIRS  MPI_C_INCLUDE_DIRS MPI_C_INCLUDE_PATH
  LIBRARIES     MPI_C_LIBRARIES
  DEFINITIONS   MPI_C_COMPILE_DEFINITIONS
  STANDARD_INCLUDE_DIRS)

vtk_module_install_headers(
  FILES "${CMAKE_CURRENT_SOURCE_DIR}/vtk_mpi.h")

vtk_module_definitions(VTK::mpi
  INTERFACE
    MPICH_SKIP_MPICXX
    OMPI_SKIP_MPICXX
    MPI_NO_CPPBIND
    _MPICC_H)

if (APPLE AND TARGET MPI::MPI_C)
  # On macOS, MPI might have the `-Wl,-flat_namespace` option in it (mpich has
  # been observed). This is incompatible with `@rpath` usage, so if we see it,
  # just remove it from the link flags of the target.
  get_property(mpi_link_flags
    TARGET    MPI::MPI_C
    PROPERTY  INTERFACE_LINK_LIBRARIES)
  set(fixed_mpi_link_flags)
  foreach (mpi_link_flag IN LISTS mpi_link_flags)
    string(FIND "${mpi_link_flag}" "-Wl,-flat_namespace" idx)
    if (idx EQUAL "-1")
      list(APPEND fixed_mpi_link_flags
        "${mpi_link_flag}")
    endif ()
  endforeach ()
  set_property(TARGET MPI::MPI_C
    PROPERTY
      INTERFACE_LINK_LIBRARIES "${fixed_mpi_link_flags}")
endif ()