Commit c22450ee authored by Ben Boeckel's avatar Ben Boeckel

plugins: install .plugins file on a per-app basis

parent 5322a851
Pipeline #17809 passed with stage
set(cmb_plugins)
foreach (cmb_plugin IN LISTS cmb_plugins_to_install)
foreach (cmb_plugin IN LISTS cmb_plugins_all)
if (EXISTS "${superbuild_install_location}/Applications/ModelBuilder.app/Contents/Libraries/lib${cmb_plugin}.dylib")
list(APPEND cmb_plugins
${cmb_plugin})
set("cmb_plugin_path_${cmb_plugin}"
"${superbuild_install_location}/Applications/ModelBuilder.app/Contents/Libraries/lib${cmb_plugin}.dylib")
continue ()
endif ()
......@@ -9,6 +11,8 @@ foreach (cmb_plugin IN LISTS cmb_plugins_to_install)
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
${cmb_plugin})
set("cmb_plugin_path_${cmb_plugin}"
"${superbuild_install_location}/lib/${path}/lib${cmb_plugin}.dylib")
break ()
endif ()
......@@ -18,18 +22,28 @@ endforeach ()
set(python_modules)
if (pythongirderclient_enabled)
list(APPEND python_modules
six
requests
girder_client)
endif ()
foreach(program IN LISTS cmb_programs_to_install)
set(plugins "${cmb_plugins_${program}}")
set(plugin_paths)
foreach (plugin IN LISTS plugins)
if (NOT DEFINED "cmb_plugin_path_${plugin}")
message(FATAL_ERROR "The application ${program} needs the ${plugin} plugin, but it was not found.")
endif ()
list(APPEND plugin_paths
"${cmb_plugin_path_${plugin}}")
endforeach ()
superbuild_apple_create_app(
"\${CMAKE_INSTALL_PREFIX}/${cmb_package}"
"${program}.app"
"${superbuild_install_location}/Applications/${program}.app/Contents/MacOS/${program}"
CLEAN
PLUGINS ${cmb_plugins}
PLUGINS ${plugin_paths}
SEARCH_DIRECTORIES
"${superbuild_install_location}/lib")
foreach (icon_filename MacIcon.icns pvIcon.icns)
......@@ -60,10 +74,14 @@ foreach(program IN LISTS cmb_programs_to_install)
file(WRITE \"\${CMAKE_INSTALL_PREFIX}/${cmb_package}/${program}.app/Contents/Resources/qt.conf\" \"\")"
COMPONENT superbuild)
set(plugins_file "${CMAKE_CURRENT_BINARY_DIR}/${program}.plugins")
cmb_add_plugin("${plugins_file}" ${plugins})
install(
FILES "${cmb_plugins_file}"
FILES "${plugins_file}"
DESTINATION "${cmb_package}/${program}.app/Contents/Plugins"
COMPONENT superbuild)
COMPONENT superbuild
RENAME ".plugins")
superbuild_apple_install_python(
"\${CMAKE_INSTALL_PREFIX}/${cmb_package}"
......
......@@ -37,11 +37,8 @@ endif()
list(SORT cmb_programs_to_install)
list(REMOVE_DUPLICATES cmb_programs_to_install)
set(cmb_plugins_base_file "${CMAKE_CURRENT_BINARY_DIR}/plugins.xml")
file(WRITE "${cmb_plugins_base_file}" "<?xml version=\"1.0\"?>\n<Plugins>\n</Plugins>\n")
function (cmb_add_plugin input output)
file(READ "${input}" contents)
function (cmb_add_plugin output)
set(contents "<?xml version=\"1.0\"?>\n<Plugins>\n</Plugins>\n")
foreach (name IN LISTS ARGN)
set(plugin_directive " <Plugin name=\"${name}\" auto_load=\"1\" />\n")
string(REPLACE "</Plugins>" "${plugin_directive}</Plugins>" contents "${contents}")
......@@ -61,3 +58,29 @@ if (cmb_install_paraview_python)
pvbatch
pvpython)
endif ()
set(cmb_plugins_smtk
smtkDiscreteSessionPlugin
smtkExodusSessionPlugin
smtkPolygonSessionPlugin
smtkRemoteSessionPlugin
smtkRemusMeshOperatorPlugin)
if (cgm_enabled)
list(APPEND cmb_plugins_smtk
smtkCGMSessionPlugin)
endif ()
set(cmb_plugins_cmb
CMB_Plugin
ModelBridge_Plugin)
set(cmb_plugins_all
${cmb_plugins_smtk}
${cmb_plugins_cmb})
set(cmb_plugins_ModelBuilder
#${cmb_plugins_cmb} # Autoloaded
${cmb_plugins_smtk})
set(cmb_plugins_paraview
CMB_Plugin)
......@@ -15,20 +15,3 @@ set(cmb_install_paraview_server TRUE)
set(cmb_install_paraview_python TRUE)
include(cmb.bundle.common)
set(cmb_plugins
smtkDiscreteSessionPlugin
smtkExodusSessionPlugin
smtkPolygonSessionPlugin
smtkRemoteSessionPlugin
smtkRemusMeshOperatorPlugin
CMB_Plugin)
set(cmb_plugins_file "${CMAKE_CURRENT_BINARY_DIR}/.plugins")
cmb_add_plugin(
"${cmb_plugins_base_file}"
"${cmb_plugins_file}"
${cmb_plugins})
set(cmb_plugins_to_install
${cmb_plugins})
......@@ -10,29 +10,3 @@ set(cmb_install_paraview_server FALSE)
set(cmb_install_paraview_python TRUE)
include(cmb.bundle.common)
set(cmb_plugins
smtkDiscreteSessionPlugin
smtkExodusSessionPlugin
smtkPolygonSessionPlugin
smtkRemoteSessionPlugin
smtkRemusMeshOperatorPlugin
CMB_Plugin
ModelBridge_Plugin)
if (cgm_enabled)
list(APPEND cmb_plugins
smtkCGMSessionPlugin)
endif ()
set(cmb_plugins_file "${CMAKE_CURRENT_BINARY_DIR}/.plugins")
cmb_add_plugin(
"${cmb_plugins_base_file}"
"${cmb_plugins_file}"
${cmb_plugins})
set(cmb_plugins_to_install
${cmb_plugins})
list(REMOVE_ITEM cmb_plugins_to_install
CMB_Plugin
ModelBridge_Plugin)
set(plugins)
foreach (executable IN LISTS paraview_executables cmb_programs_to_install)
superbuild_unix_install_program("${executable}"
"paraview-${paraview_version};cmb-${cmb_version}")
list(APPEND plugins
${cmb_plugins_${executable}})
endforeach ()
foreach (plugin IN LISTS cmb_plugins_to_install)
list(REMOVE_DUPLICATES plugins)
foreach (plugin IN LISTS plugins)
superbuild_unix_install_plugin("lib${plugin}.so"
"cmb-${cmb_version}"
";paraview-${paraview_version};cmb-${cmb_version}"
......@@ -44,8 +49,11 @@ endif ()
include(python.functions)
superbuild_install_superbuild_python()
set(plugins_file "${CMAKE_CURRENT_BINARY_DIR}/.plugins")
cmb_add_plugin("${plugins_file}" ${plugins})
install(
FILES "${cmb_plugins_file}"
FILES "${plugins_file}"
DESTINATION "bin"
COMPONENT superbuild)
......
......@@ -20,6 +20,7 @@ if (USE_SYSTEM_qt4)
"${QT_LIBRARY_DIR}")
endif ()
set(plugins)
foreach (executable IN LISTS paraview_executables cmb_programs_to_install)
if (DEFINED "${executable}_description")
list(APPEND CPACK_NSIS_MENU_LINKS
......@@ -30,9 +31,13 @@ foreach (executable IN LISTS paraview_executables cmb_programs_to_install)
superbuild_windows_install_program("${executable}"
"${library_paths}")
list(APPEND plugins
${cmb_plugins_${executable}})
endforeach ()
foreach (plugin IN LISTS cmb_plugins_to_install)
list(REMOVE_DUPLICATES plugins)
foreach (plugin IN LISTS plugins)
superbuild_windows_install_plugin("${plugin}.dll"
"bin"
"${library_paths}")
......@@ -83,9 +88,11 @@ if (pythonrequests_enabled)
COMPONENT superbuild)
endif ()
# install the .plugins file
set(plugins_file "${CMAKE_CURRENT_BINARY_DIR}/.plugins")
cmb_add_plugin("${plugins_file}" ${plugins})
install(
FILES "${cmb_plugins_file}"
FILES "${plugins_file}"
DESTINATION "bin"
COMPONENT superbuild)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment