cmb.bundle.common.cmake 6.02 KB
Newer Older
Ben Boeckel's avatar
Ben Boeckel committed
1 2 3 4 5 6 7 8
# Consolidates platform independent stub for cmb.bundle.cmake files.

include(cmb-version)
include(paraview-version)

set(CPACK_PACKAGE_VENDOR "Kitware, Inc.")
set(CPACK_PACKAGE_VERSION_MAJOR ${cmb_version_major})
set(CPACK_PACKAGE_VERSION_MINOR ${cmb_version_minor})
9 10 11 12
set(CPACK_PACKAGE_VERSION_PATCH ${cmb_version_patch}${cmb_version_suffix})
if (CMB_PACKAGE_SUFFIX)
  set(CPACK_PACKAGE_VERSION_PATCH ${CPACK_PACKAGE_VERSION_PATCH}-${CMB_PACKAGE_SUFFIX})
endif ()
Ben Boeckel's avatar
Ben Boeckel committed
13

14 15 16
if (NOT DEFINED package_filename)
  set(package_filename "${CMB_PACKAGE_FILE_NAME}")
endif ()
Ben Boeckel's avatar
Ben Boeckel committed
17

18 19 20
if (package_filename)
  set(CPACK_PACKAGE_FILE_NAME "${package_filename}")
