cmb.bundle.unix.cmake 5.84 KB
Newer Older
Ben Boeckel's avatar
Ben Boeckel committed
1
set(library_paths
2
3
4
  "${superbuild_install_location}/lib"
  "${superbuild_install_location}/lib/paraview-${paraview_version}"
  "${superbuild_install_location}/lib/cmb-${cmb_version}")
Ben Boeckel's avatar
Ben Boeckel committed
5

6
if (Qt5_DIR)
Ben Boeckel's avatar
Ben Boeckel committed
7
  list(APPEND library_paths
8
    "${Qt5_DIR}/../..")
9
10
11
endif ()

if (qt5_built_by_superbuild OR Qt5_DIR)
12
13
  list(APPEND include_regexes
    ".*/libicu.*.so.*")
Ben Boeckel's avatar
Ben Boeckel committed
14
15
endif ()

16
17
18
19
20
if (cumulus_enabled)
  # Include libcrypt from the packaging machine.
  list(APPEND include_regexes
    ".*/libcrypt.so.*")
endif ()
Ben Boeckel's avatar
Ben Boeckel committed
21

22
23
if (USE_SYSTEM_qt5 AND Qt5_DIR)
  list(APPEND include_regexes
24
    ".*/libQt5.*")
25
26
endif ()

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

35
36
37
38
foreach (plugin_file IN LISTS all_plugin_files)
  # Get a list of plugins from this plugin file that need to be installed.
  get_filename_component(plugin_file_dir "${plugin_file}" DIRECTORY)
  foreach (plugin IN LISTS "plugins_${plugin_file}")
39
40
41
42
43
44
    # XXX(plugin): This should be `superbuild_unix_install_plugin`, but the binaries in
    # the CMB packages tend to link to no libraries which mean that no libraries get
    # installed to the main `lib` directory and the plugins then copy all of the libraries
    # into the plugin directory. Some way is needed to find the common libraries and keep
    # them in the `lib` directory should be found.
    superbuild_unix_install_module("${plugin}.so"
45
      "lib"
46
      "${plugin_file_dir}/${plugin}/"
47
      SEARCH_DIRECTORIES  "${library_paths}"
48
      LOCATION            "${plugin_file_dir}/${plugin}/"
49
50
51
52
      INCLUDE_REGEXES ${include_regexes}
      EXCLUDE_REGEXES ${exclude_regexes}
    )
  endforeach ()
53

54
55
56
57
  install(
    FILES       "${superbuild_install_location}/${plugin_file}"
    DESTINATION "${plugin_file_dir}"
    COMPONENT   "superbuild")
Ben Boeckel's avatar
Ben Boeckel committed
58
59
endforeach ()

60
foreach (library IN LISTS cmb_additional_libraries)
61
  superbuild_unix_install_module("lib${plugin}.so"
62
63
64
65
66
67
68
69
70
    "lib"
    "lib"
    SEARCH_DIRECTORIES  "${library_paths}"
    LOCATION            "lib"
    INCLUDE_REGEXES ${include_regexes}
    EXCLUDE_REGEXES ${exclude_regexes}
  )
endforeach ()

Ben Boeckel's avatar
Ben Boeckel committed
71
superbuild_unix_install_python(
72
  LIBDIR              "lib"
73
  MODULES             ${cmb_python_modules}
74
  MODULE_DIRECTORIES  "${superbuild_install_location}/lib/python${superbuild_python_version}/site-packages"
75
                      "${superbuild_install_location}/lib/paraview-${paraview_version}/site-packages"
76
77
78
  SEARCH_DIRECTORIES  "${library_paths}"
  INCLUDE_REGEXES ${include_regexes}
  EXCLUDE_REGEXES ${exclude_regexes})
Ben Boeckel's avatar
Ben Boeckel committed
79

80
81
if (cmb_install_paraview_python)
  superbuild_unix_install_python(
82
    LIBDIR              "lib"
83
    MODULES             paraview vtkmodules
84
    MODULE_DIRECTORIES  "${superbuild_install_location}/lib/python${superbuild_python_version}/site-packages"
85
                        "${superbuild_install_location}/lib/paraview-${paraview_version}/site-packages"
86
87
88
    SEARCH_DIRECTORIES  "${library_paths}"
    INCLUDE_REGEXES ${include_regexes}
    EXCLUDE_REGEXES ${exclude_regexes})
