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

set (paraview_extra_cmake_options)
6
if (manta_enabled AND TARGET manta)
Ben Boeckel's avatar
Ben Boeckel committed
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  set(manta_binary_dir "<BINARY_DIR>")
  _ep_replace_location_tags(manta manta_binary_dir)

  list(APPEND paraview_extra_cmake_options
    -DMANTA_BUILD:PATH=${manta_binary_dir})
endif ()

if (PV_NIGHTLY_SUFFIX)
  list(APPEND paraview_extra_cmake_options
    -DPV_NIGHTLY_SUFFIX:STRING=${PV_NIGHTLY_SUFFIX})
endif ()

set(paraview_install_development_files FALSE)
if (paraviewsdk_enabled)
  set(paraview_install_development_files TRUE)
endif ()

24
25
# Without an offscreen rendering backend, X should be used.
set(paraview_use_x ON)
26
if (WIN32 OR APPLE OR osmesa_enabled OR egl_enabled)
27
  set(paraview_use_x OFF)
Ben Boeckel's avatar
Ben Boeckel committed
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
endif ()

set(paraview_use_qt OFF)
if (qt4_enabled OR qt5_enabled)
  set(paraview_use_qt ON)
endif ()

set(PARAVIEW_RENDERING_BACKEND "OpenGL2"
  CACHE STRING "Rendering backend to use for ParaView")
set_property(CACHE PARAVIEW_RENDERING_BACKEND
  PROPERTY
    STRINGS "OpenGL;OpenGL2")

option(PARAVIEW_BUILD_WEB_DOCUMENTATION "Build documentation for the web" OFF)

get_property(paraview_plugins GLOBAL
  PROPERTY paraview_plugins)

set(paraview_plugin_dirs)
foreach (paraview_plugin IN LISTS paraview_plugins)
48
  if (${paraview_plugin}_enabled AND TARGET "${paraview_plugin}")
Ben Boeckel's avatar
Ben Boeckel committed
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
    set(plugin_source_dir "<SOURCE_DIR>")
    _ep_replace_location_tags("${paraview_plugin}" plugin_source_dir)
    list(APPEND paraview_plugin_dirs
      "${plugin_source_dir}")
  endif ()
endforeach ()
string(REPLACE ";" "${_superbuild_list_separator}" paraview_plugin_dirs "${paraview_plugin_dirs}")

if (NOT CMAKE_CONFIGURATION_TYPES AND NOT WIN32)
  set(PARAVIEW_BUILD_TYPE ""
    CACHE STRING "ParaView's build mode")
  mark_as_advanced(PARAVIEW_BUILD_TYPE)
  if (NOT PARAVIEW_BUILD_TYPE)
    set(PARAVIEW_BUILD_TYPE "${CMAKE_BUILD_TYPE}")
  endif ()

  set(CMAKE_BUILD_TYPE_save "${CMAKE_BUILD_TYPE}")
  set(CMAKE_BUILD_TYPE "${PARAVIEW_BUILD_TYPE}")
endif ()

set(paraview_smp_backend "Sequential")
if (tbb_enabled)
  set(paraview_smp_backend "TBB")
endif ()

set(PARAVIEW_EXTERNAL_PROJECTS ""
  CACHE STRING "A list of projects for ParaView to depend on")
mark_as_advanced(PARAVIEW_EXTERNAL_PROJECTS)

78
option(PARAVIEW_FREEZE_PYTHON "Freeze Python packages and modules into the application" OFF)
Ben Boeckel's avatar
Ben Boeckel committed
79

80
81
82
83
84
85
86
set(paraviews_platform_dependencies)
if (UNIX)
  if (NOT APPLE)
    list(APPEND paraviews_platform_dependencies
      mesa osmesa egl)
  endif ()
  list(APPEND paraviews_platform_dependencies
87
    adios ffmpeg libxml2 freetype
88
89

    # For cosmotools
90
    genericio cosmotools)
91
92
93
94
95
endif ()

if (NOT APPLE)
  list(APPEND paraviews_platform_dependencies
    manta)
96
97
endif ()

