paraview.bundle.cmake 7.03 KB
Newer Older
1 2
include(paraview-version)

Ben Boeckel's avatar
Ben Boeckel committed
3
set(paraview_doc_dir "doc")
4
set(paraview_data_dir "examples")
5
set(paraview_materials_dir "materials")
6
set(paraview_plugin_path "bin/paraview-${paraview_version}/plugins")
Ben Boeckel's avatar
Ben Boeckel committed
7 8 9 10 11 12 13 14 15 16
include(paraview.bundle.common)

# Set NSIS install specific stuff.
if (CMAKE_CL_64)
  # Change default installation root path for Windows x64.
  set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
endif ()

# URL to website providing assistance in installing your application.
set(CPACK_NSIS_HELP_LINK "http://paraview.org/Wiki/ParaView")
17 18 19 20 21
set(paraview_description "ParaView ${paraview_version_full}")
set(pvserver_description "pvserver ${paraview_version_full} (Server)")
set(pvdataserver_description "pvdataserver ${paraview_version_full} (Data-Server)")
set(pvrenderserver_description "pvrenderserver ${paraview_version_full} (Render-Server)")
set(pvpython_description "pvpython ${paraview_version_full} (Python Shell)")
Ben Boeckel's avatar
Ben Boeckel committed
22 23 24 25 26 27

#FIXME: need a pretty icon.
#set(CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_LIST_DIR}/paraview.ico")
#set(CPACK_NSIS_MUI_FINISHPAGE_RUN "bin/paraview.exe")

set(library_paths "lib")
28 29 30 31 32
if (Qt5_DIR)
  list(APPEND library_paths
    "${Qt5_DIR}/../../../bin")
endif ()

33
set(exclude_regexes)
34 35 36 37 38
if (python3_enabled)
  if (python3_built_by_superbuild)
    list(APPEND library_paths
      "${superbuild_install_location}/Python")
  else()
39 40
    list(APPEND exclude_regexes
        ".*python3[0-9]+.dll")
41
  endif()
42 43
endif ()

Ben Boeckel's avatar
Ben Boeckel committed
44 45 46 47 48 49 50
# Install paraview executables to bin.
foreach (executable IN LISTS paraview_executables)
  if (DEFINED "${executable}_description")
    list(APPEND CPACK_NSIS_MENU_LINKS
      "bin/${executable}.exe" "${${executable}_description}")
  endif ()

51 52 53
  superbuild_windows_install_program("${executable}" "bin"
    SEARCH_DIRECTORIES "${library_paths}"
    EXCLUDE_REGEXES    ${exclude_regexes})
Ben Boeckel's avatar
Ben Boeckel committed
54 55
endforeach()

56 57
foreach (paraview_plugin IN LISTS paraview_plugins)
  superbuild_windows_install_plugin("${paraview_plugin}.dll"
58 59 60
    "${paraview_plugin_path}/${paraview_plugin}" "${paraview_plugin_path}/${paraview_plugin}"
    SEARCH_DIRECTORIES "${paraview_plugin_path}/${paraview_plugin}" "${library_paths}" "${superbuild_install_location}/bin"
    EXCLUDE_REGEXES ${exclude_regexes})
61 62 63 64 65 66 67
endforeach ()

set(plugins_file "${CMAKE_CURRENT_BINARY_DIR}/paraview.plugins")
paraview_add_plugin("${plugins_file}" ${paraview_plugins})

install(
  FILES       "${plugins_file}"
68
  DESTINATION "${paraview_plugin_path}"
69 70 71
  COMPONENT   superbuild
  RENAME      ".plugins")

72 73 74
if (nvidiaindex_enabled)
  set(nvidiaindex_libraries
    libdice
75 76 77 78 79 80 81 82
    libnvindex)

  # Need different nvrtc-builtins library depending on whether we are building
  # with IndeX 2.1 or 2.2.
  if (nvidiaindex_SOURCE_SELECTION STREQUAL "2.1")
    list(APPEND nvidiaindex_libraries nvrtc-builtins64_80)
  elseif (nvidiaindex_SOURCE_SELECTION STREQUAL "2.2")
    list(APPEND nvidiaindex_libraries nvrtc-builtins64_90)
83 84
  elseif (nvidiaindex_SOURCE_SELECTION STREQUAL "2.3")
    list(APPEND nvidiaindex_libraries nvrtc-builtins64_101)
85 86 87 88
  else ()
    message(FATAL_ERROR
      "Unknown nvrtc-builtins64 library for ${nvidiaindex_SOURCE_SELECTION}.")
  endif ()
89 90 91 92 93 94 95 96 97 98 99 100 101

  foreach (nvidiaindex_library IN LISTS nvidiaindex_libraries)
    superbuild_windows_install_plugin("${nvidiaindex_library}.dll"
      "bin" "bin"
      SEARCH_DIRECTORIES "${superbuild_install_location}/bin"
      # Yes, there are 8 slashes here. It goes through one CMake level here,
      # another in the `install(CODE)` during the install, and then a regex
      # level inside of Python. Since 2^3 is 8, we need 8 slashes to get one in
      # the regex character class.
      EXCLUDE_REGEXES ".*[/\\\\\\\\]nvcuda.dll")
  endforeach ()