89
90

  superbuild_unix_install_python(
91
    MODULE_DESTINATION  "/site-packages/paraview"
92
    LIBDIR              "lib"
93
    MODULES             vtk
94
95
96
97
    MODULE_DIRECTORIES  "${superbuild_install_location}/lib/paraview-${paraview_version}/site-packages"
    SEARCH_DIRECTORIES  "${library_paths}"
    INCLUDE_REGEXES ${include_regexes}
    EXCLUDE_REGEXES ${exclude_regexes})
98
99
endif ()

100
101
if (pythonrequests_enabled)
  install(
102
103
    FILES       "${superbuild_install_location}/lib/python${superbuild_python_version}/site-packages/requests/cacert.pem"
    DESTINATION "lib/python${superbuild_python_version}/site-packages/requests"
104
105
106
    COMPONENT   superbuild)
endif ()

107
108
109
110
111
112
113
if (python2_enabled)
  include(python2.functions)
  superbuild_install_superbuild_python2()
elseif (python3_enabled)
  include(python3.functions)
  superbuild_install_superbuild_python3()
endif ()
114

115
116
117
if (paraviewweb_enabled)
  install(
    FILES       "${superbuild_install_location}/lib/paraview-${paraview_version}/site-packages/paraview/web/defaultProxies.json"
118
    DESTINATION "lib/python${superbuild_python_version}/site-packages/paraview/web"
119
120
121
122
123
124
125
    COMPONENT   "${paraview_component}")
  install(
    DIRECTORY   "${superbuild_install_location}/share/paraview/web"
    DESTINATION "share/paraview-${paraview_version}"
    COMPONENT   "${paraview_component}")
endif ()

126
127
foreach (program_to_install IN LISTS cmb_programs_to_install)
  if (EXISTS "${superbuild_install_location}/bin/${program_to_install}.conf")
Ben Boeckel's avatar
Ben Boeckel committed
128
    install(
129
      FILES       "${superbuild_install_location}/bin/${program_to_install}.conf"
Ben Boeckel's avatar
Ben Boeckel committed
130
131
132
      DESTINATION "bin"
      COMPONENT   "superbuild")
  endif ()
133
endforeach ()
134

135
if (cmb_workflow_dir)
136
137
  install(
    DIRECTORY   "${superbuild_install_location}/share/cmb/workflows/"
138
    DESTINATION ${cmb_workflow_dir}
139
140
    COMPONENT   superbuild)
endif ()
141

142
if (qt5_enabled AND (NOT USE_SYSTEM_qt5 OR Qt5_DIR))
Ben Boeckel's avatar
Ben Boeckel committed
143
  file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" "[Paths]\nPrefix = ..\n")
Ben Boeckel's avatar
Ben Boeckel committed
144
145
  install(
    FILES       "${CMAKE_CURRENT_BINARY_DIR}/qt.conf"
Ben Boeckel's avatar
Ben Boeckel committed
146
    DESTINATION "bin"
Ben Boeckel's avatar
Ben Boeckel committed
147
148
149
150
151
152
153
    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)

154
  superbuild_unix_install_module("${qt5_plugin_path}"
155
    "lib"
Ben Boeckel's avatar
Ben Boeckel committed
156
    "plugins/${qt5_plugin_group}/"
Ben Boeckel's avatar
Ben Boeckel committed
157
158
159
160
    LOADER_PATHS    "${library_paths}"
    INCLUDE_REGEXES ${include_regexes}
    EXCLUDE_REGEXES ${exclude_regexes})
endforeach ()
161
162
163

if (meshkit_enabled)
  foreach (meshkit_exe IN ITEMS coregen assygen)
164
    superbuild_unix_install_module("${superbuild_install_location}/meshkit/bin/${meshkit_exe}"
165
166
167
168
169
      "lib"
      "bin"
      SEARCH_DIRECTORIES "${library_paths}")
  endforeach ()
endif ()