CMakeLists.txt 18.4 KB
Newer Older
Ken Martin's avatar
Ken Martin committed
1
CMAKE_MINIMUM_REQUIRED (VERSION 2.0)
2
3
PROJECT(ParaView)

4
5
#########################################################################
# Disallow in-source build
6
7
STRING(COMPARE EQUAL "${ParaView_SOURCE_DIR}" "${ParaView_BINARY_DIR}" INSOURCE)
IF(INSOURCE)
Ken Martin's avatar
Ken Martin committed
8
  MESSAGE(FATAL_ERROR "ParaView requires an out of source Build. Please create a separate binary directory and run CMake there.")
9
ENDIF(INSOURCE)
10

11
12
13
14
15
#########################################################################
# Common settings
#
# ParaView version number.  An even minor number corresponds to releases.
SET(PARAVIEW_VERSION_MAJOR 1)
Ken Martin's avatar
Ken Martin committed
16
SET(PARAVIEW_VERSION_MINOR 8)
Ken Martin's avatar
Ken Martin committed
17
SET(PARAVIEW_VERSION_PATCH 2)
18
19
SET(PARAVIEW_VERSION "${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}")
SET(PARAVIEW_VERSION_FULL "${PARAVIEW_VERSION}.${PARAVIEW_VERSION_PATCH}")
20
21
22
23
24
25
SET(CMAKE_MODULE_PATH ${ParaView_SOURCE_DIR}/CMake)
SET (LIBRARY_OUTPUT_PATH ${ParaView_BINARY_DIR}/bin CACHE INTERNAL
  "Single output directory for building all libraries.")
SET (EXECUTABLE_OUTPUT_PATH ${ParaView_BINARY_DIR}/bin CACHE INTERNAL
  "Single output directory for building all executables.")

Ken Martin's avatar
Ken Martin committed
26
27
28
29
30
31
32
33
34
35
36
37
#########################################################################
# prepare for a release 
FIND_PROGRAM(NSIS_MAKENSIS NAMES makensis 
  PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS]
  DOC "Where is makensis.exe located"
)
MARK_AS_ADVANCED(NSIS_MAKENSIS)
FIND_PROGRAM(WINZIP_WZZIP NAMES wzzip
  PATHS   "C:/Program Files/WinZip" 
  DOC "Where is makensis.exe located"
)
MARK_AS_ADVANCED(WINZIP_WZZIP)
38
39
CONFIGURE_FILE(${ParaView_SOURCE_DIR}/Utilities/Release/ParaView.nsi.in
  ${ParaView_BINARY_DIR}/Utilities/Release/ParaView.nsi IMMEDIATE @ONLY)
Ken Martin's avatar
Ken Martin committed
40
41
42
43
CONFIGURE_FILE(${ParaView_SOURCE_DIR}/Utilities/Release/Win32Release.sh.in
  ${ParaView_BINARY_DIR}/Utilities/Release/Win32Release.sh IMMEDIATE @ONLY)
CONFIGURE_FILE(${ParaView_SOURCE_DIR}/Utilities/Release/paraview_release.sh.in
  ${ParaView_BINARY_DIR}/Utilities/Release/paraview_release.sh IMMEDIATE @ONLY)
44

45
46
47
48
# The client server wrapper macro needs this name for
# BUILD_SHARED_LIBS so it can work both inside and outside the tree.
SET(PARAVIEW_BUILD_SHARED_LIBS "${BUILD_SHARED_LIBS}")

49
50
# No XML IO
SET(DO_NOT_BUILD_XML_RW 1)
51
SET(CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH})
52

53
54
55
56
57
INCLUDE_DIRECTORIES(${ParaView_BINARY_DIR})
CONFIGURE_FILE(${ParaView_SOURCE_DIR}/vtkPVConfig.h.in
  ${ParaView_BINARY_DIR}/vtkPVConfig.h
  ESCAPE_QUOTES)

58
INCLUDE(${ParaView_SOURCE_DIR}/VTK/CMake/vtkSelectStreamsLibrary.cmake)
59
60
VTK_SELECT_STREAMS_LIBRARY(PARAVIEW_USE_ANSI_STDLIB
                           ${ParaView_SOURCE_DIR}/VTK)
61

