cmb.bundle.unix.cmake 3 KB
Newer Older
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}")
5

6 7 8 9 10
if (QT_LIBRARY_DIR)
  list(APPEND library_paths
    "${QT_LIBRARY_DIR}")
endif ()

11
set(plugins)
Ben Boeckel's avatar
Ben Boeckel committed
12
foreach (executable IN LISTS paraview_executables cmb_programs_to_install)
13 14 15
  superbuild_unix_install_program_fwd("${executable}"
    "lib/paraview-${paraview_version};lib/cmb-${cmb_version}"
    SEARCH_DIRECTORIES "${library_paths}")
16 17
  list(APPEND plugins
    ${cmb_plugins_${executable}})
Ben Boeckel's avatar
Ben Boeckel committed
18 19
endforeach ()

20 21 22
list(REMOVE_DUPLICATES plugins)

foreach (plugin IN LISTS plugins)
Ben Boeckel's avatar
Ben Boeckel committed
23
  superbuild_unix_install_plugin("lib${plugin}.so"
24 25 26 27
    "lib/cmb-${cmb_version}"
    "lib;lib/cmb-${cmb_version}"
    SEARCH_DIRECTORIES  "${library_paths}"
    LOCATION            "lib/cmb-${cmb_version}/plugins/${plugin}/")
Ben Boeckel's avatar
Ben Boeckel committed
28 29 30
endforeach ()

superbuild_unix_install_python(
31 32 33 34 35
  LIBDIR              "lib/cmb-${cmb_version}"
  MODULES             ${cmb_python_modules}
  MODULE_DIRECTORIES  "${superbuild_install_location}/lib/python2.7/site-packages"
                      "${superbuild_install_location}/lib/paraview-${paraview_version}/site-packages"
  SEARCH_DIRECTORIES  "${library_paths}")
Ben Boeckel's avatar
Ben Boeckel committed
36

37
superbuild_unix_install_python(
38 39 40 41 42
  MODULE_DESTINATION  "/site-packages/paraview"
  LIBDIR              "lib/cmb-${cmb_version}"
  MODULES             vtk
  MODULE_DIRECTORIES "${superbuild_install_location}/lib/paraview-${paraview_version}/site-packages"
  SEARCH_DIRECTORIES "${library_paths}")
43

44 45
if (cmb_install_paraview_python)
  superbuild_unix_install_python(
46 47 48 49 50
    LIBDIR              "lib/paraview-${paraview_version}"
    MODULES             paraview vtk
    MODULE_DIRECTORIES  "${superbuild_install_location}/lib/python2.7/site-packages"
                        "${superbuild_install_location}/lib/paraview-${paraview_version}/site-packages"
    SEARCH_DIRECTORIES  "${library_paths}")
51 52

  superbuild_unix_install_python(
53 54 55 56 57
    MODULE_DESTINATION  "/site-packages/paraview"
    LIBDIR              "lib/paraview-${paraview_version}"
    MODULES             vtk
    MODULE_DIRECTORIES "${superbuild_install_location}/lib/paraview-${paraview_version}/site-packages"
    SEARCH_DIRECTORIES "${library_paths}")
58 59
endif ()

60 61 62
if (pythonrequests_enabled)
  install(
    FILES       "${superbuild_install_location}/lib/python2.7/site-packages/requests/cacert.pem"
63
    DESTINATION "lib/python2.7/site-packages/requests"
64 65 66
    COMPONENT   superbuild)
endif ()

67 68 69
include(python.functions)
superbuild_install_superbuild_python()

70 71 72
set(plugins_file "${CMAKE_CURRENT_BINARY_DIR}/.plugins")
cmb_add_plugin("${plugins_file}" ${plugins})

Ben Boeckel's avatar
Ben Boeckel committed
73
install(
74
  FILES       "${plugins_file}"
Ben Boeckel's avatar
Ben Boeckel committed
75 76 77 78 79 80 81
  DESTINATION "bin"
  COMPONENT   superbuild)

install(
  DIRECTORY   "${superbuild_install_location}/share/cmb/workflows/"
  DESTINATION "share/cmb/workflows"
  COMPONENT   superbuild)
82 83 84 85

# ParaView expects this directory to exist.
install(CODE
  "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/lib/paraview-${paraview_version}\")"
86
  COMPONENT   superbuild)