endif ()

102 103 104 105 106 107 108 109 110 111 112
if (ospray_enabled)
  set(osprayextra_libraries
    ospray_module_ispc)

  foreach (osprayextra_library IN LISTS osprayextra_libraries)
    superbuild_windows_install_plugin("${osprayextra_library}.dll"
      "bin" "bin"
      SEARCH_DIRECTORIES "${superbuild_install_location}/bin")
  endforeach ()
endif ()

113 114 115 116 117 118 119 120 121 122 123 124 125 126
if (visrtx_enabled)
  set(visrtxextra_libraries
    VisRTX
    dds
    nv_freeimage
    mdl_sdk)

  foreach (visrtxextra_library IN LISTS visrtxextra_libraries)
    superbuild_windows_install_plugin("${visrtxextra_library}.dll"
      "bin" "bin"
      SEARCH_DIRECTORIES "${superbuild_install_location}/bin")
  endforeach ()
endif ()

Ben Boeckel's avatar
Ben Boeckel committed
127
if (python_enabled)
128 129 130
  if (python2_built_by_superbuild)
    include(python2.functions)
    superbuild_install_superbuild_python2()
131 132 133
  elseif (python3_built_by_superbuild)
    include(python3.functions)
    superbuild_install_superbuild_python3()
134
  endif ()
Ben Boeckel's avatar
Ben Boeckel committed
135

136 137 138 139 140 141
  if (python3_enabled)
    set(python_prefix "Python")
  else()
    set(python_prefix "bin")
  endif()

Ben Boeckel's avatar
Ben Boeckel committed
142 143 144
  superbuild_windows_install_python(
    MODULES paraview
            vtk
145
            vtkmodules
Ben Boeckel's avatar
Ben Boeckel committed
146
            ${python_modules}
147 148
    MODULE_DIRECTORIES  "${superbuild_install_location}/${python_prefix}/Lib/site-packages"
                        "${superbuild_install_location}/bin/Lib/site-packages"
149
                        "${superbuild_install_location}/lib/site-packages"
150
                        "${superbuild_install_location}/lib/python${superbuild_python_version}/site-packages"
151
                        "${superbuild_install_location}/lib/paraview-${paraview_version_major}.${paraview_version_minor}/site-packages"
152
    SEARCH_DIRECTORIES  "${superbuild_install_location}/lib"
153
                        "${superbuild_install_location}/bin"
154
                        "${superbuild_install_location}/${python_prefix}"
155
    EXCLUDE_REGEXES     ${exclude_regexes})
Ben Boeckel's avatar
Ben Boeckel committed
156

157

158
  if (matplotlib_built_by_superbuild)
Ben Boeckel's avatar
Ben Boeckel committed
159
    install(
160
      DIRECTORY   "${superbuild_install_location}/${python_prefix}/Lib/site-packages/matplotlib/mpl-data/"
Ben Boeckel's avatar
Ben Boeckel committed
161 162 163 164
      DESTINATION "bin/Lib/site-packages/matplotlib/mpl-data"
      COMPONENT   superbuild)
  endif ()

165 166
  if (pywin32_built_by_superbuild)
      install(
167
        DIRECTORY   "${superbuild_install_location}/${python_prefix}/Lib/site-packages/win32"
168 169 170
        DESTINATION "bin/Lib/site-packages"
        COMPONENT   "superbuild")
      install(
171 172
        FILES       "${superbuild_install_location}/${python_prefix}/Lib/site-packages/pywin32.pth"
                    "${superbuild_install_location}/${python_prefix}/Lib/site-packages/pywin32.version.txt"
173 174 175
        DESTINATION "bin/Lib/site-packages"
        COMPONENT   "superbuild")
  endif ()
176 177 178
endif ()

if (paraviewweb_enabled)
179 180 181 182
  install(
    DIRECTORY   "${superbuild_install_location}/share/paraview/web"
    DESTINATION "share/paraview-${paraview_version}"
    COMPONENT   "superbuild")
183 184
endif ()

185
foreach (qt5_plugin_path IN LISTS qt5_plugin_paths)
186
  get_filename_component(qt5_plugin_group "${qt5_plugin_path}" DIRECTORY)
187 188 189 190
  get_filename_component(qt5_plugin_group "${qt5_plugin_group}" NAME)

  superbuild_windows_install_plugin(
    "${qt5_plugin_path}"
191
    "bin"
192
    "bin/${qt5_plugin_group}"
193
    SEARCH_DIRECTORIES "${library_paths}")
194 195
endforeach ()

196 197 198 199 200
if (qt5_enabled)
  foreach (qt5_opengl_lib IN ITEMS opengl32sw libEGL libGLESv2)
    superbuild_windows_install_plugin(
      "${Qt5_DIR}/../../../bin/${qt5_opengl_lib}.dll"
      "bin"
201 202
      "bin"
      SEARCH_DIRECTORIES "${library_paths}")
203 204 205
  endforeach ()
endif ()

206
paraview_install_extra_data()