else ()
Ben Boeckel's avatar
Ben Boeckel committed
21
  set(CPACK_PACKAGE_FILE_NAME
22
    "${cmb_package_name}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
23 24 25 26 27
endif ()

# Set the license file.
set(CPACK_RESOURCE_FILE_LICENSE
    "${superbuild_source_directory}/License.txt")
Ben Boeckel's avatar
Ben Boeckel committed
28 29 30 31

list(SORT cmb_programs_to_install)
list(REMOVE_DUPLICATES cmb_programs_to_install)

32 33
function (cmb_add_plugin output)
  set(contents "<?xml version=\"1.0\"?>\n<Plugins>\n</Plugins>\n")
Ben Boeckel's avatar
Ben Boeckel committed
34
  foreach (name IN LISTS ARGN)
35
    set(plugin_directive "  <Plugin name=\"${name}\" auto_load=\"0\" />\n")
Ben Boeckel's avatar
Ben Boeckel committed
36 37 38 39
    string(REPLACE "</Plugins>" "${plugin_directive}</Plugins>" contents "${contents}")
  endforeach ()
  file(WRITE "${output}" "${contents}")
endfunction ()
40 41 42 43 44 45 46 47 48 49 50 51 52

set(paraview_executables)
if (cmb_install_paraview_server)
  list(APPEND paraview_executables
    pvserver
    pvdataserver
    pvrenderserver)
endif ()
if (cmb_install_paraview_python)
  list(APPEND paraview_executables
    pvbatch
    pvpython)
endif ()
53

54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
# Currently, ModelBuilder is predominantly ParaView + a suite of plugins from
# SMTK. As the latest iteration of ModelBuilder developed, we encountered
# inconsistencies during development & packaging with the automatic inclusion of
# SMTK's plugins. As a workaround, we created a library in SMTK named
# "smtkDefaultPlugins" that links against the plugins SMTK has been configured
# to build and exposes methods for programatically setting them up in
# ModelBuilder.
#
# When ModelBuilder links against smtkDefaultPlugins, the packager treats
# smtkDefaultPlugins' dependent libraries (the plugins) as libraries and
# puts them with the rest of the libraries. The code below is a hand-maintained
# whitelist of SMTK's plugins; the packager treats these as plugins and puts
# them in a plugins directory. When the packager comes across a plugin that is
# also linked as a library, it gets confused and installs it into both the
# library and plugin directories, but only fixes the runtime paths for the
# copy in the plugin directory.
#
# SMTK's ability to create a library that links its plugins into a consuming
# application is currently less fault-prone than ParaView's default plugin
# system. Future updates to ParaView may obviate the need for this ability,
# however. Until then, we disable the following logic for SMTK's plugins.
set(LINK_TO_PLUGINS True)
if (NOT ${LINK_TO_PLUGINS})
  set(cmb_plugins_smtk
    smtkAttributePlugin
    smtkDelaunayPlugin
    smtkDiscreteSessionPlugin
    smtkMeshPlugin
    smtkMeshSessionPlugin
    smtkModelPlugin
    smtkOpenCVPlugin
    smtkOperationPlugin
    smtkPQComponentsPlugin
    smtkPQOperationViewsPlugin
    smtkPVServerExtPlugin
    smtkPolygonSessionPlugin
    smtkRemusMeshOperationPlugin
    smtkVTKOperationsPlugin
  )

  if (matplotlib_enabled)
    list(APPEND cmb_plugins_smtk
      smtkMatplotlibPlugin)
  endif ()
98

99 100 101 102 103
  if (vxl_enabled)
    list(APPEND cmb_plugins_smtk
      smtkVXLOperationViewsPlugin)
  endif ()
endif()
104

105 106 107
set(cmb_plugins_cmb
  cmbPostProcessingModePlugin
)
108

109 110 111 112 113 114 115
set(cmb_plugins_standalone)
if (smtkprojectmanager_enabled)
  list(APPEND cmb_plugins_standalone smtkProjectManagerPlugin)
endif()
if (smtkresourcemanagerstate_enabled)
  list(APPEND cmb_plugins_standalone smtkReadWriteResourceManagerStatePlugin)
endif()
116

117 118 119 120 121
if (cumulus_enabled)
  set(cmb_plugins_paraview
    SLACTools
  )
endif()
122

123 124 125 126 127
set(cmb_additional_libraries)
foreach (boost_lib IN LISTS BOOST_ADDITIONAL_LIBRARIES)
  list(APPEND cmb_additional_libraries boost_${boost_lib})
endforeach ()

128 129 130
set(cmb_python_modules
  smtk
  paraview
131
  cinema_python
132 133
  pygments
  six
134 135
  vtk
  vtkmodules)
136

T.J. Corona's avatar
T.J. Corona committed
137 138 139 140 141
if (matplotlib_enabled)
  list(APPEND cmb_python_modules
    matplotlib)
endif ()

142 143 144 145 146 147 148
if (numpy_enabled)
  list(APPEND cmb_python_modules
    numpy)
endif ()

if (pythongirderclient_enabled)
  list(APPEND cmb_python_modules
149
    diskcache
150
    requests
151
    requests_toolbelt
152 153
    girder_client)
endif ()
154 155

if (paraviewweb_enabled)
156
  list(APPEND cmb_python_modules
157
    autobahn
158 159
    constantly
    incremental
160
    twisted
161
    wslink
162 163 164
    zope)

  if (WIN32)
165
    list(APPEND cmb_python_modules
166 167 168 169 170 171
      adodbapi
      isapi
      pythoncom
      win32com)
  endif ()
endif ()
172

Ben Boeckel's avatar
Ben Boeckel committed
173 174 175 176 177 178 179 180 181 182 183 184 185 186
if (qt5_enabled)
  include(qt5.functions)

  set(qt5_plugin_prefix)
  if (NOT WIN32)
    set(qt5_plugin_prefix "lib")
  endif ()

  set(qt5_plugins
    sqldrivers/${qt5_plugin_prefix}qsqlite)

  if (WIN32)
    list(APPEND qt5_plugins
      platforms/qwindows)
187 188 189

    if (NOT qt5_version VERSION_LESS "5.10")
      list(APPEND qt5_plugins
190
        styles/qwindowsvistastyle)
191
    endif ()
Ben Boeckel's avatar
Ben Boeckel committed
192 193 194 195
  elseif (APPLE)
    list(APPEND qt5_plugins
      platforms/libqcocoa
      printsupport/libcocoaprintersupport)
196 197 198 199 200

    if (NOT qt5_version VERSION_LESS "5.10")
      list(APPEND qt5_plugins
        styles/libqmacstyle)
    endif ()
Ben Boeckel's avatar
Ben Boeckel committed
201 202 203 204 205 206 207 208 209 210 211 212
  elseif (UNIX)
    list(APPEND qt5_plugins
      platforms/libqxcb
      platforminputcontexts/libcomposeplatforminputcontextplugin
      xcbglintegrations/libqxcb-glx-integration)
  endif ()

  superbuild_install_qt5_plugin_paths(qt5_plugin_paths ${qt5_plugins})
else ()
  set(qt5_plugin_paths)
endif ()

213 214 215 216 217 218 219 220 221 222 223 224 225 226 227
function (cmb_install_pdf project filename)
  if (${project}_enabled)
    install(
      FILES       "${superbuild_install_location}/doc/${filename}"
      DESTINATION "${cmb_doc_dir}"
      COMPONENT   superbuild)
  endif ()
endfunction ()

function (cmb_install_extra_data)
  if (cmb_doc_dir)
    cmb_install_pdf(cmbusersguide "CMBUsersGuide.pdf")
    cmb_install_pdf(smtkusersguide "SMTKUsersGuide.pdf")
  endif ()
endfunction ()