Andy Cedilnik's avatar
Andy Cedilnik committed
62
63
64
65
# Fix cxx flags
IF(CMAKE_COMPILER_IS_GNUCXX)
  # A GCC compiler.  Quiet warning about strstream deprecation.
  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
Ken Martin's avatar
Ken Martin committed
66
67
68
69
70
ELSE(CMAKE_COMPILER_IS_GNUCXX)
  IF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
     SET(CMAKE_CXX_FLAGS
         "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include")
  ENDIF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
Andy Cedilnik's avatar
Andy Cedilnik committed
71
72
ENDIF(CMAKE_COMPILER_IS_GNUCXX)

73
74
75
76
IF(BUILD_DOCUMENTATION)
  SUBDIRS(Utilities/Doxygen)
ENDIF(BUILD_DOCUMENTATION)

77
78
#########################################################################
# Configure Testing
79
OPTION(BUILD_TESTING "Build ParaView Complete Testing" ON)
80
OPTION(PARAVIEW_TESTING_DART_SERVER "Use ParaView tree for Dart server. Should be OFF" OFF)
81
MARK_AS_ADVANCED(PARAVIEW_TESTING_DART_SERVER)
82
IF(BUILD_TESTING)
Ken Martin's avatar
Ken Martin committed
83
  MAKE_DIRECTORY(${ParaView_BINARY_DIR}/Testing/Temporary)
84
85
86
87
88
89
90
91
92
  ENABLE_TESTING()
  IF(PARAVIEW_TESTING_DART_SERVER)
    INCLUDE (${CMAKE_ROOT}/Modules/FindDart.cmake)
  ELSE(PARAVIEW_TESTING_DART_SERVER)
    SET(DART_ROOT "" CACHE INTERNAL "" FORCE)
  ENDIF(PARAVIEW_TESTING_DART_SERVER)
  INCLUDE (${CMAKE_ROOT}/Modules/Dart.cmake)
ENDIF(BUILD_TESTING)

Andy Cedilnik's avatar
Andy Cedilnik committed
93
94
IF(NOT PARAVIEW_TESTING_DART_SERVER)

95
96
#########################################################################
# Configure TclTk
97
98
99
100
101
102
SET(APPLICATION_BINARY_DIR "${ParaView_BINARY_DIR}")
SET(VTK_TCL_TK_MACROS_MODULE 
    "${ParaView_SOURCE_DIR}/VTK/CMake/vtkTclTkMacros.cmake")
SET(VTK_TCL_TK_INTERNALS_DIR 
    "${ParaView_SOURCE_DIR}/VTK/Utilities/TclTk/internals")
SET(VTK_TCL_TK_WRAPPING_DIR "${ParaView_SOURCE_DIR}/VTK/Wrapping/Tcl")
103
104
105
106
107
SUBDIRS(Utilities/TclTk)

#########################################################################
# Configure VTK
# force some values to be set by default as they are required by ParaView
108
109
110
111
112
113
114
# 
# something_ISSET is set for vtkDependentOption to not change it to bool. For
# more information, check VTK/CMake/vtkDependentOption.cmake
SET(VTK_USE_HYBRID_ISSET ON)
SET(VTK_USE_PARALLEL_ISSET ON)
SET(VTK_USE_VOLUMEPRO_ISSET OFF)
SET(VTK_USE_GL2PS_ISSET OFF)
115
SET(VTK_USE_ANSI_STDLIB ${PARAVIEW_USE_ANSI_STDLIB})
116
117
118
SET(VTK_HEADER_TESTING_PY "${ParaView_SOURCE_DIR}/VTK/Common/Testing/HeaderTesting.py")
SET(VTK_PRINT_SELF_CHECK_TCL "${ParaView_SOURCE_DIR}/VTK/Common/Testing/Tcl/PrintSelfCheck.tcl")
SET(VTK_FIND_STRING_TCL "${ParaView_SOURCE_DIR}/VTK/Common/Testing/Tcl/FindString.tcl")
119