Ben Boeckel's avatar
Ben Boeckel committed
98
superbuild_add_project(paraview
Ben Boeckel's avatar
Ben Boeckel committed
99
  DEBUGGABLE
Ben Boeckel's avatar
Ben Boeckel committed
100
101
  DEFAULT_ON
  DEPENDS_OPTIONAL
102
    boost hdf5 matplotlib mpi numpy png
103
104
    python qt4 qt5 visitbridge zlib silo cgns
    xdmf3 ospray vrpn tbb netcdf
Ben Boeckel's avatar
Ben Boeckel committed
105
    paraviewusersguide paraviewgettingstartedguide
106
    paraviewtutorial paraviewtutorialdata paraviewweb
Ben Boeckel's avatar
Ben Boeckel committed
107
    ${paraview_plugins}
108
    ${paraviews_platform_dependencies}
Ben Boeckel's avatar
Ben Boeckel committed
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
    ${PARAVIEW_EXTERNAL_PROJECTS}

  CMAKE_ARGS
    -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
    -DBUILD_TESTING:BOOL=OFF
    -DPARAVIEW_BUILD_PLUGIN_CoProcessingScriptGenerator:BOOL=ON
    -DPARAVIEW_BUILD_PLUGIN_EyeDomeLighting:BOOL=ON
    -DPARAVIEW_BUILD_PLUGIN_MantaView:BOOL=${manta_enabled}
    -DPARAVIEW_BUILD_QT_GUI:BOOL=${paraview_use_qt}
    -DPARAVIEW_ENABLE_FFMPEG:BOOL=${ffmpeg_enabled}
    -DPARAVIEW_ENABLE_PYTHON:BOOL=${python_enabled}
    -DPARAVIEW_ENABLE_COSMOTOOLS:BOOL=${cosmotools_enabled}
    -DPARAVIEW_ENABLE_XDMF3:BOOL=${xdmf3_enabled}
    -DPARAVIEW_USE_MPI:BOOL=${mpi_enabled}
    -DPARAVIEW_USE_OSPRAY:BOOL=${ospray_enabled}
    -DPARAVIEW_USE_VISITBRIDGE:BOOL=${visitbridge_enabled}
    -DVISIT_BUILD_READER_CGNS:BOOL=OFF # force to off
    -DPARAVIEW_ENABLE_CGNS:BOOL=${cgns_enabled}
    -DVISIT_BUILD_READER_Silo:BOOL=${silo_enabled}
    -DPARAVIEW_INSTALL_DEVELOPMENT_FILES:BOOL=${paraview_install_development_files}
    -DPARAVIEW_ENABLE_MATPLOTLIB:BOOL=${matplotlib_enabled}
    -DPARAVIEW_FREEZE_PYTHON:BOOL=${PARAVIEW_FREEZE_PYTHON}
    -DVTK_USE_SYSTEM_NETCDF:BOOL=${netcdf_enabled}
    -DVTK_USE_SYSTEM_FREETYPE:BOOL=${freetype_enabled}
    -DVTK_USE_SYSTEM_HDF5:BOOL=${hdf5_enabled}
    -DVTK_USE_SYSTEM_LIBXML2:BOOL=${libxml2_enabled}
    -DVTK_USE_SYSTEM_PNG:BOOL=${png_enabled}
    -DVTK_USE_SYSTEM_ZLIB:BOOL=${zlib_enabled}
    -DModule_vtkIOADIOS:BOOL=${adios_enabled}
    -DVTK_RENDERING_BACKEND:STRING=${PARAVIEW_RENDERING_BACKEND}
    -DVTK_SMP_IMPLEMENTATION_TYPE:STRING=${paraview_smp_backend}
    -DVTK_LEGACY_SILENT:BOOL=ON
141
142
143
144
    -DVTK_USE_OSMESA:BOOL=${osmesa_enabled}
    -DVTK_USE_OFFSCREEN:BOOL=${osmesa_enabled}
    -DVTK_USE_OFFSCREEN_EGL:BOOL=${egl_enabled}
    -DVTK_USE_X:BOOL=${paraview_use_x}
Ben Boeckel's avatar
Ben Boeckel committed
145
146
147
148
149

    # vrpn
    -DPARAVIEW_BUILD_PLUGIN_VRPlugin:BOOL=${vrpn_enabled}
    -DPARAVIEW_USE_VRPN:BOOL=${vrpn_enabled}

150
    # Web
Ben Boeckel's avatar
Ben Boeckel committed
151
    -DPARAVIEW_ENABLE_WEB:BOOL=${paraviewweb_enabled}
Ben Boeckel's avatar
Ben Boeckel committed
152
153
154
155
156
157
158
159
160
161
162
163
164
    -DPARAVIEW_BUILD_WEB_DOCUMENTATION:BOOL=${PARAVIEW_BUILD_WEB_DOCUMENTATION}

    # specify the apple app install prefix. No harm in specifying it for all
    # platforms.
    -DMACOSX_APP_INSTALL_PREFIX:PATH=<INSTALL_DIR>/Applications

    # add additional plugin directories
    -DPARAVIEW_EXTERNAL_PLUGIN_DIRS:STRING=${paraview_plugin_dirs}

    ${paraview_extra_cmake_options}

    ${PARAVIEW_EXTRA_CMAKE_ARGUMENTS})

Chuck Atkins's avatar
Chuck Atkins committed
165
166
167
168
169
if (NOT paraview_FROM_GIT AND adios_enabled)
  superbuild_apply_patch(paraview adios-wrapping
    "Fix broken python wrapping for ADIOS")
endif ()

Ben Boeckel's avatar
Ben Boeckel committed
170
171
172
if (DEFINED CMAKE_BUILD_TYPE_save)
  set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE_save}")
endif ()