-
Notifications
You must be signed in to change notification settings - Fork 419
/
CMakeLists.txt
551 lines (474 loc) · 18.3 KB
/
CMakeLists.txt
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
39
40
41
42
43
44
45
46
47
48
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
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
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
#-----------------------------------------------------------------------------
cmake_minimum_required(VERSION 2.8.3)
#-----------------------------------------------------------------------------
# Important: change architecture *before* any enable_language() or project()
# calls so that it's set properly to detect 64-bit-ness...
#
if(APPLE)
if(NOT CMAKE_OSX_DEPLOYMENT_TARGET OR "${CMAKE_OSX_DEPLOYMENT_TARGET}" STREQUAL "")
set(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "force build for 64-bit Leopard" FORCE)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.5" CACHE STRING "force build for 64-bit Leopard" FORCE)
set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.6.sdk" CACHE PATH "force build for 64-bit Leopard" FORCE)
endif()
set(pv_apple_compiler_args
-DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES}
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${CMAKE_OSX_DEPLOYMENT_TARGET}
-DCMAKE_OSX_SYSROOT:PATH=${CMAKE_OSX_SYSROOT})
if(NOT "${CMAKE_OSX_SYSROOT}" STREQUAL "")
if(NOT EXISTS "${CMAKE_OSX_SYSROOT}")
message(FATAL_ERROR "error: CMAKE_OSX_SYSROOT='${CMAKE_OSX_SYSROOT}' does not exist")
endif()
endif()
if(APPLE)
set(paraview_osx_flags "-arch x86_64 -mmacosx-version-min=@CMAKE_OSX_DEPLOYMENT_TARGET@ -isysroot @CMAKE_OSX_SYSROOT@")
endif()
endif()
project(ParaViewSuperBuild)
set(ParaViewSuperBuild_CMAKE_SOURCE_DIR ${ParaViewSuperBuild_SOURCE_DIR})
set(ParaViewSuperBuild_CMAKE_BINARY_DIR ${ParaViewSuperBuild_BINARY_DIR}/CMake)
#------------------------------------------------------------------------------
# Update CMake module path
#------------------------------------------------------------------------------
set(CMAKE_MODULE_PATH
${ParaViewSuperBuild_CMAKE_SOURCE_DIR}
${ParaViewSuperBuild_CMAKE_BINARY_DIR}
${CMAKE_MODULE_PATH}
)
#------------------------------------------------------------------------------
# Configure Common environment file
#------------------------------------------------------------------------------
configure_file(${ParaViewSuperBuild_CMAKE_SOURCE_DIR}/paraview_common_environment.cmake.in
${ParaViewSuperBuild_CMAKE_BINARY_DIR}/paraview_common_environment.cmake @ONLY)
#-----------------------------------------------------------------------------
# Enable and setup External project global properties
#-----------------------------------------------------------------------------
include(ExternalProject)
#-----------------------------------------------------------------------------
# Git protocol option
#-----------------------------------------------------------------------------
option(GIT_USE_GIT_PROTOCOL "If behind a firewall turn this off to use http instead." ON)
set(ENABLE_YT OFF CACHE BOOL "Install yt for astrophysics analysis")
set(git_protocol "git")
if(NOT Slicer_USE_GIT_PROTOCOL)
set(git_protocol "http")
endif()
#-----------------------------------------------------------------------------
# Qt - Let's check if a valid version of Qt is available
#-----------------------------------------------------------------------------
FIND_PACKAGE(Qt4)
if(QT_FOUND)
#IF("${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}" VERSION_LESS "${minimum_required_qt_version}")
# message(FATAL_ERROR "error: Slicer requires Qt >= ${minimum_required_qt_version} -- you cannot use Qt ${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}.")
#ENDIF()
else()
#message(FATAL_ERROR "error: Qt4 was not found on your system. Please set QT_QMAKE_EXECUTABLE")
endif()
# ----------------------------------------------------------------------------
# generic compiler args (compiler and cflags) to pass to subprojects
#-----------------------------------------------------------------------------
set(pv_compiler_args
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
-DCMAKE_CXX_FLAGS_DEBUG:STRING=${CMAKE_CXX_FLAGS_DEBUG}
-DCMAKE_CXX_FLAGS_MINSIZEREL:STRING=${CMAKE_CXX_FLAGS_MINSIZEREL}
-DCMAKE_CXX_FLAGS_RELEASE:STRING=${CMAKE_CXX_FLAGS_RELEASE}
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=${CMAKE_CXX_FLAGS_RELWITHDEBINFO}
-DCMAKE_C_FLAGS_DEBUG:STRING=${CMAKE_C_FLAGS_DEBUG}
-DCMAKE_C_FLAGS_MINSIZEREL:STRING=${CMAKE_C_FLAGS_MINSIZEREL}
-DCMAKE_C_FLAGS_RELEASE:STRING=${CMAKE_C_FLAGS_RELEASE}
-DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING=${CMAKE_C_FLAGS_RELWITHDEBINFO}
-DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS}
-DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_SHARED_LINKER_FLAGS}
)
set(pv_tpl_cxx_flags ${CMAKE_CXX_FLAGS})
set(pv_tpl_c_flags ${CMAKE_C_FLAGS})
if(WIN32)
set(pv_cxx_flags ${CMAKE_CXX_FLAGS})
set(pv_c_flags ${CMAKE_C_FLAGS})
else()
set(pv_cxx_flags "${CMAKE_CXX_FLAGS} -L${ParaViewSuperBuild_CMAKE_BINARY_DIR}/lib -I${ParaViewSuperBuild_CMAKE_BINARY_DIR}/include")
set(pv_c_flags "${CMAKE_C_FLAGS} -L${ParaViewSuperBuild_CMAKE_BINARY_DIR}/lib -I${ParaViewSuperBuild_CMAKE_BINARY_DIR}/include")
endif()
if(WIN32)
list(APPEND pv_compiler_args -DCMAKE_BUILD_TYPE:STRING=${CMAKE_CFG_INTDIR})
else()
list(APPEND pv_compiler_args -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE})
endif()
if(APPLE)
list(APPEND pv_compiler_args ${pv_apple_compiler_args})
endif()
# We aren't interested in seeing third party compiler warnings.
set(pv_tpl_compiler_args ${pv_compiler_args})
string(REPLACE "/W3" "/W0" pv_tpl_cxx_flags "${pv_tpl_cxx_flags}")
string(REPLACE "/W4" "/W0" pv_tpl_cxx_flags "${pv_tpl_cxx_flags}")
string(REPLACE "/W3" "/W0" pv_tpl_c_flags "${pv_tpl_c_flags}")
string(REPLACE "/W4" "/W0" pv_tpl_c_flags "${pv_tpl_c_flags}")
if(WIN32)
set(_LINK_LIBRARY_SUFFIX .lib)
elseif(APPLE)
set(_LINK_LIBRARY_SUFFIX .dylib)
else()
set(_LINK_LIBRARY_SUFFIX .so)
endif()
# Attempt to detect if we have a Fortran Compiler available.
include(CheckFortran)
#------------------------------------------------------------------------------
configure_file(${ParaViewSuperBuild_SOURCE_DIR}/CTestCustom.ctest.in
${ParaViewSuperBuild_BINARY_DIR}/CTestCustom.ctest @ONLY)
#------------------------------------------------------------------------------
# Establish Target Dependencies based on Selected Options
#------------------------------------------------------------------------------
include(PackageVersions)
set(python_dependencies)
set(CLAPACK_dependencies)
set(NUMPY_dependencies)
set(MPL_dependencies)
set(Cython_dependencies)
set(h5py_dependencies)
set(Manta_dependencies)
set(OpenMPI_dependencies)
set(ParaView_dependencies)
set(PARAVIEW_FIXUP_BUNDLE_SEARCH_PATHS)
set(PARAVIEW_EXTERNAL_PLUGIN_DIRS)
set(MPI_ARGS)
# Build a common zlib used by several dependencies
include(External_zlib)
set(ZLIB_ARGS
-DVTK_USE_SYSTEM_ZLIB:BOOL=ON
-DZLIB_INCLUDE_DIR:PATH=${ZLIB_INCLUDE_DIR}
-DZLIB_LIBRARY:FILEPATH=${ZLIB_LIBRARY})
list(APPEND ParaView_dependencies zlib)
list(APPEND png_dependencies zlib)
list(APPEND python_dependencies zlib)
# Build a common szip used by several dependencies
include(External_szip)
#set(SZIP_ARGS
# -DVTK_USE_SYSTEM_ZLIB:BOOL=ON
# -DZLIB_INCLUDE_DIR:PATH=${ZLIB_INCLUDE_DIR}
# -DZLIB_LIBRARY:FILEPATH=${ZLIB_LIBRARY})
# Build a common png used by several dependencies
include(External_png)
# can't get paraview to build SMExtractDocumentation with externally built png
# until then ParaView will still use the system png.
set(PNG_ARGS
-DVTK_USE_SYSTEM_PNG:BOOL=ON
-DPNG_PNG_INCLUDE_DIR:PATH=${PNG_INCLUDE_DIR}
-DPNG_LIBRARY:FILEPATH=${PNG_LIBRARY})
list(APPEND ParaView_dependencies png)
if(WIN32)
list(APPEND PARAVIEW_FIXUP_BUNDLE_SEARCH_PATHS ${png_install}/bin)
else()
get_filename_component(PNG_DIR "${PNG_LIBRARY}" PATH)
list(APPEND PARAVIEW_FIXUP_BUNDLE_SEARCH_PATHS ${PNG_DIR})
endif()
if(NOT APPLE)
if(WIN32)
include(External_OpenMPI)
list(APPEND ParaView_dependencies OpenMPI)
else()
include(External_MPICH2)
list(APPEND ParaView_dependencies MPICH2)
endif()
set(MPI_ARGS
-DMPI_DIR:PATH=${MPI_INSTALL}
-DPARAVIEW_USE_MPI:BOOL=ON
-DMPIEXEC:FILEPATH=${MPIEXEC}
-DVTK_MPIRUN_EXE:FILEPATH=${MPIEXEC}
-DMPI_INCLUDE_PATH:PATH=${MPI_INCLUDE_PATH}
-DMPI_LIBRARY:FILEPATH=${MPI_LIBRARY}
-DMPI_EXTRA_LIBRARY:FILEPATH=${MPI_EXTRA_LIBRARY}
-DPARAVIEW_INSTALL_MPIEXEC:BOOL=ON)
include(External_Python)
list(APPEND ParaView_depenencies Python)
set(NUMPY_dependencies python)
if(CMAKE_Fortran_COMPILER AND NOT WIN32 AND NOT UNIX)
include(External_LAPACK)
list(APPEND NUMPY_dependencies LAPACK)
list(APPEND ParaView_dependencies LAPACK)
else()
include(External_CLAPACK)
list(APPEND NUMPY_dependencies CLAPACK)
list(APPEND ParaView_dependencies CLAPACK)
endif()
include(External_NUMPY)
else()
find_package(PythonInterp)
find_package(PythonLibs)
if(APPLE AND "${CMAKE_OSX_DEPLOYMENT_TARGET}" STREQUAL "10.5")
set(PYTHON_EXECUTABLE "/System/Library/Frameworks/Python.framework/Versions/2.5/bin/python" CACHE FILEPATH "" FORCE)
set(PYTHON_LIBRARY "/System/Library/Frameworks/Python.framework/Versions/2.5/Python" CACHE PATH "" FORCE)
set(PYTHON_INCLUDE_DIR "/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5" CACHE FILEPATH "" FORCE)
endif()
#find_package(MPI)
#set(MPI_ARGS
# -DPARAVIEW_USE_MPI:BOOL=OFF
# -DMPI_DIR:PATH=${MPI_INSTALL}
# -DMPIEXEC:FILEPATH=${MPIEXEC}
# -DVTK_MPIRUN_EXE:FILEPATH=${MPIEXEC}
# -DMPI_INCLUDE_PATH:PATH=${MPI_INCLUDE_PATH}
# -DMPI_LIBRARY:FILEPATH=${MPI_LIBRARY}
# -DMPI_EXTRA_LIBRARY:FILEPATH=${MPI_EXTRA_LIBRARY}
# -DPARAVIEW_INSTALL_MPIEXEC:BOOL=ON)
include(External_NUMPY)
endif()
set(MANTA_ARGS)
# Manta doesn't compile on Windows x64 currently
#if(NOT (WIN32 AND "${CMAKE_SIZEOF_VOID_P}" EQUAL 8))
if(NOT WIN32)
include(External_Manta)
set(MANTA_ARGS
-DPARAVIEW_BUILD_PLUGIN_Manta:BOOL=ON
-DMANTA_BUILD:PATH=${Manta_binary}
-DMANTA_SOURCE:PATH=${Manta_source})
list(APPEND ParaView_dependencies Manta)
endif()
include(External_Boost)
list(APPEND ParaView_dependencies Boost)
if(WIN32)
list(APPEND PARAVIEW_FIXUP_BUNDLE_SEARCH_PATHS ${zlib_install}/bin)
else()
get_filename_component(ZLIB_DIR "${ZLIB_LIBRARY}" PATH)
list(APPEND PARAVIEW_FIXUP_BUNDLE_SEARCH_PATHS ${ZLIB_DIR})
endif()
# Build HDF5
list(APPEND HDF5_dependencies zlib szip)
list(APPEND ParaView_dependencies HDF5)
include(External_HDF5)
set(HDF5_ARGS
-DVTK_USE_SYSTEM_HDF5:BOOL=ON
-DHDF5_DIR:PATH=${HDF5_install}
-DHDF5_FOUND:BOOL=ON
-DHDF5_INCLUDE_DIRS:PATH=${HDF5_INCLUDE_DIR}
-DHDF5_INCLUDE_DIR:PATH=${HDF5_INCLUDE_DIR}
-DHDF5_LIBRARIES:FILEPATH=${HDF5_LIBRARY}
-DHDF5_LIBRARY:FILEPATH=${HDF5_LIBRARY}
-DHDF5_hdf5_LIBRARY:FILEPATH=${HDF5_LIBRARY}
-DHDF5_hdf5_LIBRARY_RELEASE:FILEPATH=${HDF5_LIBRARY})
if(WIN32)
list(APPEND PARAVIEW_FIXUP_BUNDLE_SEARCH_PATHS ${HDF5_install}/bin)
else()
get_filename_component(HDF5_DIR "${HDF5_LIBRARY}" PATH)
list(APPEND PARAVIEW_FIXUP_BUNDLE_SEARCH_PATHS ${HDF5_DIR})
endif()
set(freetype_dependencies zlib)
list(APPEND ParaView_dependencies freetype)
include(External_freetype)
set(freetype_ARGS
-DVKT_USE_SYSTEM_FREETYPE:BOOL=ON
-DFREETYPE_INCLUDE_DIR_freetype2:PATH=${FT_INCLUDE_DIR}/freetype
-DFREETYPE_INCLUDE_DIR_ft2build:PATH=${FT_INCLUDE_DIR}
-DFREETYPE_LIBRARY:FILEPATH=${FT_LIBRARY}
)
if(WIN32)
list(APPEND PARAVIEW_FIXUP_BUNDLE_SEARCH_PATHS ${freetype_install}/bin)
else()
get_filename_component(FT_DIR "${FT_LIBRARY}" PATH)
list(APPEND PARAVIEW_FIXUP_BUNDLE_SEARCH_PATHS ${FT_DIR})
endif()
if(ENABLE_YT)
set(MPL_dependencies NUMPY zlib)
list(APPEND MPL_dependencies freetype png)
include(External_MPL)
set(Cython_dependencies NUMPY)
include(External_Cython)
set(h5py_dependencies NUMPY HDF5 Cython)
include(External_h5py)
set(yt_dependencies NUMPY HDF5 MPL h5py)
if(NOT APPLE)
set(distribute_dependencies PYTHON)
include(External_distribute)
list(APPEND yt_dependencies distribute)
endif()
include(External_yt)
list(APPEND ParaView_dependencies yt)
endif()
# Build Silo
list(APPEND Silo_dependencies zlib HDF5)
list(APPEND ParaView_dependencies Silo)
include(External_Silo)
set(Silo_ARGS
-DVISIT_BUILD_READER_Silo:BOOL=ON
-DSILO_INCLUDE_DIR:PATH=${SILO_INCLUDE_DIR}
-DSILO_LIBRARY:FILEPATH=${SILO_LIBRARY})
if(WIN32)
list(APPEND PARAVIEW_FIXUP_BUNDLE_SEARCH_PATHS ${Silo_install}/bin)
else()
get_filename_component(SILO_DIR "${SILO_LIBRARY}" PATH)
list(APPEND PARAVIEW_FIXUP_BUNDLE_SEARCH_PATHS ${SILO_DIR})
endif()
# Build CGNS
list(APPEND CGNS_dependencies zlib HDF5)
list(APPEND ParaView_dependencies CGNS)
include(External_CGNS)
set(CGNS_ARGS
-DVISIT_BUILD_READER_CGNS:BOOL=ON
-DCGNS_INCLUDE_DIR:PATH=${CGNS_INCLUDE_DIR}
-DCGNS_LIBRARY:FILEPATH=${CGNS_LIBRARY})
if(WIN32)
list(APPEND PARAVIEW_FIXUP_BUNDLE_SEARCH_PATHS ${CGNS_install}/lib)
else()
get_filename_component(CGNS_DIR "${CGNS_LIBRARY}" PATH)
list(APPEND PARAVIEW_FIXUP_BUNDLE_SEARCH_PATHS ${CGNS_DIR})
endif()
if(NOT WIN32)
include(External_FFMPEG)
set(FFMPEG_ARGS
-DVTK_USE_FFMPEG_ENCODER:BOOL=ON
-DFFMPEG_INCLUDE_DIR:PATH=${FFMPEG_INCLUDE_DIR}
-DFFMPEG_avcodec_LIBRARY:FILEPATH=${FFMPEG_avcodec_LIBRARY}
-DFFMPEG_avformat_LIBRARY:FILEPATH=${FFMPEG_avformat_LIBRARY}
-DFFMPEG_avutil_LIBRARY:FILEPATH=${FFMPEG_avutil_LIBRARY}
-DFFMPEG_swscale_LIBRARY:FILEPATH=${FFMPEG_swscale_LIBRARY})
list(APPEND ParaView_dependencies FFMPEG)
endif()
# Build VRPN
list(APPEND ParaView_dependencies VRPN)
include(External_VRPN)
set(VRPN_ARGS
-DPARAVIEW_BUILD_PLUGIN_VRPNPlugin:BOOL=ON
-DVRPN_LIBRARY:FILE_PATH=${VRPN_LIBRARY}
-DVRPN_INCLUDE_DIR:PATH=${VRPN_INCLUDE_DIR})
if(WIN32)
list(APPEND PARAVIEW_FIXUP_BUNDLE_SEARCH_PATHS ${VRPN_install}/lib)
else()
get_filename_component(VRPN_DIR "${VRPN_LIBRARY}" PATH)
list(APPEND PARAVIEW_FIXUP_BUNDLE_SEARCH_PATHS ${VRPN_DIR})
endif()
# Build AcuSolveReaderPlugin
if(NOT APPLE)
option(PARAVIEW_BUILD_PLUGIN_AcuSolveReader "Build AcuSolveReader Plugin" FALSE)
set(AcuSolve_ARGS)
if(PARAVIEW_BUILD_PLUGIN_AcuSolveReader)
list(APPEND ParaView_dependencies AcuSolveReaderPlugin)
include(External_AcuSolveReaderPlugin)
set(AcuSolve_ARGS
-DPARAVIEW_BUILD_PLUGIN_AcuSolveReader:BOOL=ON
)
list(APPEND PARAVIEW_EXTERNAL_PLUGIN_DIRS ${AcuSolveReaderPlugin_source})
else()
set(AcuSolve_ARGS
-DPARAVIEW_BUILD_PLUGIN_AcuSolveReader:BOOL=OFF
)
endif()
endif()
# Build VisTrailsPlugin
option(PARAVIEW_BUILD_PLUGIN_VisTrails "Build VisTrails Plugin" FALSE)
set(VisTrails_ARGS)
if(PARAVIEW_BUILD_PLUGIN_VisTrails)
include(External_VisTrails)
list(APPEND ParaView_dependencies VisTrails)
set(VisTrails_ARGS
-DPARAVIEW_BUILD_PLUGIN_VisTrails:BOOL=ON
)
list(APPEND PARAVIEW_EXTERNAL_PLUGIN_DIRS ${VisTrails_source})
# Build SIP and PyQt for vistrails plugin.
#set(SIP_dependencies python)
#include(External_SIP)
#list(APPEND PyQt_dependencies SIP)
#set(PyQt_dependencies python SIP)
#include(External_PyQt)
#list(APPEND ParaView_dependencies PyQt)
else()
set(VisTrails_ARGS
-DPARAVIEW_BUILD_PLUGIN_VisTrails:BOOL=OFF
)
endif()
option(ParaView_BUILD_DOCUMENTATION "Build ParaView Documentation" FALSE)
set(DOC_ARGS)
if(ParaView_BUILD_DOCUMENTATION)
file(DOWNLOAD ${PARAVIEW_USERS_GUIDE_URL}/${PARAVIEW_USERS_GUIDE_PDF_NO_SPACES}
${CMAKE_CURRENT_BINARY_DIR}/${PARAVIEW_USERS_GUIDE_PDF}
EXPECTED_MD5 ${PARAVIEW_USERS_GUIDE_MD5})
set(DOC_ARGS
-DBUILD_DOCUMENTATION:BOOL=ON
-DPARAVIEW_GENERATE_PROXY_DOCUMENTATION:BOOL=ON
-DGENERATE_FILTERS_DOCUMENTATION:BOOL=ON
-DDOCUMENTATION_HTML_HELP:BOOL=ON
-DPARAVIEW_USERS_GUIDE:FILEPATH=${CMAKE_CURRENT_BINARY_DIR}/${PARAVIEW_USERS_GUIDE_PDF}
)
endif()
set(PARAVIEW_EXTRA_INSTALL_RULES)
# Install libz2 until we start building it ourselves.
if(UNIX AND NOT APPLE)
list(APPEND PARAVIEW_EXTRA_INSTALL_RULES ${CMAKE_CURRENT_SOURCE_DIR}/install_bz2.cmake)
endif()
# Install FORTRAN runtime
if(CMAKE_Fortran_COMPILER AND NOT WIN32)
get_filename_component(fortran_compiler ${CMAKE_Fortran_COMPILER} NAME_WE)
if("${fortran_compiler}" STREQUAL "gfortran")
set(FORTRAN_INSTALL_RULE_FILE
${CMAKE_CURRENT_SOURCE_DIR}/install_gfortran.cmake)
elseif("${fortran_compiler}" STREQUAL "g77")
set(FORTRAN_INSTALL_RULE_FILE
${CMAKE_CURRENT_SOURCE_DIR}/install_g2c.cmake)
elseif("${fortran_compiler}" STREQUAL "ifort")
#set(FORTRAN_INSTALL_RULE_FILE
# ${CMAKE_CURRENT_SOURCE_DIR}/install_g2c.cmake)
endif()
list(APPEND PARAVIEW_EXTRA_INSTALL_RULES ${FORTRAN_INSTALL_RULE_FILE})
endif()
list(REMOVE_DUPLICATES PARAVIEW_FIXUP_BUNDLE_SEARCH_PATHS)
#------------------------------------------------------------------------------
# Configure and build ParaView
#------------------------------------------------------------------------------
set(proj ParaView)
ExternalProject_Add(${proj}
DEPENDS ${ParaView_dependencies}
DOWNLOAD_COMMAND ""
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/ParaView-build
CMAKE_CACHE_ARGS
${pv_compiler_args}
-DPARAVIEW_EXTRA_INSTALL_RULES_FILE:FILEPATH=${PARAVIEW_EXTRA_INSTALL_RULES}
-DCMAKE_CXX_FLAGS:STRING=${pv_cxx_flags}
-DCMAKE_C_FLAGS:STRING=${pv_c_flags}
-DBUILD_SHARED_LIBS:BOOL=ON
-DBUILD_TESTING:BOOL=OFF
-DPARAVIEW_DISABLE_VTK_TESTING:BOOL=ON
-DPARAVIEW_TESTING_WITH_PYTHON:BOOL=OFF
-DPARAVIEW_INSTALL_THIRD_PARTY_LIBRARIES:BOOL=ON
-DPARAVIEW_FIXUP_BUNDLE_SEARCH_PATHS:STRING=${PARAVIEW_FIXUP_BUNDLE_SEARCH_PATHS}
-DPARAVIEW_EXTERNAL_PLUGIN_DIRS:STRING=${PARAVIEW_EXTERNAL_PLUGIN_DIRS}
# Boost
-DVTK_USE_BOOST:BOOL=ON
-DBoost_INCLUDE_DIR:PATH=${Boost_INCLUDE_DIR}
-DBOOST_LIBRARYDIR:PATH=${BOOST_LIBRARYDIR}
-DBOOST_ROOT:PATH=${CMAKE_CURRENT_BINARY_DIR}
# png
${PNG_ARGS}
# Python
-DPARAVIEW_ENABLE_PYTHON:BOOL=ON
-DPYTHON_EXECUTABLE:FILEPATH=${PYTHON_EXECUTABLE}
-DPYTHON_INCLUDE_DIR:PATH=${PYTHON_INCLUDE_DIR}
-DPYTHON_LIBRARY:FILEPATH=${PYTHON_LIBRARY}
-DPARAVIEW_INSTALL_PYTHON:BOOL=ON
# Qt
-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
# MPI
${MPI_ARGS}
# Manta
${MANTA_ARGS}
# FFMPEG
${FFMPEG_ARGS}
# HDF5
${HDF5_ARGS}
# EyeDome
-DPARAVIEW_BUILD_PLUGIN_EyeDomeLighting:BOOL=ON
# VisIt
-DPARAVIEW_USE_VISITBRIDGE:BOOL=ON
# VisIt - CGNS
${CGNS_ARGS}
# VisIt - Silo
${Silo_ARGS}
# VisTrails
${VisTrails_ARGS}
# VRPN Plugin
${VRPN_ARGS}
# zlib
${ZLIB_ARGS}
-DPARAVIEW_BUILD_PLUGIN_CoProcessingScriptGenerator:BOOL=ON
${AcuSolve_ARGS}
# Documentation
${DOC_ARGS}
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ParaViewSuperBuild_SOURCE_DIR}/.plugins <BINARY_DIR>/bin/
)