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

Use relative paths in plugin config file

parent 3c01d3cd
......@@ -209,14 +209,17 @@ 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(plugin_dir ${CMAKE_INSTALL_PREFIX}/${PARAVIEW_INSTALL_PLUGINS_DIR})
if (APPLE AND NOT PARAVIEW_DO_UNIX_STYLE_INSTALLS)
set(plugin_dir "${MACOSX_APP_INSTALL_PREFIX}/modelbuilder.app/Contents/Plugins")
endif ()
# 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
......@@ -226,12 +229,16 @@ else()
# file if it does not exist.
include(CheckFunctionExists)
include(SMTKPluginMacros)
if (COMMAND generate_smtk_plugin_config_file)
generate_smtk_plugin_config_file(${plugins_file})
generate_smtk_plugin_config_file(${plugins_file}
RELATIVE_DIRECTORY ${plugin_dir})
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)
file(RELATIVE_PATH ${plugin}_location ${plugin_dir} ${${plugin}_location})
set(plugin_directive
" <Plugin name=\"${plugin}\" filename=\"${${plugin}_location}\" auto_load=\"1\" />\n")
string(REPLACE "</Plugins>" "${plugin_directive}</Plugins>" contents "${contents}")
......@@ -240,11 +247,6 @@ else()
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)
set(plugin_dir "${MACOSX_APP_INSTALL_PREFIX}/modelbuilder.app/Contents/Plugins")
endif ()
install(
FILES "${plugins_file}"
DESTINATION "${plugin_dir}"
......
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