paraview.bundle.unix.cmake 5.15 KB
Newer Older
1
set(library_paths
2
  "${superbuild_install_location}/lib")
3

4
5
6
7
8
if (Qt5_DIR)
  list(APPEND library_paths
    "${Qt5_DIR}/../..")
endif ()

9
10
11
12
13
14
15
set(include_regexes)
if (fortran_enabled)
  list(APPEND include_regexes
    ".*/libgfortran"
    ".*/libquadmath")
endif ()

16
set(exclude_regexes)
17
18
if (PARAVIEW_DEFAULT_SYSTEM_GL OR
    (mesa_built_by_superbuild OR osmesa_built_by_superbuild))
19
20
  list(APPEND exclude_regexes
    ".*/libglapi"
Ben Boeckel's avatar
Ben Boeckel committed
21
    ".*/libGL")
22
23
endif ()

Ben Boeckel's avatar
Ben Boeckel committed
24
foreach (executable IN LISTS paraview_executables)
25
  superbuild_unix_install_program("${superbuild_install_location}/bin/${executable}"
26
    "lib"
27
    SEARCH_DIRECTORIES  "${library_paths}"
28
    INCLUDE_REGEXES     ${include_regexes}
29
    EXCLUDE_REGEXES     ${exclude_regexes})
Ben Boeckel's avatar
Ben Boeckel committed
30
31
endforeach ()

Ben Boeckel's avatar
Ben Boeckel committed
32
foreach (paraview_plugin IN LISTS paraview_plugins)
33
  superbuild_unix_install_plugin("${paraview_plugin}.so"
34
    "lib"
35
    "${paraview_plugin_path}/${paraview_plugin}"
36
37
38
    LOADER_PATHS    "${library_paths}"
    INCLUDE_REGEXES ${include_regexes}
    EXCLUDE_REGEXES ${exclude_regexes}
39
    LOCATION        "${paraview_plugin_path}/${paraview_plugin}/")
Ben Boeckel's avatar
Ben Boeckel committed
40
41
42
43
44
45
46
endforeach ()

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

install(
  FILES       "${plugins_file}"
47
  DESTINATION ${paraview_plugin_path}
Ben Boeckel's avatar
Ben Boeckel committed
48
49
50
  COMPONENT   superbuild
  RENAME      ".plugins")

51
if (mesa_libraries)
52
53
54
55
56
  set(suffix)
  if (PARAVIEW_DEFAULT_SYSTEM_GL)
    set(suffix "/mesa")
  endif ()

57
  foreach (mesa_library IN LISTS mesa_libraries)
58
59
60
61
62
63
    file(GLOB lib_filenames
      RELATIVE "${superbuild_install_location}/lib"
      "${superbuild_install_location}/lib/lib${mesa_library}.so*")

    foreach (lib_filename IN LISTS lib_filenames)
      superbuild_unix_install_plugin("${lib_filename}"
64
        "lib${suffix}"
65
        "lib"
66
        LOADER_PATHS  "${library_paths}"
67
        LOCATION      "lib${suffix}")
68
    endforeach ()
69
  endforeach ()
Ben Boeckel's avatar
Ben Boeckel committed
70
71
endif ()

72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
if (nvidiaindex_enabled)
  set(nvidiaindex_libraries
    dice
    nvindex
    nvrtc-builtins)

  foreach (nvidiaindex_library IN LISTS nvidiaindex_libraries)
    file(GLOB lib_filenames
      RELATIVE "${superbuild_install_location}/lib"
      "${superbuild_install_location}/lib/lib${nvidiaindex_library}.so*")

    foreach (lib_filename IN LISTS lib_filenames)
      superbuild_unix_install_plugin("${lib_filename}"
        "lib"
        "lib"
        LOADER_PATHS  "${library_paths}"
        LOCATION      "lib"
        EXCLUDE_REGEXES ".*/libcuda.so.*")
    endforeach ()
  endforeach ()
endif ()

