ParaViewConfig.cmake.in 4.59 KB
Newer Older
1 2 3 4 5 6
#-----------------------------------------------------------------------------
#
# ParaViewConfig.cmake - ParaView CMake configuration file for external projects.
#
# This file is configured by ParaView and used by the UseParaView.cmake module
# to load ParaView's settings for an external project.
7 8
set (__pv_install_tree @PARAVIEW_CONFIG_INSTALLED@)
if (__pv_install_tree)
9 10 11
  get_filename_component(location "${CMAKE_CURRENT_LIST_FILE}" PATH)
  set (VTK_CONFIG_FILE "${location}/VTKConfig.cmake")
  set (ParaView_CMAKE_DIR "${location}")
12
  set (PARAVIEW_CONFIG_TARGETS_FILE "${location}/ParaViewTargets.cmake")
13 14 15 16
else()
  # The ParaView is in the build-location.
  set (VTK_CONFIG_FILE "@ParaView_BINARY_DIR@/VTK/VTKConfig.cmake")
  set (ParaView_CMAKE_DIR "@ParaView_CMAKE_DIR@")
17
  set (PARAVIEW_CONFIG_TARGETS_FILE "@ParaView_BINARY_DIR@/ParaViewTargets.cmake")
18
endif()
19 20

#------------------------------------------------------------------------------
21
# Version information for ParaView
22 23 24
SET(PARAVIEW_VERSION_MAJOR "@PARAVIEW_VERSION_MAJOR@")
SET(PARAVIEW_VERSION_MINOR "@PARAVIEW_VERSION_MINOR@")
SET(PARAVIEW_VERSION_PATCH "@PARAVIEW_VERSION_PATCH@")
25
SET(PARAVIEW_VERSION_FULL  "@PARAVIEW_VERSION_FULL@")
26
SET(PARAVIEW_VERSION       "@PARAVIEW_VERSION@")
27

28 29 30
# The location of the UseParaView.cmake file
# FIXME: I don't like this mixing of case, we need to fix that to be consistent.
set (ParaView_USE_FILE "${ParaView_CMAKE_DIR}/UseParaView.cmake")
31

32 33 34
set (PARAVIEW_USE_FILE ${ParaView_USE_FILE})
set (PARAVIEW_CMAKE_DIR ${ParaView_CMAKE_DIR})

35
# Setup VTK-m if it was enabled
Utkarsh Ayachit's avatar
Utkarsh Ayachit committed
36 37 38
set(PARAVIEW_USE_VTKM @PARAVIEW_USE_VTKM@)
if(PARAVIEW_USE_VTKM)
   set(VTKM_CMAKE_DIR "${VTK_CMAKE_DIR}")
39 40 41
  if(NOT __vtk_install_tree)
    set(VTKM_CMAKE_DIR "@VTKm_BINARY_DIR@/@VTK_INSTALL_PACKAGE_DIR@/vtkm")
  endif()
42 43 44 45
  get_filename_component(VTKM_CMAKE_DIR "${VTKM_CMAKE_DIR}" PATH)
  find_package(VTKm
               PATHS "${CMAKE_CURRENT_LIST_DIR}"
                     "${VTKM_CMAKE_DIR}"
Utkarsh Ayachit's avatar
Utkarsh Ayachit committed
46
                     "${VTK_RUNTIME_DIRS}"
47 48 49 50
               NO_DEFAULT_PATH
               )
endif()

51 52 53 54 55
# Import ParaView targets.
if(NOT TARGET vtkPVCommon)
  include("${PARAVIEW_CONFIG_TARGETS_FILE}")
endif()

56 57
# load VTK config. This will bring in information about all modules (including
# ParaView's modules).
58 59 60 61 62 63 64
set (paraview_build_qt_gui "@PARAVIEW_BUILD_QT_GUI@")
if (paraview_build_qt_gui)
  set (VTK_FIND_COMPONENTS pqApplicationComponents)
else()
  set (VTK_FIND_COMPONENTS vtkPVServerManagerApplication)