Ken Martin's avatar
Ken Martin committed
120
SET(VTK_USE_PATENTED ON CACHE INTERNAL "" FORCE)
121
122
123
124
125
126
SET(VTK_USE_RENDERING ON CACHE INTERNAL "" FORCE)
SET(VTK_WRAP_TCL OFF CACHE INTERNAL "" FORCE)
SET(VTK_WRAP_PYTHON OFF CACHE INTERNAL "" FORCE)
SET(VTK_WRAP_JAVA OFF CACHE INTERNAL "" FORCE)
SET(VTK_USE_VIDEO_FOR_WINDOWS OFF CACHE INTERNAL "" FORCE)
SET(VTK_USE_MATROX_IMAGING OFF CACHE INTERNAL "" FORCE)
127

Andy Cedilnik's avatar
Andy Cedilnik committed
128
SET(VTK_DIR "${ParaView_BINARY_DIR}/VTK" CACHE INTERNAL "" FORCE)
129
SET(VTK_FOUND 1)
Ken Martin's avatar
Ken Martin committed
130
FIND_PATH(VTK_DATA_ROOT VTKData.readme ${ParaView_SOURCE_DIR}/../VTKData $ENV{VTK_DATA_ROOT})
131
132
MARK_AS_ADVANCED(VTK_DATA_ROOT)
MARK_AS_ADVANCED(BUILD_EXAMPLES)
133
134
135
IF(NOT BUILD_SHARED_LIBS)
  SET(TCL_TK_STATIC ON CACHE INTERNAL "" FORCE)
ENDIF(NOT BUILD_SHARED_LIBS)
136

Andy Cedilnik's avatar
Andy Cedilnik committed
137
138
OPTION(VTK_USE_PATENTED "Build VTK with patented support" OFF)

139
140
141
# Specify python build so that we can use vtkTkRenderWidget with no
# vtkRenderWindow wrapped.
ADD_DEFINITIONS(-DVTK_PYTHON_BUILD)
Ken Martin's avatar
Ken Martin committed
142
ADD_DEFINITIONS(-DVTK_LEAN_AND_MEAN)
143
OPTION(PARAVIEW_ENABLE_FPE
Ken Martin's avatar
Ken Martin committed
144
145
146
  "Build ParaView with Floating Point Exceptions turned on" OFF)
MARK_AS_ADVANCED(PARAVIEW_ENABLE_FPE)

147
148
149
150
OPTION(PARAVIEW_EXPERIMENTAL_USER
  "Build ParaView with all experimental options" OFF)
MARK_AS_ADVANCED(PARAVIEW_EXPERIMENTAL_USER)

Andy Cedilnik's avatar
Andy Cedilnik committed
151
152
CONFIGURE_FILE(${ParaView_SOURCE_DIR}/VTK/Utilities/TclTk/.NoDartCoverage
  ${ParaView_BINARY_DIR}/VTK/.NoDartCoverage)
153
SUBDIRS(VTK)
154

155
156
157
158
159
160
161
162
163
164
165
166
167
168
169

# Set the ICET MPI variables from the VTK ones.
# use a set cache internal so people don't try and use them
SET(ICET_MPIRUN_EXE "${VTK_MPIRUN_EXE}" CACHE INTERNAL 
  "This is set from VTK_MPIRUN_EXE.")
SET(ICET_MPI_PREFLAGS 
  "${VTK_MPI_NUMPROC_FLAG};${VTK_MPI_MAX_NUMPROCS};${VTK_MPI_PREFLAGS}" CACHE INTERNAL
  "This is set from a combination of VTK_MPI_NUMPROC_FLAG VTK_MPI_MAX_NUMPROCS VTK_MPI_PREFLAGS.")
SET(ICET_MPI_POSTFLAGS "${VTK_MPI_POSTFLAGS}"  CACHE INTERNAL
  "This is set from VTK_MPI_POSTFLAGS.")
SET(ICET_MPI_MAX_NUMPROCS "${VTK_MPI_MAX_NUMPROCS}"  CACHE INTERNAL
  "This is set from VTK_MPI_MAX_NUMPROCS.")



Andy Cedilnik's avatar
Andy Cedilnik committed
170
171
172
SET(VTK_INCLUDE_DIR
  ${ParaView_SOURCE_DIR}/VTK
  ${ParaView_BINARY_DIR}/VTK
Brad King's avatar
Brad King committed
173
174
  ${ParaView_SOURCE_DIR}/VTK/Utilities
  ${ParaView_BINARY_DIR}/VTK/Utilities
Andy Cedilnik's avatar
Andy Cedilnik committed
175
176
177
178
179
180
181
  )
