cmb.bundle.apple.cmake 3.59 KB
Newer Older
Ben Boeckel's avatar
Ben Boeckel committed
1
2
set(cmb_plugins)
foreach (cmb_plugin IN LISTS cmb_plugins_to_install)
3
4
5
6
7
8
  if (EXISTS "${superbuild_install_location}/Applications/ModelBuilder.app/Contents/Libraries/lib${cmb_plugin}.dylib")
    list(APPEND cmb_plugins
      "${superbuild_install_location}/Applications/ModelBuilder.app/Contents/Libraries/lib${cmb_plugin}.dylib")
    continue ()
  endif ()

Ben Boeckel's avatar
Ben Boeckel committed
9
10
11
12
13
14
15
16
17
  foreach (path IN ITEMS "" "cmb-${cmb_version}" "paraview-${paraview_version}")
    if (EXISTS "${superbuild_install_location}/lib/${path}/lib${cmb_plugin}.dylib")
      list(APPEND cmb_plugins
        "${superbuild_install_location}/lib/${path}/lib${cmb_plugin}.dylib")
      break ()
    endif ()
  endforeach ()
endforeach ()

18
19
20
21
22
23
24
25
set(python_modules)
if (pythongirderclient_enabled)
  list(APPEND python_modules
    six
    requests
    girder_client)
endif ()

Ben Boeckel's avatar
Ben Boeckel committed
26
27
28
29
30
31
32
33
34
foreach(program IN LISTS cmb_programs_to_install)
  superbuild_apple_create_app(
    "\${CMAKE_INSTALL_PREFIX}/${cmb_package}"
    "${program}.app"
    "${superbuild_install_location}/Applications/${program}.app/Contents/MacOS/${program}"
    CLEAN
    PLUGINS ${cmb_plugins}
    SEARCH_DIRECTORIES
            "${superbuild_install_location}/lib")
35
36
37
38
39
40
41
42
  foreach (icon_filename MacIcon.icns pvIcon.icns)
    set(icon_path "${superbuild_install_location}/Applications/${program}.app/Contents/Resources/${icon_filename}")
    if (EXISTS "${icon_path}")
      install(
        FILES       "${icon_path}"
        DESTINATION "${cmb_package}/${program}.app/Contents/Resources"
        COMPONENT   superbuild)
    endif ()
Ben Boeckel's avatar
Ben Boeckel committed
43
  endforeach ()
44
45
46
47
  install(
    FILES       "${superbuild_install_location}/Applications/${program}.app/Contents/Info.plist"
    DESTINATION "${cmb_package}/${program}.app/Contents"
    COMPONENT   superbuild)
Ben Boeckel's avatar
Ben Boeckel committed
48

49
50
51
52
53
54
55
56
57
  foreach (executable IN LISTS paraview_executables)
    superbuild_apple_install_utility(
      "\${CMAKE_INSTALL_PREFIX}/${cmb_package}"
      "${program}.app"
      "${superbuild_install_location}/Applications/paraview.app/Contents/bin/${executable}"
      SEARCH_DIRECTORIES
              "${superbuild_install_location}/lib")
  endforeach ()

Ben Boeckel's avatar
Ben Boeckel committed
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
  install(CODE
    "file(MAKE_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/${cmb_package}/${program}.app/Contents/Resources\")
    file(WRITE \"\${CMAKE_INSTALL_PREFIX}/${cmb_package}/${program}.app/Contents/Resources/qt.conf\" \"\")"
    COMPONENT superbuild)

  install(
    FILES       "${cmb_plugins_file}"
    DESTINATION "${cmb_package}/${program}.app/Contents/Plugins"
    COMPONENT   superbuild)

  superbuild_apple_install_python(
    "\${CMAKE_INSTALL_PREFIX}/${cmb_package}"
    "${program}.app"
    MODULES smtk
            shiboken
73
            ${python_modules}
Ben Boeckel's avatar
Ben Boeckel committed
74
75
76
77
78
79
80
81
82
83
    MODULE_DIRECTORIES
            "${superbuild_install_location}/lib/python2.7/site-packages"
    SEARCH_DIRECTORIES
            "${superbuild_install_location}/lib")

  superbuild_apple_install_python(
    "\${CMAKE_INSTALL_PREFIX}/${cmb_package}"
    "${program}.app"
    MODULES paraview
            pygments
84
            six
Ben Boeckel's avatar
Ben Boeckel committed
85
86
87
88
89
            vtk
    MODULE_DIRECTORIES
            "${superbuild_install_location}/Applications/paraview.app/Contents/Python"
    SEARCH_DIRECTORIES
            "${superbuild_install_location}/Applications/paraview.app/Contents/Libraries")
90
91
92
93
94
95
96

  if (pythonrequests_enabled)
    install(
      FILES       "${superbuild_install_location}/lib/python2.7/site-packages/requests/cacert.pem"
      DESTINATION "${cmb_package}/${program}.app/Contents/Python/requests"
      COMPONENT   superbuild)
  endif ()
Ben Boeckel's avatar
Ben Boeckel committed
97
98
99
100
101
102
103
endforeach ()

# FIXME: Install inside of each application?
install(
  DIRECTORY   "${superbuild_install_location}/share/cmb/workflows/"
  DESTINATION "Workflows"
  COMPONENT   superbuild)