endif()

65
set (PARAVIEW_QT_VERSION "@PARAVIEW_QT_VERSION@")
66
set (VTK_FIND_COMPONENTS ${VTK_FIND_COMPONENTS} ${ParaView_FIND_COMPONENTS})
67
include("${VTK_CONFIG_FILE}")
68

69
if (__pv_install_tree)
70 71 72 73 74
  if (WIN32)
    set (PARAVIEW_RUNTIME_DIRS "${VTK_INSTALL_PREFIX}/@VTK_INSTALL_RUNTIME_DIR@")
  else ()
    set (PARAVIEW_RUNTIME_DIRS "${VTK_INSTALL_PREFIX}/@VTK_INSTALL_LIBRARY_DIR@")
  endif ()
75
  set (PARAVIEW_WWW_DIR "${VTK_INSTALL_PREFIX}/www")
76
else()
77 78 79
  if (WIN32)
    set (PARAVIEW_RUNTIME_DIRS "@ParaView_BINARY_DIR@/bin")
  else ()
80
    set (PARAVIEW_RUNTIME_DIRS "@ParaView_BINARY_DIR@/lib")
81
  endif ()
82
  list(APPEND VTK_INCLUDE_DIRS "@ParaView_BINARY_DIR@")
83
  set (PARAVIEW_WWW_DIR "@ParaView_BINARY_DIR@/www")
84
endif()
85 86 87 88 89 90

# unless using external vtk (when we start supporting it, that is)
# PARAVIEW_INCLUDE_DIRS is same as VTK_INCLUDE_DIRS, but to make it easier for
# ParaView users.
set (PARAVIEW_INCLUDE_DIRS ${VTK_INCLUDE_DIRS})

91 92
#------------------------------------------------------------------------------
# ParaView global configuration options.
93

94 95
set (PARAVIEW_BUILD_SHARED_LIBS "@BUILD_SHARED_LIBS@")
set (PARAVIEW_BUILD_QT_GUI "@PARAVIEW_BUILD_QT_GUI@")
96
set (PARAVIEW_ENABLE_EMBEDDED_DOCUMENTATION "@PARAVIEW_ENABLE_EMBEDDED_DOCUMENTATION@")
97 98 99
set (PARAVIEW_USE_MPI "@PARAVIEW_USE_MPI@")
set (PARAVIEW_ENABLE_PYTHON "@PARAVIEW_ENABLE_PYTHON@")
set (PARAVIEW_ENABLE_QT_SUPPORT "@PARAVIEW_ENABLE_QT_SUPPORT@")
100 101
set (PARAVIEW_USE_VISITBRIDGE "@PARAVIEW_USE_VISITBRIDGE@")
set (PARAVIEW_ENABLE_COPROCESSING "@PARAVIEW_ENABLE_COPROCESSING@")
102
set (PARAVIEW_ENABLE_WEB "@PARAVIEW_ENABLE_WEB@")
103

104 105 106 107 108 109 110
if (NOT @VTK_LEGACY_REMOVE@)
  if (PARAVIEW_ENABLE_PYTHON)
    if (__pv_install_tree)
      set(PARAVIEW_PYTHONPATH "${VTK_INSTALL_PREFIX}/@VTK_INSTALL_PYTHON_MODULES_DIR@")
    else ()
      set(PARAVIEW_PYTHONPATH "@VTK_BUILD_PYTHON_MODULES_DIR@")
    endif ()
111 112 113
  endif ()
endif ()

114 115 116 117 118 119 120 121 122
if(PARAVIEW_ENABLE_QT_SUPPORT)
  # If Qt support is enabled, provides clues to Qt version used to build ParaView.
  if(PARAVIEW_QT_VERSION VERSION_GREATER "4")
    # nothing to do. the module system handles it properly.
  else()
    set(PARAVIEW_QT_QMAKE_EXECUTABLE "@QT_QMAKE_EXECUTABLE@")
  endif()
endif()

123 124
# cleanup
unset(__pv_install_tree)