SET(kits Common Filtering IO Imaging Rendering Parallel Graphics Hybrid)
IF(VTK_USE_PATENTED)
  SET(kits ${kits} Patented)
ENDIF(VTK_USE_PATENTED)
FOREACH(kit ${kits})
  SET(VTK_INCLUDE_DIR ${VTK_INCLUDE_DIR}
182
183
    ${ParaView_SOURCE_DIR}/VTK/${kit}
    ${ParaView_BINARY_DIR}/VTK/${kit}
Andy Cedilnik's avatar
Andy Cedilnik committed
184
185
    )
ENDFOREACH(kit)
186

187
188
189
190
191
192
193
IF(VTK_USE_SYSTEM_ZLIB)
  SET(VTK_ZLIB_LIBRARIES ${ZLIB_LIBRARIES})
  SET(VTK_ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR})
  SET(VTKZLIB_INCLUDE_DIR ${ZLIB_INCLUDE_DIR})
ELSE(VTK_USE_SYSTEM_ZLIB)
  SET(VTK_ZLIB_LIBRARIES vtkzlib)
  SET(VTK_ZLIB_INCLUDE_DIRS
Brad King's avatar
Brad King committed
194
    ${ParaView_SOURCE_DIR}/VTK/Utilities
195
196
197
198
    ${ParaView_BINARY_DIR}/VTK/Utilities
    ${ParaView_SOURCE_DIR}/VTK
    ${ParaView_BINARY_DIR}/VTK
    )
199
  SET(VTKZLIB_INCLUDE_DIR
Brad King's avatar
Brad King committed
200
    ${ParaView_SOURCE_DIR}/VTK/Utilities
201
202
203
204
    ${ParaView_BINARY_DIR}/VTK/Utilities
    ${ParaView_SOURCE_DIR}/VTK
    ${ParaView_BINARY_DIR}/VTK
    )
205
206
ENDIF(VTK_USE_SYSTEM_ZLIB)

207
208
#########################################################################
# Configure HDF5
209
OPTION(PARAVIEW_USE_SYSTEM_HDF5 "Use system installed HDF5" OFF)
Andy Cedilnik's avatar
Andy Cedilnik committed
210
211
212
213
214
215
216
217
218
IF(PARAVIEW_USE_SYSTEM_HDF5)

  INCLUDE(${ParaView_SOURCE_DIR}/CMake/FindHDF5.cmake)
  INCLUDE(${ParaView_SOURCE_DIR}/CMake/FindZLIB.cmake)
  SET(PARAVIEW_HDF5_LIBRARIES ${HDF5_LIBRARIES})

ELSE(PARAVIEW_USE_SYSTEM_HDF5)

  SET(PARAVIEW_HDF5_LIBRARIES vtkhdf5)
219
  SET(HDF5_ZLIB_HEADER "vtk_zlib.h")
Andy Cedilnik's avatar
Andy Cedilnik committed
220
221
222
223
  SET(HDF5_INCLUDE_DIR 
    ${ParaView_SOURCE_DIR}/Utilities/hdf5
    ${ParaView_BINARY_DIR}/Utilities/hdf5)

Andy Cedilnik's avatar
Andy Cedilnik committed
224
  SET(HDF5_CONFIG ${ParaView_BINARY_DIR}/Utilities/hdf5/HDF5Config.cmake)
Andy Cedilnik's avatar
Andy Cedilnik committed
225
226
227
  SUBDIRS(Utilities/hdf5)

ENDIF(PARAVIEW_USE_SYSTEM_HDF5)
228
229
230

#########################################################################
# Configure Xdmf
231
SET(XDMF_NOT_INSTALL_INCLUDE_FILES ON)
232
233
234
235
SET(XDMF_REGENERATE_YACCLEX OFF CACHE INTERNAL "" FORCE)
SET(XDMF_REGENERATE_WRAPPERS OFF CACHE INTERNAL "" FORCE)
SET(XDMF_WRAP_PYTHON OFF CACHE INTERNAL "" FORCE)
SET(XDMF_WRAP_TCL OFF CACHE INTERNAL "" FORCE)
236
237
238
239
240
SET(XDMF_KITS_DIR "${ParaView_BINARY_DIR}/Utilities/Xdmf/vtk/Utilities")
SET(XDMF_INCLUDE_DIRS
  "${ParaView_SOURCE_DIR}/Utilities/Xdmf/vtk"
  "${ParaView_BINARY_DIR}/Utilities/Xdmf/vtk")