94
95
96
97
98
99
100
101
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)
    file(GLOB lib_filenames
      RELATIVE "${superbuild_install_location}/lib"
      "${superbuild_install_location}/lib/lib${osprayextra_library}.so*")

    foreach (lib_filename IN LISTS lib_filenames)
      superbuild_unix_install_plugin("${lib_filename}"
        "lib"
        "lib"
        LOADER_PATHS  "${library_paths}"
        LOCATION      "lib")
    endforeach ()
  endforeach ()
endif ()

Ben Boeckel's avatar
Ben Boeckel committed
113
if (python_enabled)
114
115
  file(GLOB egg_dirs
    "${superbuild_install_location}/lib/python2.7/site-packages/*.egg/")
Ben Boeckel's avatar
Ben Boeckel committed
116
  include(python.functions)
117
  superbuild_install_superbuild_python(
118
    LIBSUFFIX "/python2.7")
Ben Boeckel's avatar
Ben Boeckel committed
119
120

  superbuild_unix_install_python(
121
    LIBDIR              "lib"
122
123
    MODULES             paraview
                        vtk
124
                        vtkmodules
125
                        ${python_modules}
126
    INCLUDE_REGEXES     ${include_regexes}
127
    EXCLUDE_REGEXES     ${exclude_regexes}
128
    MODULE_DIRECTORIES  "${superbuild_install_location}/lib/python2.7/site-packages"
129
                        ${egg_dirs}
130
    LOADER_PATHS        "${library_paths}")
131

132
  if (matplotlib_built_by_superbuild)
Ben Boeckel's avatar
Ben Boeckel committed
133
134
135
136
137
138
139
    install(
      DIRECTORY   "${superbuild_install_location}/lib/python2.7/site-packages/matplotlib/mpl-data/"
      DESTINATION "lib/python2.7/site-packages/matplotlib/mpl-data"
      COMPONENT   superbuild)
  endif ()
endif ()

140
if (mpi_built_by_superbuild)
Ben Boeckel's avatar
Ben Boeckel committed
141
  set(mpi_executables_standalone
142
143
    mpiexec
    hydra_pmi_proxy)
Ben Boeckel's avatar
Ben Boeckel committed
144
145
  set(mpi_executables_paraview
    hydra_nameserver
146
    hydra_persist)
Ben Boeckel's avatar
Ben Boeckel committed
147
148
  foreach (mpi_executable IN LISTS mpi_executables_standalone)
    superbuild_unix_install_plugin("${superbuild_install_location}/bin/${mpi_executable}"
Ben Boeckel's avatar
Ben Boeckel committed
149
150
      "lib"
      "bin")
Ben Boeckel's avatar
Ben Boeckel committed
151
  endforeach ()
Ben Boeckel's avatar
Ben Boeckel committed
152
153
  foreach (mpi_executable IN LISTS mpi_executables_standalone mpi_executables_paraview)
    superbuild_unix_install_plugin("${superbuild_install_location}/bin/${mpi_executable}"
154
155
      "lib"
      "lib")
Ben Boeckel's avatar
Ben Boeckel committed
156
  endforeach ()
Ben Boeckel's avatar
Ben Boeckel committed
157
endif ()
158

159
if (qt5_enabled AND qt5_plugin_paths)
Ben Boeckel's avatar
Ben Boeckel committed
160
161
162
  file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" "")
  install(
    FILES       "${CMAKE_CURRENT_BINARY_DIR}/qt.conf"
163
    DESTINATION "lib"
Ben Boeckel's avatar
Ben Boeckel committed
164
165
166
167
168
169
170
171
    COMPONENT   superbuild)
endif ()

foreach (qt5_plugin_path IN LISTS qt5_plugin_paths)
  get_filename_component(qt5_plugin_group "${qt5_plugin_path}" DIRECTORY)
  get_filename_component(qt5_plugin_group "${qt5_plugin_group}" NAME)

  superbuild_unix_install_plugin("${qt5_plugin_path}"
172
173
    "lib"
    "lib/plugins/${qt5_plugin_group}/"
174
175
176
    LOADER_PATHS    "${library_paths}"
    INCLUDE_REGEXES ${include_regexes}
    EXCLUDE_REGEXES ${exclude_regexes})
Ben Boeckel's avatar
Ben Boeckel committed
177
178
endforeach ()

179
paraview_install_extra_data()