paraview.bundle.cmake 5.4 KB
Newer Older
Ben Boeckel's avatar
Ben Boeckel committed
1
set(paraview_doc_dir "doc")
2
set(paraview_data_dir "examples")
3
set(paraview_materials_dir "materials")
4
set(paraview_plugin_path "bin/plugins")
Ben Boeckel's avatar
Ben Boeckel committed
5 6 7 8 9 10 11 12 13 14
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")
15 16 17 18 19
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
20 21 22 23 24 25 26

#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")

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

Ben Boeckel's avatar
Ben Boeckel committed
32 33 34 35 36 37 38
# 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 ()

39
  superbuild_windows_install_program("${executable}" "bin" SEARCH_DIRECTORIES
Ben Boeckel's avatar
Ben Boeckel committed
40 41 42
    "${library_paths}")
endforeach()

43 44
foreach (paraview_plugin IN LISTS paraview_plugins)
  superbuild_windows_install_plugin("${paraview_plugin}.dll"
45 46
    "${paraview_plugin_path}/${paraview_plugin}" "bin/plugins/${paraview_plugin}" SEARCH_DIRECTORIES
    "${paraview_plugin_path}/${paraview_plugin}" "${library_paths}" "${superbuild_install_location}/bin")
47 48 49 50 51 52 53
endforeach ()

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

install(
  FILES       "${plugins_file}"
54
  DESTINATION "${paraview_plugin_path}"
55 56 57
  COMPONENT   superbuild
  RENAME      ".plugins")

58 59 60
if (nvidiaindex_enabled)
  set(nvidiaindex_libraries
    libdice
61 62 63 64 65 66 67 68 69
    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)
  endif()
70 71 72 73 74 75 76 77 78 79 80 81 82

  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 ()

83 84 85 86 87 88 89 90 91 92 93
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 ()

Ben Boeckel's avatar
Ben Boeckel committed
94 95 96 97 98 99 100
if (python_enabled)
  include(python.functions)
  superbuild_install_superbuild_python()

  superbuild_windows_install_python(
    MODULES paraview
            vtk
101
            vtkmodules
Ben Boeckel's avatar
Ben Boeckel committed
102
            ${python_modules}
103 104
    MODULE_DIRECTORIES  "${superbuild_install_location}/bin/Lib/site-packages"
                        "${superbuild_install_location}/lib/site-packages"
105
                        "${superbuild_install_location}/lib/python2.7/site-packages"
106 107
                        "${superbuild_install_location}/lib/paraview-${paraview_version_major}.${paraview_version_minor}/site-packages"
    SEARCH_DIRECTORIES  "lib" "${superbuild_install_location}/bin")
Ben Boeckel's avatar
Ben Boeckel committed
108 109 110 111 112 113 114 115 116

  if (matplotlib_enabled)
    install(
      DIRECTORY   "${superbuild_install_location}/bin/Lib/site-packages/matplotlib/mpl-data/"
      DESTINATION "bin/Lib/site-packages/matplotlib/mpl-data"
      COMPONENT   superbuild)
  endif ()
endif ()

117 118 119 120 121 122 123 124 125 126
if (paraviewweb_enabled)
  install(
    DIRECTORY   "${superbuild_install_location}/bin/Lib/site-packages/win32"
    DESTINATION "bin/Lib/site-packages"
    COMPONENT   "superbuild")
  install(
    FILES       "${superbuild_install_location}/bin/Lib/site-packages/pywin32.pth"
                "${superbuild_install_location}/bin/Lib/site-packages/pywin32.version.txt"
    DESTINATION "bin/Lib/site-packages"
    COMPONENT   "superbuild")
127 128 129 130
  install(
    DIRECTORY   "${superbuild_install_location}/share/paraview/web"
    DESTINATION "share/paraview-${paraview_version}"
    COMPONENT   "superbuild")
131 132
endif ()

133
foreach (qt5_plugin_path IN LISTS qt5_plugin_paths)
134
  get_filename_component(qt5_plugin_group "${qt5_plugin_path}" DIRECTORY)
135 136 137 138
  get_filename_component(qt5_plugin_group "${qt5_plugin_group}" NAME)

  superbuild_windows_install_plugin(
    "${qt5_plugin_path}"
139
    "bin"
140
    "bin/${qt5_plugin_group}"
141
    SEARCH_DIRECTORIES "${library_paths}")
142 143
endforeach ()

144 145 146 147 148
if (qt5_enabled)
  foreach (qt5_opengl_lib IN ITEMS opengl32sw libEGL libGLESv2)
    superbuild_windows_install_plugin(
      "${Qt5_DIR}/../../../bin/${qt5_opengl_lib}.dll"
      "bin"
149 150
      "bin"
      SEARCH_DIRECTORIES "${library_paths}")
151 152 153
  endforeach ()
endif ()

154
paraview_install_extra_data()