paraview.cmake 9.63 KB
Newer Older
Ben Boeckel's avatar
Ben Boeckel committed
1
set(PARAVIEW_EXTRA_CMAKE_ARGUMENTS ""
Ben Boeckel's avatar
Ben Boeckel committed
2
  CACHE STRING "Extra arguments to be passed to ParaView when configuring.")
Ben Boeckel's avatar
Ben Boeckel committed
3
4
mark_as_advanced(PARAVIEW_EXTRA_CMAKE_ARGUMENTS)

5
6
7
8
9
10
set(PARAVIEW_BUILD_EDITION "CANONICAL"
  CACHE STRING "Build selected ParaView Edition")
set_property(CACHE PARAVIEW_BUILD_EDITION
  PROPERTY
    STRINGS "CORE;RENDERING;CATALYST;CATALYST_RENDERING;CANONICAL")

Ben Boeckel's avatar
Ben Boeckel committed
11
12
13
14
15
16
set (paraview_extra_cmake_options)
if (PV_NIGHTLY_SUFFIX)
  list(APPEND paraview_extra_cmake_options
    -DPV_NIGHTLY_SUFFIX:STRING=${PV_NIGHTLY_SUFFIX})
endif ()

17
18
# Without an offscreen rendering backend, X should be used.
set(paraview_use_x ON)
19
if (WIN32 OR APPLE OR osmesa_enabled OR egl_enabled)
20
  set(paraview_use_x OFF)
21
22
endif()

23
set(paraview_all_plugins)
Ben Boeckel's avatar
Ben Boeckel committed
24

Ben Boeckel's avatar
Ben Boeckel committed
25
26
27
28
29
set(paraview_smp_backend "Sequential")
if (tbb_enabled)
  set(paraview_smp_backend "TBB")
endif ()

30
31
32
33
34
set(paraview_enable_cuda "OFF")
if(vtkm_enabled AND cuda_enabled)
  set(paraview_enable_cuda "ON")
endif()

Ben Boeckel's avatar
Ben Boeckel committed
35
36
37
38
set(PARAVIEW_EXTERNAL_PROJECTS ""
  CACHE STRING "A list of projects for ParaView to depend on")
mark_as_advanced(PARAVIEW_EXTERNAL_PROJECTS)

39
40
41
42
set(paraviews_platform_dependencies)
if (UNIX)
  if (NOT APPLE)
    list(APPEND paraviews_platform_dependencies
Ben Boeckel's avatar
Ben Boeckel committed
43
      mesa osmesa egl
44
45
46

      # Needed for fonts to work properly.
      fontconfig)
47
48
  endif ()
  list(APPEND paraviews_platform_dependencies
49
    ffmpeg libxml2 freetype mili gmsh
50
    # For cosmotools
51
    genericio cosmotools)
52
53
endif ()

Ken Martin's avatar
Ken Martin committed
54
55
if (WIN32)
  list(APPEND paraviews_platform_dependencies
Ben Boeckel's avatar
Ben Boeckel committed
56
    openvr)
Ken Martin's avatar
Ken Martin committed
57
58
endif ()

59
60
61
62
63
if (USE_NONFREE_COMPONENTS AND (WIN32 OR (UNIX AND NOT APPLE)))
  list(APPEND paraviews_platform_dependencies
    visrtx)
endif ()

64
set(PARAVIEW_USE_PYTHON ${python_enabled})
65
if (python_enabled AND
66
    (python3_enabled AND USE_SYSTEM_python3 AND NOT python3_FIND_LIBRARIES))
67
  set(PARAVIEW_USE_PYTHON OFF)
68
69
endif()

Ben Boeckel's avatar
Ben Boeckel committed
70
if (expat_enabled)
Chuck Atkins's avatar
Chuck Atkins committed
71
72
  list(APPEND paraviews_platform_dependencies expat)
endif ()
73

74
75
76
77
78
79
80
81
82
83
cmake_dependent_option(PARAVIEW_INITIALIZE_MPI_ON_CLIENT
  "Initialize MPI on client-processes by default. Can be overridden using command line arguments" ON
  "mpi_enabled" OFF)
mark_as_advanced(PARAVIEW_INITIALIZE_MPI_ON_CLIENT)

if (mpi_enabled)
  list(APPEND paraview_extra_cmake_options
    -DPARAVIEW_INITIALIZE_MPI_ON_CLIENT:BOOL=${PARAVIEW_INITIALIZE_MPI_ON_CLIENT})
endif()

84
85
86
option(PARAVIEW_ENABLE_MOTIONFX "Enable MotionFX reader, if supported on platform" ON)
mark_as_advanced(PARAVIEW_ENABLE_MOTIONFX)

87
88
89
option(PARAVIEW_ENABLE_VRPLUGIN "Enable VRPlugin" ON)
mark_as_advanced(PARAVIEW_ENABLE_VRPLUGIN)