SET(PARAVIEW_LINK_XDMF ON)
241
242
SUBDIRS(Utilities/Xdmf)

243
244
245
246
247
248
249
#########################################################################
# Configure mpeg2 encoding
SET(VTKMPEG2_INCLUDE_DIRS
  "${ParaView_SOURCE_DIR}/Utilities/vtkmpeg2"
  "${ParaView_BINARY_DIR}/Utilities/vtkmpeg2")
SUBDIRS(Utilities/vtkmpeg2)

Andy Cedilnik's avatar
Andy Cedilnik committed
250
251
#########################################################################
# Configure IceT
252
253
254
255
MARK_AS_ADVANCED(CLEAR VTK_USE_MPI)
IF(VTK_USE_MPI)
  OPTION(PARAVIEW_USE_ICE_T "Use IceT multi display manager" ON)
  MARK_AS_ADVANCED(PARAVIEW_USE_ICE_T)
256
257
258
259
  IF (BUILD_TESTING)
    OPTION(ICET_BUILD_TESTING "Build and run the ICE-T tests." OFF)
    MARK_AS_ADVANCED(ICET_BUILD_TESTING)
  ENDIF (BUILD_TESTING)
260
261
262
263
264
265
266
267
  IF(PARAVIEW_USE_ICE_T)
    SET(ICE_T_INCLUDE_DIR 
      ${ParaView_SOURCE_DIR}/Utilities/IceT/src/include
      ${ParaView_BINARY_DIR}/Utilities/IceT/src/include
      )
    SUBDIRS(Utilities/IceT)
  ENDIF(PARAVIEW_USE_ICE_T)
ENDIF(VTK_USE_MPI)
Andy Cedilnik's avatar
Andy Cedilnik committed
268

269
270
271
272
273
274
#########################################################################
# Configure KWsys
SET(KWSYS_NAMESPACE kwsys)
SET(KWSYS_USE_Process 1)
SET(KWSYS_USE_SystemTools 1)
SET(KWSYS_USE_RegularExpression 1)
275
SET(KWSYS_USE_CommandLineArguments 1)
276
277
278
279
SET(KWSYS_HEADER_ROOT ${ParaView_BINARY_DIR}/Utilities/KWSys)
IF(NOT VTK_USE_ANSI_STDLIB)
  SET(KWSYS_FORCE_OLD_STREAMS 1)
ENDIF(NOT VTK_USE_ANSI_STDLIB)
Andy Cedilnik's avatar
Andy Cedilnik committed
280
SET(KWSYS_INCLUDE_DIR ${ParaView_BINARY_DIR}/Utilities/KWSys)
281
282
283
IF(BUILD_SHARED_LIBS)
  SET(KWSYS_LIBRARY_INSTALL_DIR "/lib")
ENDIF(BUILD_SHARED_LIBS)
284
285
SUBDIRS(Utilities/KWSys)

286
287
SET(PARAVIEW_KWSYS_INCLUDE_DIRS ${KWSYS_INCLUDE_DIR})

288
#########################################################################
Andy Cedilnik's avatar
Andy Cedilnik committed
289
290
291
292
# Configure Common
SET(KWCOMMON_INCLUDE_DIR
  ${ParaView_SOURCE_DIR}/Common/KWCommon
  ${ParaView_BINARY_DIR}/Common/KWCommon)
293
294
295
296
SUBDIRS(Common)

#########################################################################
# Configure VTKClientServer wrapping
297
SET(KW_INSTALL_LIB_DIR "/lib")
Andy Cedilnik's avatar
Andy Cedilnik committed
298
299
300
301
SET(VTKCLIENTSERVER_INCLUDE_DIR
  ${ParaView_SOURCE_DIR}/Utilities/VTKClientServer
  ${ParaView_BINARY_DIR}/Utilities/VTKClientServer
  )
302
303
304
305
306
307
SUBDIRS(Utilities/VTKClientServer)

#########################################################################
# Configure Tcl wrapping
SUBDIRS(Utilities/VTKTclWrapping)

