diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2017-10-01 00:56:03 +0100 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2017-12-14 08:43:57 +0000 |
commit | 995812c5f1add94df1c237596939130c1704b099 (patch) | |
tree | 42542c56b9a70c7d2d231c8bc36649be35af46b4 /cmake | |
parent | a9821caab8a1f2c6e265bd5b63a060f1f241c704 (diff) |
Refactor plugin registration and loading
Put different types of plugins (libwiretap, libwireshark) in different
subdirectories, give libwiretap and libwireshark init routines that
load the plugins, and have them scan the appropriate subdirectories
so that we don't even *try* to, for example, load libwireshark plugins
in programs that only use libwiretap.
Compiled plugins are stored in subfolders of the plugin folders, with
the subfolder name being the Wireshark minor version number (X.Y). There is
another hierarchical level for each Wireshark library (libwireshark, libwscodecs
and libwiretap).
The folder names are respectively plugins/X.Y/{epan,codecs,wiretap}.
Currently we only distribute "epan" (libwireshark) plugins.
Change-Id: I3438787a6f45820d64ba4ca91cbe3c8864708acb
Reviewed-on: https://code.wireshark.org/review/23983
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/modules/WiresharkPlugin.cmake | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/cmake/modules/WiresharkPlugin.cmake b/cmake/modules/WiresharkPlugin.cmake index f6f85678dc..161b68fe4a 100644 --- a/cmake/modules/WiresharkPlugin.cmake +++ b/cmake/modules/WiresharkPlugin.cmake @@ -25,7 +25,7 @@ macro(SET_MODULE_INFO _plugin _ver_major _ver_minor _ver_micro _ver_extra) configure_file(plugin.rc.in plugin.rc @ONLY) endmacro() -macro(ADD_PLUGIN_LIBRARY _plugin) +macro(ADD_PLUGIN_LIBRARY _plugin _subfolder) add_library(${_plugin} MODULE ${PLUGIN_FILES} ${CMAKE_CURRENT_BINARY_DIR}/plugin.rc @@ -49,10 +49,18 @@ macro(ADD_PLUGIN_LIBRARY _plugin) foreach(_config_type ${CMAKE_CONFIGURATION_TYPES}) string(TOUPPER ${_config_type} _config_upper) set_target_properties(${_plugin} PROPERTIES - LIBRARY_OUTPUT_DIRECTORY_${_config_upper} ${CMAKE_BINARY_DIR}/run/${_config_type}/${PLUGIN_VERSION_DIR} + LIBRARY_OUTPUT_DIRECTORY_${_config_upper} ${CMAKE_BINARY_DIR}/run/${_config_type}/${PLUGIN_VERSION_DIR}/${_subfolder} ) endforeach() target_link_libraries(${_plugin} epan) add_dependencies(plugins ${_plugin}) endmacro() + +macro(INSTALL_PLUGIN _plugin _subfolder) + install(TARGETS ${_plugin} + LIBRARY DESTINATION ${PLUGIN_INSTALL_LIBDIR}/${_subfolder} NAMELINK_SKIP + RUNTIME DESTINATION ${PLUGIN_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${PLUGIN_INSTALL_LIBDIR} +) +endmacro() |