90
91
92
93
94
95
96
# vrui support is only available on linux
if (PARAVIEW_ENABLE_VRPLUGIN AND UNIX)
  list(APPEND paraview_extra_cmake_options
    -DPARAVIEW_PLUGIN_VRPlugin_USE_VRUI:BOOL=ON
  )
endif()

97
98
99
100
101
set(paraview_use_raytracing OFF)
if (ospray_enabled OR visrtx_enabled)
  set(paraview_use_raytracing ON)
endif ()

102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# add an option to override ParaView shared-libs flag.
set(BUILD_SHARED_LIBS_paraview "<same>"
  CACHE STRING "The shared/static build flag for the paraview project.")
set_property(CACHE "BUILD_SHARED_LIBS_paraview"
  PROPERTY
    STRINGS "<same>;ON;OFF")
get_property(build_shared_options
  CACHE     "BUILD_SHARED_LIBS_paraview"
  PROPERTY  STRINGS)
if (NOT BUILD_SHARED_LIBS_paraview IN_LIST build_shared_options)
  string(REPLACE ";" ", " build_shared_options "${build_shared_options}")
  message(FATAL_ERROR "BUILD_SHARED_LIBS_paraview must be one of: ${build_shared_options}.")
endif ()

if (BUILD_SHARED_LIBS_paraview STREQUAL "<same>")
  set(paraview_build_shared_libs "${BUILD_SHARED_LIBS}")
else ()
  set(paraview_build_shared_libs "${BUILD_SHARED_LIBS_paraview}")
endif ()

122
123
124
125
126
127
128
129
get_property(paraview_tbb_supported GLOBAL
  PROPERTY superbuild_tbb_supported)
set(paraview_tbb_dependencies)
if (paraview_tbb_supported)
  list(APPEND paraview_tbb_dependencies
    tbb ospray)
endif ()

Ben Boeckel's avatar
Ben Boeckel committed
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
set(PARAVIEW_BUILD_ID "<CI>"
  CACHE STRING "ParaView build ID")
if (PARAVIEW_BUILD_ID STREQUAL "<CI>")
  set(PARAVIEW_BUILD_ID "")
  if ("$ENV{CI}" STREQUAL "true")
    # Detect the status of this CI run.
    set(paraview_commit_sha "$ENV{CI_COMMIT_SHA}")
    if ("$ENV{CI_MERGE_REQUEST_IID}" STREQUAL "")
      set(paraview_mr "")
    else ()
      set(paraview_mr "$ENV{CI_MERGE_REQUEST_IID}")
    endif ()
    if ("$ENV{CI_COMMIT_TAG}" STREQUAL "")
      set(paraview_tag "")
    else ()
      set(paraview_tag "$ENV{CI_COMMIT_TAG}")
    endif ()
    if ("$ENV{CI_COMMIT_BRANCH}" STREQUAL "")
      set(paraview_branch "")
    else ()
      set(paraview_branch "$ENV{CI_COMMIT_BRANCH}")
    endif ()

    if (paraview_mr)
      set(PARAVIEW_BUILD_ID "superbuild ${paraview_commit_sha} (!${paraview_mr})")
    elseif (paraview_tag)
      set(PARAVIEW_BUILD_ID "superbuild ${paraview_commit_sha} (${paraview_tag})")
    elseif (paraview_branch)
      set(PARAVIEW_BUILD_ID "superbuild ${paraview_commit_sha} (${paraview_branch})")
    else ()
      set(PARAVIEW_BUILD_ID "superbuild ${paraview_commit_sha}")
    endif ()
  endif ()
endif ()

if (PARAVIEW_BUILD_ID)
  list(APPEND paraview_extra_cmake_options
    "-DPARAVIEW_BUILD_ID:STRING=${PARAVIEW_BUILD_ID}")
endif ()

Ben Boeckel's avatar
Ben Boeckel committed
170
superbuild_add_project(paraview
Ben Boeckel's avatar
Ben Boeckel committed
171
  DEBUGGABLE
Ben Boeckel's avatar
Ben Boeckel committed
172
  DEFAULT_ON
173
  DEPENDS cxx11
Ben Boeckel's avatar
Ben Boeckel committed
174
  DEPENDS_OPTIONAL
175
    adios2 cuda boost fortran gdal hdf5 matplotlib mpi numpy png protobuf
Caitlin Ross's avatar
Caitlin Ross committed
176
    python python3 qt5 visitbridge zlib silo las lookingglass fides
177
    xdmf3 vrpn vtkm netcdf
178
    openpmd
179
    nlohmannjson
180
181
    paraviewgettingstartedguide
    paraviewtutorialdata paraviewweb
Ben Boeckel's avatar
Ben Boeckel committed
182
    ${paraview_all_plugins}
183
    ${paraviews_platform_dependencies}
184
    ${paraview_tbb_dependencies}
Ben Boeckel's avatar
Ben Boeckel committed
185
186
187
    ${PARAVIEW_EXTERNAL_PROJECTS}

  CMAKE_ARGS
188
    -DCMAKE_INSTALL_LIBDIR:PATH=lib
189
    -DCMAKE_INSTALL_NAME_DIR:PATH=<INSTALL_DIR>/lib
190
    -DCMAKE_MACOSX_RPATH:BOOL=OFF
191
192
193
194
    -DHDF5_NO_FIND_PACKAGE_CONFIG_FILE:BOOL=ON
    -DPARAVIEW_BUILD_LEGACY_REMOVE:BOOL=ON
    -DPARAVIEW_BUILD_SHARED_LIBS:BOOL=${paraview_build_shared_libs}
    -DPARAVIEW_BUILD_TESTING:BOOL=OFF
195
    -DPARAVIEW_BUILD_EDITION:STRING=${PARAVIEW_BUILD_EDITION}
196
    -DPARAVIEW_ENABLE_ADIOS2:BOOL=${adios2_enabled}
Ben Boeckel's avatar
Ben Boeckel committed
197
    -DPARAVIEW_ENABLE_COSMOTOOLS:BOOL=${cosmotools_enabled}
198
    -DPARAVIEW_ENABLE_FFMPEG:BOOL=${ffmpeg_enabled}
Caitlin Ross's avatar
Caitlin Ross committed
199
    -DPARAVIEW_ENABLE_FIDES:BOOL=${fides_enabled}
Joachim Pouderoux's avatar
Joachim Pouderoux committed
200
    -DPARAVIEW_ENABLE_GDAL:BOOL=${gdal_enabled}
201
    -DPARAVIEW_ENABLE_LAS:BOOL=${las_enabled}
202
    -DPARAVIEW_ENABLE_LOOKINGGLASS:BOOL=${lookingglass_enabled}
203
    -DPARAVIEW_ENABLE_MOTIONFX:BOOL=${PARAVIEW_ENABLE_MOTIONFX}
Utkarsh Ayachit's avatar
Utkarsh Ayachit committed
204
    -DPARAVIEW_ENABLE_VISITBRIDGE:BOOL=${visitbridge_enabled}
205
    -DPARAVIEW_ENABLE_XDMF3:BOOL=${xdmf3_enabled}
206
    -DPARAVIEW_INSTALL_DEVELOPMENT_FILES:BOOL=ON
Mathieu Westphal's avatar
Mathieu Westphal committed
207
    -DPARAVIEW_PLUGIN_ENABLE_GmshIO:BOOL=${gmsh_enabled}
208
    -DPARAVIEW_PLUGIN_ENABLE_LookingGlass:BOOL=${lookingglass_enabled}
209
    -DPARAVIEW_PLUGIN_ENABLE_OpenVR:BOOL=${openvr_enabled}
210
211
    # No netcdftime module in the package.
    -DPARAVIEW_PLUGIN_ENABLE_NetCDFTimeAnnotationPlugin:BOOL=OFF
212
213
    -DPARAVIEW_PYTHON_VERSION:STRING=${python_version}
    -DPARAVIEW_USE_MPI:BOOL=${mpi_enabled}
214
    -DPARAVIEW_USE_FORTRAN:BOOL=${fortran_enabled}
215
216
    -DPARAVIEW_USE_PYTHON:BOOL=${PARAVIEW_USE_PYTHON}
    -DPARAVIEW_USE_QT:BOOL=${qt5_enabled}
217
218
    -DVISIT_BUILD_READER_Mili:BOOL=${mili_enabled}
    -DVISIT_BUILD_READER_Silo:BOOL=${silo_enabled}
219
    -DVTK_DEFAULT_RENDER_WINDOW_OFFSCREEN:BOOL=${osmesa_enabled}
220
    -DVTK_MODULE_USE_EXTERNAL_ParaView_protobuf:BOOL=${protobuf_enabled}
221
    -DVTK_MODULE_USE_EXTERNAL_VTK_expat:BOOL=${expat_enabled}
Utkarsh Ayachit's avatar
Utkarsh Ayachit committed
222
223
224
    -DVTK_MODULE_USE_EXTERNAL_VTK_freetype:BOOL=${freetype_enabled}
    -DVTK_MODULE_USE_EXTERNAL_VTK_hdf5:BOOL=${hdf5_enabled}
    -DVTK_MODULE_USE_EXTERNAL_VTK_libxml2:BOOL=${libxml2_enabled}
225
    -DVTK_MODULE_USE_EXTERNAL_VTK_netcdf:BOOL=${netcdf_enabled}
Utkarsh Ayachit's avatar
Utkarsh Ayachit committed
226
227
    -DVTK_MODULE_USE_EXTERNAL_VTK_png:BOOL=${png_enabled}
    -DVTK_MODULE_USE_EXTERNAL_VTK_zlib:BOOL=${zlib_enabled}
228
    -DVTK_OPENGL_HAS_EGL:BOOL=${egl_enabled}
229
    -DVTK_OPENGL_HAS_OSMESA:BOOL=${osmesa_enabled}
230
    -DVTK_SMP_IMPLEMENTATION_TYPE:STRING=${paraview_smp_backend}
231
    -DVTK_USE_X:BOOL=${paraview_use_x}
Ben Boeckel's avatar
Ben Boeckel committed
232

233
    # raytracing flags
234
    -DPARAVIEW_ENABLE_RAYTRACING:BOOL=${paraview_use_raytracing}
235
236
237
238
    -DVTKOSPRAY_ENABLE_DENOISER:BOOL=${openimagedenoise_enabled}
    -DVTK_ENABLE_OSPRAY:BOOL=${ospray_enabled}
    -DVTK_ENABLE_VISRTX:BOOL=${visrtx_enabled}

239
    # IndeX
Utkarsh Ayachit's avatar
Utkarsh Ayachit committed
240
    -DPARAVIEW_PLUGIN_ENABLE_pvNVIDIAIndeX:BOOL=${nvidiaindex_enabled}
241

Ben Boeckel's avatar
Ben Boeckel committed
242
    # vrpn
243
    -DPARAVIEW_PLUGIN_ENABLE_VRPlugin:BOOL=${PARAVIEW_ENABLE_VRPLUGIN}
Utkarsh Ayachit's avatar
Utkarsh Ayachit committed
244
    -DPARAVIEW_PLUGIN_VRPlugin_USE_VRPN:BOOL=${vrpn_enabled}
Ben Boeckel's avatar
Ben Boeckel committed
245

Robert Maynard's avatar
Robert Maynard committed
246
    # vtkm
Utkarsh Ayachit's avatar
Utkarsh Ayachit committed
247
    -DPARAVIEW_PLUGIN_ENABLE_VTKmFilters:BOOL=${vtkm_enabled}
Robert Maynard's avatar
Robert Maynard committed
248
    -DPARAVIEW_USE_VTKM:BOOL=${vtkm_enabled}
Utkarsh Ayachit's avatar
Utkarsh Ayachit committed
249
    -DVTK_VTKM_ENABLE_CUDA:BOOL=${paraview_enable_cuda}
Robert Maynard's avatar
Robert Maynard committed
250

251
    # Web
Ben Boeckel's avatar
Ben Boeckel committed
252
    -DPARAVIEW_ENABLE_WEB:BOOL=${paraviewweb_enabled}
Ben Boeckel's avatar
Ben Boeckel committed
253

254
255
256
    # Readers
    -DVTK_MODULE_ENABLE_VTK_IOSegY:STRING=YES

257
258
259
    # ParFlow
    -DPARAVIEW_PLUGIN_ENABLE_ParFlow:BOOL=${nlohmannjson_enabled}

Ben Boeckel's avatar
Ben Boeckel committed
260
261
262
263
    ${paraview_extra_cmake_options}

    ${PARAVIEW_EXTRA_CMAKE_ARGUMENTS})