Andy Cedilnik's avatar
Andy Cedilnik committed
308
#########################################################################
309
310
# Configure ParaViewPlus
IF(EXISTS "${ParaView_SOURCE_DIR}/ParaViewPlus")
311
312
313
  OPTION(PARAVIEW_PLUS_BUILD "Build ParaViewPlus part. Requires Kitware License and ParaViewPlus source" OFF)
  MARK_AS_ADVANCED(PARAVIEW_PLUS_BUILD)
  IF(PARAVIEW_PLUS_BUILD)
314
    SUBDIRS(ParaViewPlus)
315
    SET(PARAVIEW_PLUS_INCLUDE_DIRS
316
      ${ParaView_SOURCE_DIR}/ParaViewPlus/IO
Andy Cedilnik's avatar
Andy Cedilnik committed
317
      )
318
  ENDIF(PARAVIEW_PLUS_BUILD)
319
ENDIF(EXISTS "${ParaView_SOURCE_DIR}/ParaViewPlus")
Andy Cedilnik's avatar
Andy Cedilnik committed
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
#########################################################################
# Import external projects, such as EXODUS and SAF

SET(PARAVIEW_ADDITIONAL_LIBRARIES)

#
# Imported project adds libraries
#
MACRO(PARAVIEW_LINK_LIBRARIES LIBS)
  SET(PARAVIEW_ADDITIONAL_LIBRARIES ${PARAVIEW_ADDITIONAL_LIBRARIES} ${LIBS})
ENDMACRO(PARAVIEW_LINK_LIBRARIES LIBS)

#
# Adds extra ParaView link directories
#
MACRO(PARAVIEW_EXTRA_LINK_DIRECTORIES DIRS)
  SET(current_dirs ${PARAVIEW_EXTRA_LINK_DIRECTORIES})
  FOREACH(dir ${DIRS})
    IF(${current_dirs} MATCHES ${dir})
    ELSE(${current_dirs} MATCHES ${dir})
      SET(current_dirs ${current_dirs} ${dir})
    ENDIF(${current_dirs} MATCHES ${dir})
  ENDFOREACH(dir)
  SET(PARAVIEW_EXTRA_LINK_DIRECTORIES "${current_dirs}" CACHE INTERNAL "")
ENDMACRO(PARAVIEW_EXTRA_LINK_DIRECTORIES)

#
# Imported project adds source files
# This ones need to be fixed, so that first are not wrapped. This will be fixed
# once the server changes are merged.
#
SET(ExtraParaViewServerNonWrapped_SRCS)
SET(ExtraParaViewClient_SRCS)
SET(ExtraParaViewBinary_SRCS)
SET(ExtraParaViewServer_SRCS)

MACRO(PARAVIEW_INCLUDE_SOURCES SRCS)
  SET(ExtraParaViewServerNonWrapped_SRCS
    ${ExtraParaViewServerNonWrapped_SRCS} ${SRCS})
ENDMACRO(PARAVIEW_INCLUDE_SOURCES SRCS)
MACRO(PARAVIEW_INCLUDE_CLIENT_SOURCES SRCS)
  SET(ExtraParaViewClient_SRCS ${ExtraParaViewClient_SRCS} ${SRCS})
ENDMACRO(PARAVIEW_INCLUDE_CLIENT_SOURCES)
364
365
366
367
MACRO(PARAVIEW_INCLUDE_NONWRAPPED_CLIENT_SOURCES SRCS)
  SET(ExtraParaViewClientNonWrapped_SRCS ${ExtraParaViewClientNonWrapped_SRCS}
    ${SRCS})
ENDMACRO(PARAVIEW_INCLUDE_NONWRAPPED_CLIENT_SOURCES)
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
MACRO(PARAVIEW_INCLUDE_EXECUTABLE_SOURCES SRCS)
  SET(ExtraParaViewBinary_SRCS ${ExtraParaViewBinary_SRCS} ${SRCS})
ENDMACRO(PARAVIEW_INCLUDE_EXECUTABLE_SOURCES SRCS)
MACRO(PARAVIEW_INCLUDE_WRAPPED_SOURCES SRCS)
  SET(ExtraParaViewServer_SRCS ${ExtraParaViewServer_SRCS} ${SRCS})
ENDMACRO(PARAVIEW_INCLUDE_WRAPPED_SOURCES SRCS)

