Commit e28d2972 authored by T.J. Corona's avatar T.J. Corona

Defer to SMTK's plugin config file generation if available

parent 15043922
......@@ -209,21 +209,36 @@ else()
if (smtk_FOUND)
# Create a custom .plugins xml file that contains all of the plugins made by
# the associated smtk. This file will be used to load plugins during testing.
include(SMTKPluginMacros)
if (WIN32)
set(plugins_file ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/plugins/.plugins)
else()
set(plugins_file ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/modelbuilder-${cmb_version}/plugins/.plugins)
endif()
set(contents "<?xml version=\"1.0\"?>\n<Plugins>\n</Plugins>\n")
foreach (plugin IN LISTS SMTK_PLUGINS)
get_property(${plugin}_location TARGET ${plugin} PROPERTY LOCATION)
set(plugin_directive
" <Plugin name=\"${plugin}\" filename=\"${${plugin}_location}\" auto_load=\"1\" />\n")
string(REPLACE "</Plugins>" "${plugin_directive}</Plugins>" contents "${contents}")
endforeach ()
file(WRITE "${plugins_file}" "${contents}")
# In between SMTK 3.0.1 and 3.1.0, a feature was introduced to SMTK that
# enabled it to generate plugin configuration files for ParaView-branded
# consuming applications. This logic also allowed the plugin creator to flag
# whether or not the plugin should be automatically loaded (for required
# plugins). To preserve backwards-compatibility, we key off of the existence
# of this CMake function and fall back to generating our own configuration
# file if it does not exist.
include(CheckFunctionExists)
if (COMMAND generate_smtk_plugin_config_file)
generate_smtk_plugin_config_file(${plugins_file})
else()
set(contents "<?xml version=\"1.0\"?>\n<Plugins>\n</Plugins>\n")
foreach (plugin IN LISTS SMTK_PLUGINS)
get_property(${plugin}_location TARGET ${plugin} PROPERTY LOCATION)
set(plugin_directive
" <Plugin name=\"${plugin}\" filename=\"${${plugin}_location}\" auto_load=\"1\" />\n")
string(REPLACE "</Plugins>" "${plugin_directive}</Plugins>" contents "${contents}")
endforeach ()
file(WRITE "${plugins_file}" "${contents}")
endif()
set(plugin_dir ${CMAKE_INSTALL_PREFIX}/${PARAVIEW_INSTALL_PLUGINS_DIR})
if (APPLE AND NOT PARAVIEW_DO_UNIX_STYLE_INSTALLS)
......
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