264
if (paraview_SOURCE_SELECTION STREQUAL "5.3.0")
265
266
  superbuild_apply_patch(paraview fix-benchmarks
    "Fix various issues with the shipped benchmark scripts")
267
268
  superbuild_apply_patch(paraview fix-vtkconfig-part1
    "Fix various issues with the VTKConfig.cmake (Part 1)")
269
endif ()
Ben Boeckel's avatar
Ben Boeckel committed
270

271
272
273
274
275
if (paraview_SOURCE_SELECTION STREQUAL "5.5.0")
  superbuild_apply_patch(paraview fix-mpi4py
    "Fix issue with building VTK's mpi4py")
endif ()

276
277
278
if (paraview_SOURCE_SELECTION STREQUAL "5.6.0")
  superbuild_apply_patch(paraview fix-catalyst-adapter-deps
    "Fix issue with catalyst adapters and dependency search")
279
280
  superbuild_apply_patch(paraview fix-eye-dome-lighting
    "Fix eye dome lighting in parallel")
281
282
endif ()

Dan Lipsa's avatar
Dan Lipsa committed
283
284
285
286
if (WIN32 AND las_enabled)
  superbuild_append_flags(cxx_flags "-DBOOST_ALL_NO_LIB" PROJECT_ONLY)
endif()

Utkarsh Ayachit's avatar
Utkarsh Ayachit committed
287
288
289
290
if (ospray_enabled AND tbb_enabled)
  superbuild_add_extra_cmake_args(
    -DTBB_ROOT:PATH=<INSTALL_DIR>)
endif()