FOREACH(external EXODUS SAF)
  OPTION(PARAVIEW_USE_${external} "Build using ${external} library. Requires access to ${external} libraries" OFF)
  MARK_AS_ADVANCED(PARAVIEW_USE_${external})
  IF(PARAVIEW_USE_${external})
    FIND_PATH(${external}_SOURCE_DIR 
      ${external}ParaViewImport.cmake
      ../vtkSNL/IO
      ../../vtkSNL/IO
      ../../../vtkSNL/IO)

    IF(EXISTS ${${external}_SOURCE_DIR}/${external}ParaViewImport.cmake)
      INCLUDE(${${external}_SOURCE_DIR}/${external}ParaViewImport.cmake)
    ELSE(EXISTS ${${external}_SOURCE_DIR}/${external}ParaViewImport.cmake)
      MESSAGE(SEND_ERROR "Cannot find ${external} sources directory: ${${external}_SOURCE_DIR}")
    ENDIF(EXISTS ${${external}_SOURCE_DIR}/${external}ParaViewImport.cmake)
  ENDIF(PARAVIEW_USE_${external})
ENDFOREACH(external)

393
394
#########################################################################
# Configure Server
Andy Cedilnik's avatar
Andy Cedilnik committed
395
396
397
SET(PVFILTERS_INCLUDE_DIR
  ${ParaView_SOURCE_DIR}/Servers/Filters
  ${ParaView_BINARY_DIR}/Servers/Filters)
398
399
400
SET(PVSERVERMANAGER_INCLUDE_DIR
  ${ParaView_SOURCE_DIR}/Servers/ServerManager
  ${ParaView_BINARY_DIR}/Servers/ServerManager)
401
402
403
SET(PVSERVERCOMMON_INCLUDE_DIR
  ${ParaView_SOURCE_DIR}/Servers/Common
  ${ParaView_BINARY_DIR}/Servers/Common)
404

405
406
SUBDIRS(Servers)

407
408
409
410
#########################################################################
# Configure GUI
SUBDIRS(GUI)

411

412
SUBDIRS(Servers/Executables)
413
414
415
416
417
418
419
420
421

#-----------------------------------------------------------------------------
# Help outside projects build ParaView plugin packages.

EXPORT_LIBRARY_DEPENDENCIES(${ParaView_BINARY_DIR}/ParaViewLibraryDepends.cmake)

# For ParaView from build tree:
SET(PARAVIEW_VTK_DIR ${VTK_DIR})
SET(VTK_WRAP_ClientServer_EXE_CONFIG ${VTK_WRAP_ClientServer_EXE})
Ken Martin's avatar
Ken Martin committed
422
SET(VTKCS_SOURCE_DIR ${ParaView_SOURCE_DIR}/Utilities/VTKClientServer)
423
424
425
426
SET(PARAVIEW_CMAKE_CLIENT_SERVER_EXTENSION
  ${VTKCS_SOURCE_DIR}/CMake/vtkWrapClientServer.cmake)
SET(PARAVIEW_USE_FILE ${ParaView_SOURCE_DIR}/ParaViewUse.cmake)
SET(PARAVIEW_INCLUDE_DIRS
427
  ${ParaView_SOURCE_DIR}/Utilities/VTKClientServer
428
  ${ParaView_SOURCE_DIR}/Utilities/hdf5
429
430
  ${ParaView_SOURCE_DIR}/Common/KWCommon
  ${ParaView_SOURCE_DIR}/Servers/Filters
431
  ${ParaView_SOURCE_DIR}/Servers/ServerManager
432
  ${ParaView_SOURCE_DIR}/Servers/Common
433
434
  ${ParaView_SOURCE_DIR}/GUI/Widgets
  ${ParaView_SOURCE_DIR}/GUI/Client
435
#
436
  ${ParaView_BINARY_DIR}
437
  ${ParaView_BINARY_DIR}/Utilities/VTKClientServer
438
  ${ParaView_BINARY_DIR}/Utilities/hdf5
439
440
  ${ParaView_BINARY_DIR}/Common/KWCommon
  ${ParaView_BINARY_DIR}/Servers/Filters
441
  ${ParaView_BINARY_DIR}/Servers/ServerManager
442
  ${ParaView_BINARY_DIR}/Servers/Common
443
444
  ${ParaView_BINARY_DIR}/GUI/Widgets
  ${ParaView_BINARY_DIR}/GUI/Client
445
  )
446
447
448
449
450
SET(PARAVIEW_GUI_INCLUDE_DIRS
  ${TCL_INCLUDE_PATH}
  ${TK_INCLUDE_PATH}
  ${KWCOMMON_INCLUDE_DIR}
  ${VTKZLIB_INCLUDE_DIR})
451
SET(PARAVIEW_LIBRARY_DIRS ${LIBRARY_OUTPUT_PATH} ${PARAVIEW_EXTRA_LINK_DIRECTORIES})
452
SET(PARAVIEW_LIBRARY_DEPENDS_FILE ${ParaView_BINARY_DIR}/ParaViewLibraryDepends.cmake)
453
454
SET(PARAVIEW_GUI_CLIENT_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/paraview)
SET(PARAVIEW_SERVER_MANAGER_RESOURCES_DIRECTORY ${ParaView_SOURCE_DIR}/Servers/ServerManager/Resources)
455
456
457
458
459
460
461
462
463
CONFIGURE_FILE(${ParaView_SOURCE_DIR}/ParaViewConfig.cmake.in
               ${ParaView_BINARY_DIR}/ParaViewConfig.cmake @ONLY IMMEDIATE)

# For installed ParaView:
SET(PARAVIEW_VTK_DIR ${CMAKE_INSTALL_PREFIX}/lib/vtk)
SET(VTK_WRAP_ClientServer_EXE_CONFIG ${CMAKE_INSTALL_PREFIX}/lib/paraview-${PARAVIEW_VERSION}/vtkWrapClientServer)
SET(PARAVIEW_CMAKE_CLIENT_SERVER_EXTENSION ${CMAKE_INSTALL_PREFIX}/lib/paraview-${PARAVIEW_VERSION}/CMake/vtkWrapClientServer.cmake)
SET(PARAVIEW_USE_FILE ${CMAKE_INSTALL_PREFIX}/lib/paraview-${PARAVIEW_VERSION}/ParaViewUse.cmake)
SET(PARAVIEW_INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX}/include/paraview-${PARAVIEW_VERSION})
464
SET(PARAVIEW_GUI_INCLUDE_DIRS ${PARAVIEW_INCLUDE_DIRS})
465
466
SET(PARAVIEW_LIBRARY_DIRS ${CMAKE_INSTALL_PREFIX}/lib/paraview-${PARAVIEW_VERSION})
SET(PARAVIEW_LIBRARY_DEPENDS_FILE ${CMAKE_INSTALL_PREFIX}/lib/paraview-${PARAVIEW_VERSION}/ParaViewLibraryDepends.cmake)
467
468
SET(PARAVIEW_GUI_CLIENT_EXECUTABLE ${CMAKE_INSTALL_PREFIX}/bin/paraview)
SET(PARAVIEW_SERVER_MANAGER_RESOURCES_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/paraview-${PARAVIEW_VERSION}/ServerManager/Resources)
469
470
471
472
473
474
475
476
477
478
CONFIGURE_FILE(${ParaView_SOURCE_DIR}/ParaViewConfig.cmake.in
               ${ParaView_BINARY_DIR}/Utilities/ParaViewConfig.cmake @ONLY IMMEDIATE)

INSTALL_FILES(/lib/paraview-${PARAVIEW_VERSION}/CMake FILES
  ${VTKCS_SOURCE_DIR}/CMake/vtkWrapClientServer.cmake)
INSTALL_FILES(/lib/paraview-${PARAVIEW_VERSION} FILES
  ${ParaView_SOURCE_DIR}/ParaViewUse.cmake
  ${ParaView_BINARY_DIR}/ParaViewLibraryDepends.cmake
  ${ParaView_BINARY_DIR}/Utilities/ParaViewConfig.cmake
  )
479
480
481
482

CONFIGURE_FILE(${ParaView_SOURCE_DIR}/CMake/CTestCustom.ctest.in
  ${ParaView_BINARY_DIR}/CTestCustom.ctest @ONLY)

Andy Cedilnik's avatar
Andy Cedilnik committed
483
ENDIF(NOT PARAVIEW_TESTING_DART_SERVER)
484