From 6e6a1291d0b36fe97d0f684e1abdfe546aaeae7f Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Sun, 18 Jan 2015 13:27:13 -0800 Subject: CMake: Set an output directory for plugins. Redefine PLUGIN_DIR similar to DATAFILE_DIR and use it on all platforms. Add WiresharkPlugin.cmake so that we can start defining common macros for plugins/*/CMakeLists.txt. Load plugins in out-of-tree builds. Change-Id: I8c1359ed3cf8a71788b8320ff89dfe2d3969def2 Reviewed-on: https://code.wireshark.org/review/6640 Reviewed-by: Gerald Combs --- plugins/docsis/CMakeLists.txt | 43 +++------------------------------- plugins/ethercat/CMakeLists.txt | 43 +++------------------------------- plugins/gryphon/CMakeLists.txt | 43 +++------------------------------- plugins/irda/CMakeLists.txt | 43 +++------------------------------- plugins/m2m/CMakeLists.txt | 43 +++------------------------------- plugins/mate/CMakeLists.txt | 43 +++------------------------------- plugins/opcua/CMakeLists.txt | 42 ++++------------------------------ plugins/profinet/CMakeLists.txt | 43 +++------------------------------- plugins/stats_tree/CMakeLists.txt | 47 ++++---------------------------------- plugins/tpg/CMakeLists.txt | 25 +++++--------------- plugins/unistim/CMakeLists.txt | 42 ++++------------------------------ plugins/wimax/CMakeLists.txt | 43 +++------------------------------- plugins/wimaxasncp/CMakeLists.txt | 43 +++------------------------------- plugins/wimaxmacphy/CMakeLists.txt | 43 +++------------------------------- 14 files changed, 49 insertions(+), 537 deletions(-) (limited to 'plugins') diff --git a/plugins/docsis/CMakeLists.txt b/plugins/docsis/CMakeLists.txt index 1868831c4b..989c7482d6 100644 --- a/plugins/docsis/CMakeLists.txt +++ b/plugins/docsis/CMakeLists.txt @@ -19,29 +19,10 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # -# Create the Windows .rc file for the plugin. -# The values come from several files in the source, I can't see how to reuse them +include(WiresharkPlugin) # This info is from moduleinfo.nmake -set(PACKAGE docsis) -set(MODULE_VERSION_MAJOR 0) -set(MODULE_VERSION_MINOR 0) -set(MODULE_VERSION_MICRO 5) -set(MODULE_VERSION_EXTRA 0) -set(MODULE_VERSION "${MODULE_VERSION_MAJOR}.${MODULE_VERSION_MINOR}.${MODULE_VERSION_MICRO}.${MODULE_VERSION_EXTRA}") -set(RC_MODULE_VERSION "${MODULE_VERSION_MAJOR},${MODULE_VERSION_MINOR},${MODULE_VERSION_MICRO},${MODULE_VERSION_EXTRA}") - -# This info is from Makefile.common -set(PLUGIN_NAME ${PACKAGE}) - -# This info is from config.nmake -set(MSVC_VARIANT "${CMAKE_GENERATOR}") - -# The rc.in requires a plain VERSION variable -set(VERSION ${PROJECT_VERSION}) - -# Create the plugin.rc file from the template -configure_file(plugin.rc.in plugin.rc @ONLY) +set_module_info(docsis 0 0 5 0) # The sources for the plugin set(DISSECTOR_SRC @@ -115,28 +96,10 @@ register_dissector_files(plugin.c ${DISSECTOR_SRC} ) -add_library(docsis ${LINK_MODE_MODULE} - ${PLUGIN_FILES} - ${CMAKE_CURRENT_BINARY_DIR}/plugin.rc -) - -set_target_properties(docsis PROPERTIES - PREFIX "" - LINK_FLAGS "${WS_LINK_FLAGS}" - FOLDER "Plugins" -) - -if(ENABLE_APPLICATION_BUNDLE) - set_target_properties(docsis PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/PlugIns/wireshark - ) -endif() - -target_link_libraries(docsis epan) +add_plugin_library(docsis) install(TARGETS docsis LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} NAMELINK_SKIP RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} ) - diff --git a/plugins/ethercat/CMakeLists.txt b/plugins/ethercat/CMakeLists.txt index 3b07a4407f..9d491ef4f0 100644 --- a/plugins/ethercat/CMakeLists.txt +++ b/plugins/ethercat/CMakeLists.txt @@ -19,29 +19,10 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # -# Create the Windows .rc file for the plugin. -# The values come from several files in the source, I can't see how to reuse them +include(WiresharkPlugin) # This info is from moduleinfo.nmake -set(PACKAGE ethercat) -set(MODULE_VERSION_MAJOR 0) -set(MODULE_VERSION_MINOR 1) -set(MODULE_VERSION_MICRO 0) -set(MODULE_VERSION_EXTRA 0) -set(MODULE_VERSION "${MODULE_VERSION_MAJOR}.${MODULE_VERSION_MINOR}.${MODULE_VERSION_MICRO}.${MODULE_VERSION_EXTRA}") -set(RC_MODULE_VERSION "${MODULE_VERSION_MAJOR},${MODULE_VERSION_MINOR},${MODULE_VERSION_MICRO},${MODULE_VERSION_EXTRA}") - -# This info is from Makefile.common -set(PLUGIN_NAME ${PACKAGE}) - -# This info is from config.nmake -set(MSVC_VARIANT "${CMAKE_GENERATOR}") - -# The rc.in requires a plain VERISON variable -set(VERSION ${PROJECT_VERSION}) - -# Create the plugin.rc file from the template -configure_file(plugin.rc.in plugin.rc @ONLY) +set_module_info(ethercat 0 1 0 0) set(DISSECTOR_SRC packet-ams.c @@ -77,28 +58,10 @@ register_dissector_files(plugin.c ${DISSECTOR_SRC} ) -add_library(ethercat ${LINK_MODE_MODULE} - ${PLUGIN_FILES} - ${CMAKE_CURRENT_BINARY_DIR}/plugin.rc -) - -set_target_properties(ethercat PROPERTIES - PREFIX "" - LINK_FLAGS "${WS_LINK_FLAGS}" - FOLDER "Plugins" -) - -if(ENABLE_APPLICATION_BUNDLE) - set_target_properties(ethercat PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/PlugIns/wireshark - ) -endif() - -target_link_libraries(ethercat epan) +add_plugin_library(ethercat) install(TARGETS ethercat LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} NAMELINK_SKIP RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} ) - diff --git a/plugins/gryphon/CMakeLists.txt b/plugins/gryphon/CMakeLists.txt index 9dca0f8a2b..c4e09c7bc6 100644 --- a/plugins/gryphon/CMakeLists.txt +++ b/plugins/gryphon/CMakeLists.txt @@ -19,29 +19,10 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # -# Create the Windows .rc file for the plugin. -# The values come from several files in the source, I can't see how to reuse them +include(WiresharkPlugin) # This info is from moduleinfo.nmake -set(PACKAGE gryphon) -set(MODULE_VERSION_MAJOR 0) -set(MODULE_VERSION_MINOR 0) -set(MODULE_VERSION_MICRO 4) -set(MODULE_VERSION_EXTRA 0) -set(MODULE_VERSION "${MODULE_VERSION_MAJOR}.${MODULE_VERSION_MINOR}.${MODULE_VERSION_MICRO}.${MODULE_VERSION_EXTRA}") -set(RC_MODULE_VERSION "${MODULE_VERSION_MAJOR},${MODULE_VERSION_MINOR},${MODULE_VERSION_MICRO},${MODULE_VERSION_EXTRA}") - -# This info is from Makefile.common -set(PLUGIN_NAME ${PACKAGE}) - -# This info is from config.nmake -set(MSVC_VARIANT "${CMAKE_GENERATOR}") - -# The rc.in requires a plain VERSION variable -set(VERSION ${PROJECT_VERSION}) - -# Create the plugin.rc file from the template -configure_file(plugin.rc.in plugin.rc @ONLY) +set_module_info(gryphon 0 0 4 0) set(DISSECTOR_SRC packet-gryphon.c @@ -71,28 +52,10 @@ register_dissector_files(plugin.c ${DISSECTOR_SRC} ) -add_library(gryphon ${LINK_MODE_MODULE} - ${PLUGIN_FILES} - ${CMAKE_CURRENT_BINARY_DIR}/plugin.rc -) - -set_target_properties(gryphon PROPERTIES - PREFIX "" - LINK_FLAGS "${WS_LINK_FLAGS}" - FOLDER "Plugins" -) - -if(ENABLE_APPLICATION_BUNDLE) - set_target_properties(gryphon PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/PlugIns/wireshark - ) -endif() - -target_link_libraries(gryphon epan) +add_plugin_library(gryphon) install(TARGETS gryphon LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} NAMELINK_SKIP RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} ) - diff --git a/plugins/irda/CMakeLists.txt b/plugins/irda/CMakeLists.txt index 67f168c575..f83632b2e6 100644 --- a/plugins/irda/CMakeLists.txt +++ b/plugins/irda/CMakeLists.txt @@ -19,29 +19,10 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # -# Create the Windows .rc file for the plugin. -# The values come from several files in the source, I can't see how to reuse them +include(WiresharkPlugin) # This info is from moduleinfo.nmake -set(PACKAGE irda) -set(MODULE_VERSION_MAJOR 0) -set(MODULE_VERSION_MINOR 0) -set(MODULE_VERSION_MICRO 6) -set(MODULE_VERSION_EXTRA 0) -set(MODULE_VERSION "${MODULE_VERSION_MAJOR}.${MODULE_VERSION_MINOR}.${MODULE_VERSION_MICRO}.${MODULE_VERSION_EXTRA}") -set(RC_MODULE_VERSION "${MODULE_VERSION_MAJOR},${MODULE_VERSION_MINOR},${MODULE_VERSION_MICRO},${MODULE_VERSION_EXTRA}") - -# This info is from Makefile.common -set(PLUGIN_NAME ${PACKAGE}) - -# This info is from config.nmake -set(MSVC_VARIANT "${CMAKE_GENERATOR}") - -# The rc.in requires a plain VERSION variable -set(VERSION ${PROJECT_VERSION}) - -# Create the plugin.rc file from the template -configure_file(plugin.rc.in plugin.rc @ONLY) +set_module_info(irda 0 0 6 0) set(DISSECTOR_SRC packet-ircomm.c @@ -73,28 +54,10 @@ register_dissector_files(plugin.c ${DISSECTOR_SRC} ) -add_library(irda ${LINK_MODE_MODULE} - ${PLUGIN_FILES} - ${CMAKE_CURRENT_BINARY_DIR}/plugin.rc -) - -set_target_properties(irda PROPERTIES - PREFIX "" - LINK_FLAGS "${WS_LINK_FLAGS}" - FOLDER "Plugins" -) - -if(ENABLE_APPLICATION_BUNDLE) - set_target_properties(irda PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/PlugIns/wireshark - ) -endif() - -target_link_libraries(irda epan) +add_plugin_library(irda) install(TARGETS irda LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} NAMELINK_SKIP RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} ) - diff --git a/plugins/m2m/CMakeLists.txt b/plugins/m2m/CMakeLists.txt index 5cb5c9923f..5df4d3c284 100644 --- a/plugins/m2m/CMakeLists.txt +++ b/plugins/m2m/CMakeLists.txt @@ -19,29 +19,10 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # -# Create the Windows .rc file for the plugin. -# The values come from several files in the source, I can't see how to reuse them +include(WiresharkPlugin) # This info is from moduleinfo.nmake -set(PACKAGE m2m) -set(MODULE_VERSION_MAJOR 1) -set(MODULE_VERSION_MINOR 1) -set(MODULE_VERSION_MICRO 0) -set(MODULE_VERSION_EXTRA 0) -set(MODULE_VERSION "${MODULE_VERSION_MAJOR}.${MODULE_VERSION_MINOR}.${MODULE_VERSION_MICRO}.${MODULE_VERSION_EXTRA}") -set(RC_MODULE_VERSION "${MODULE_VERSION_MAJOR},${MODULE_VERSION_MINOR},${MODULE_VERSION_MICRO},${MODULE_VERSION_EXTRA}") - -# This info is from Makefile.common -set(PLUGIN_NAME ${PACKAGE}) - -# This info is from config.nmake -set(MSVC_VARIANT "${CMAKE_GENERATOR}") - -# The rc.in requires a plain VERSION variable -set(VERSION ${PROJECT_VERSION}) - -# Create the plugin.rc file from the template -configure_file(plugin.rc.in plugin.rc @ONLY) +set_module_info(m2m 1 1 0 0) set(DISSECTOR_SRC packet-m2m.c @@ -76,28 +57,10 @@ register_dissector_files(plugin.c ${DISSECTOR_SRC} ) -add_library(m2m ${LINK_MODE_MODULE} - ${PLUGIN_FILES} - ${CMAKE_CURRENT_BINARY_DIR}/plugin.rc -) - -set_target_properties(m2m PROPERTIES - PREFIX "" - LINK_FLAGS "${WS_LINK_FLAGS}" - FOLDER "Plugins" -) - -if(ENABLE_APPLICATION_BUNDLE) - set_target_properties(m2m PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/PlugIns/wireshark - ) -endif() - -target_link_libraries(m2m epan) +add_plugin_library(m2m) install(TARGETS m2m LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} NAMELINK_SKIP RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} ) - diff --git a/plugins/mate/CMakeLists.txt b/plugins/mate/CMakeLists.txt index 6372e54d1b..66e76c95ad 100644 --- a/plugins/mate/CMakeLists.txt +++ b/plugins/mate/CMakeLists.txt @@ -19,29 +19,10 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # -# Create the Windows .rc file for the plugin. -# The values come from several files in the source, I can't see how to reuse them +include(WiresharkPlugin) # This info is from moduleinfo.nmake -set(PACKAGE mate) -set(MODULE_VERSION_MAJOR 1) -set(MODULE_VERSION_MINOR 0) -set(MODULE_VERSION_MICRO 0) -set(MODULE_VERSION_EXTRA 1) -set(MODULE_VERSION "${MODULE_VERSION_MAJOR}.${MODULE_VERSION_MINOR}.${MODULE_VERSION_MICRO}.${MODULE_VERSION_EXTRA}") -set(RC_MODULE_VERSION "${MODULE_VERSION_MAJOR},${MODULE_VERSION_MINOR},${MODULE_VERSION_MICRO},${MODULE_VERSION_EXTRA}") - -# This info is from Makefile.common -set(PLUGIN_NAME ${PACKAGE}) - -# This info is from config.nmake -set(MSVC_VARIANT "${CMAKE_GENERATOR}") - -# The rc.in requires a plain VERSION variable -set(VERSION ${PROJECT_VERSION}) - -# Create the plugin.rc file from the template -configure_file(plugin.rc.in plugin.rc @ONLY) +set_module_info(mate 1 0 0 1) set(DISSECTOR_SRC packet-mate.c @@ -92,28 +73,10 @@ register_dissector_files(plugin.c ${DISSECTOR_SRC} ) -add_library(mate ${LINK_MODE_MODULE} - ${PLUGIN_FILES} - ${CMAKE_CURRENT_BINARY_DIR}/plugin.rc -) - -set_target_properties(mate PROPERTIES - PREFIX "" - LINK_FLAGS "${WS_LINK_FLAGS}" - FOLDER "Plugins" -) - -if(ENABLE_APPLICATION_BUNDLE) - set_target_properties(mate PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/PlugIns/wireshark - ) -endif() - -target_link_libraries(mate epan) +add_plugin_library(mate) install(TARGETS mate LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} NAMELINK_SKIP RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} ) - diff --git a/plugins/opcua/CMakeLists.txt b/plugins/opcua/CMakeLists.txt index 8feeff1b0b..d628f8d965 100644 --- a/plugins/opcua/CMakeLists.txt +++ b/plugins/opcua/CMakeLists.txt @@ -19,26 +19,10 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # -# This info is from moduleinfo.nmake -set(PACKAGE opcua) -set(MODULE_VERSION_MAJOR 1) -set(MODULE_VERSION_MINOR 0) -set(MODULE_VERSION_MICRO 0) -set(MODULE_VERSION_EXTRA 0) -set(MODULE_VERSION "${MODULE_VERSION_MAJOR}.${MODULE_VERSION_MINOR}.${MODULE_VERSION_MICRO}.${MODULE_VERSION_EXTRA}") -set(RC_MODULE_VERSION "${MODULE_VERSION_MAJOR},${MODULE_VERSION_MINOR},${MODULE_VERSION_MICRO},${MODULE_VERSION_EXTRA}") - -# This info is from Makefile.common -set(PLUGIN_NAME ${PACKAGE}) - -# This info is from config.nmake -set(MSVC_VARIANT "${CMAKE_GENERATOR}") - -# The rc.in requires a plain VERSION variable -set(VERSION ${PROJECT_VERSION}) +include(WiresharkPlugin) -# Create the plugin.rc file from the template -configure_file(plugin.rc.in plugin.rc @ONLY) +# This info is from moduleinfo.nmake +set_module_info(opcua 1 0 0 0) set(DISSECTOR_SRC opcua.c @@ -83,28 +67,10 @@ register_dissector_files(plugin.c ${DISSECTOR_SRC} ) -add_library(opcua ${LINK_MODE_MODULE} - ${PLUGIN_FILES} - ${CMAKE_CURRENT_BINARY_DIR}/plugin.rc -) - -set_target_properties(opcua PROPERTIES - PREFIX "" - LINK_FLAGS "${WS_LINK_FLAGS}" - FOLDER "Plugins" -) - -if(ENABLE_APPLICATION_BUNDLE) - set_target_properties(opcua PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/PlugIns/wireshark - ) -endif() - -target_link_libraries(opcua epan) +add_plugin_library(opcua) install(TARGETS opcua LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} NAMELINK_SKIP RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} ) - diff --git a/plugins/profinet/CMakeLists.txt b/plugins/profinet/CMakeLists.txt index 45ff67ff92..30bf96f3aa 100644 --- a/plugins/profinet/CMakeLists.txt +++ b/plugins/profinet/CMakeLists.txt @@ -19,29 +19,10 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # -# Create the Windows .rc file for the plugin. -# The values come from several files in the source, I can't see how to reuse them +include(WiresharkPlugin) # This info is from moduleinfo.nmake -set(PACKAGE profinet) -set(MODULE_VERSION_MAJOR 0) -set(MODULE_VERSION_MINOR 2) -set(MODULE_VERSION_MICRO 4) -set(MODULE_VERSION_EXTRA 0) -set(MODULE_VERSION "${MODULE_VERSION_MAJOR}.${MODULE_VERSION_MINOR}.${MODULE_VERSION_MICRO}.${MODULE_VERSION_EXTRA}") -set(RC_MODULE_VERSION "${MODULE_VERSION_MAJOR},${MODULE_VERSION_MINOR},${MODULE_VERSION_MICRO},${MODULE_VERSION_EXTRA}") - -# This info is from Makefile.common -set(PLUGIN_NAME ${PACKAGE}) - -# This info is from config.nmake -set(MSVC_VARIANT "${CMAKE_GENERATOR}") - -# The rc.in requires a plain VERSION variable -set(VERSION ${PROJECT_VERSION}) - -# Create the plugin.rc file from the template -configure_file(plugin.rc.in plugin.rc @ONLY) +set_module_info(profinet 0 2 4 0) set(DISSECTOR_SRC packet-dcerpc-pn-io.c @@ -83,28 +64,10 @@ register_dissector_files(plugin.c ${DISSECTOR_SRC} ) -add_library(profinet ${LINK_MODE_MODULE} - ${PLUGIN_FILES} - ${CMAKE_CURRENT_BINARY_DIR}/plugin.rc -) - -set_target_properties(profinet PROPERTIES - PREFIX "" - LINK_FLAGS "${WS_LINK_FLAGS}" - FOLDER "Plugins" -) - -if(ENABLE_APPLICATION_BUNDLE) - set_target_properties(profinet PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/PlugIns/wireshark - ) -endif() - -target_link_libraries(profinet epan) +add_plugin_library(profinet) install(TARGETS profinet LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} NAMELINK_SKIP RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} ) - diff --git a/plugins/stats_tree/CMakeLists.txt b/plugins/stats_tree/CMakeLists.txt index 7cd16448bc..169ba3a2d3 100644 --- a/plugins/stats_tree/CMakeLists.txt +++ b/plugins/stats_tree/CMakeLists.txt @@ -19,37 +19,18 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # -# Create the Windows .rc file for the plugin. -# The values come from several files in the source, I can't see how to reuse them +include(WiresharkPlugin) # This info is from moduleinfo.nmake -set(PACKAGE stats_tree) -set(MODULE_VERSION_MAJOR 0) -set(MODULE_VERSION_MINOR 0) -set(MODULE_VERSION_MICRO 1) -set(MODULE_VERSION_EXTRA 0) -set(MODULE_VERSION "${MODULE_VERSION_MAJOR}.${MODULE_VERSION_MINOR}.${MODULE_VERSION_MICRO}.${MODULE_VERSION_EXTRA}") -set(RC_MODULE_VERSION "${MODULE_VERSION_MAJOR},${MODULE_VERSION_MINOR},${MODULE_VERSION_MICRO},${MODULE_VERSION_EXTRA}") +set_module_info(stats_tree 0 0 1 0) -# This info is from Makefile.common -set(PLUGIN_NAME ${PACKAGE}) - -# This info is from config.nmake -set(MSVC_VARIANT "${CMAKE_GENERATOR}") - -# The rc.in requires a plain VERSION variable -set(VERSION ${PROJECT_VERSION}) - -# Create the plugin.rc file from the template -configure_file(plugin.rc.in plugin.rc @ONLY) - -set(TAP_SRC +set(PLUGIN_FILES stats_tree_plugin.c pinfo_stats_tree.c ) set(CLEAN_FILES - ${TAP_SRC} + ${PLUGIN_FILES} ) if (WERROR) @@ -60,28 +41,10 @@ if (WERROR) ) endif() -add_library(stats_tree ${LINK_MODE_MODULE} - ${TAP_SRC} - ${CMAKE_CURRENT_BINARY_DIR}/plugin.rc -) - -set_target_properties(stats_tree PROPERTIES - PREFIX "" - LINK_FLAGS "${WS_LINK_FLAGS}" - FOLDER "Plugins" -) - -if(ENABLE_APPLICATION_BUNDLE) - set_target_properties(stats_tree PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/PlugIns/wireshark - ) -endif() - -target_link_libraries(stats_tree epan) +add_plugin_library(stats_tree) install(TARGETS stats_tree LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} NAMELINK_SKIP RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} ) - diff --git a/plugins/tpg/CMakeLists.txt b/plugins/tpg/CMakeLists.txt index 91c1f7a6cd..d28f97a298 100644 --- a/plugins/tpg/CMakeLists.txt +++ b/plugins/tpg/CMakeLists.txt @@ -19,6 +19,11 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # +include(WiresharkPlugin) + +# XXX No moduleinfo.nmake +# set_plugin_properties(tpg ...) + set(PLUGIN_FILES http-parser.c packet-http.c @@ -67,28 +72,10 @@ ADD_CUSTOM_COMMAND( ${CMAKE_CURRENT_SOURCE_DIR}/http.tpg ) -add_library(tpg ${LINK_MODE_MODULE} - ${PLUGIN_FILES} - plugin.rc -) - -set_target_properties(tpg PROPERTIES - PREFIX "" - LINK_FLAGS "${WS_LINK_FLAGS}" - FOLDER "Plugins" -) - -if(ENABLE_APPLICATION_BUNDLE) - set_target_properties(tpg PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/PlugIns/wireshark - ) -endif() - -target_link_libraries(tpg epan) +add_plugin_library(tpg) install(TARGETS tpg LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} NAMELINK_SKIP RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} ) - diff --git a/plugins/unistim/CMakeLists.txt b/plugins/unistim/CMakeLists.txt index f60689a402..91796fcd63 100644 --- a/plugins/unistim/CMakeLists.txt +++ b/plugins/unistim/CMakeLists.txt @@ -19,26 +19,10 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # -# This info is from moduleinfo.nmake -set(PACKAGE unistim) -set(MODULE_VERSION_MAJOR 0) -set(MODULE_VERSION_MINOR 0) -set(MODULE_VERSION_MICRO 2) -set(MODULE_VERSION_EXTRA 0) -set(MODULE_VERSION "${MODULE_VERSION_MAJOR}.${MODULE_VERSION_MINOR}.${MODULE_VERSION_MICRO}.${MODULE_VERSION_EXTRA}") -set(RC_MODULE_VERSION "${MODULE_VERSION_MAJOR},${MODULE_VERSION_MINOR},${MODULE_VERSION_MICRO},${MODULE_VERSION_EXTRA}") - -# This info is from Makefile.common -set(PLUGIN_NAME ${PACKAGE}) - -# This info is from config.nmake -set(MSVC_VARIANT "${CMAKE_GENERATOR}") - -# The rc.in requires a plain VERSION variable -set(VERSION ${PROJECT_VERSION}) +include(WiresharkPlugin) -# Create the plugin.rc file from the template -configure_file(plugin.rc.in plugin.rc @ONLY) +# This info is from moduleinfo.nmake +set_module_info(unistim 0 0 2 0) set(DISSECTOR_SRC packet-unistim.c @@ -68,28 +52,10 @@ register_dissector_files(plugin.c ${DISSECTOR_SRC} ) -add_library(unistim ${LINK_MODE_MODULE} - ${PLUGIN_FILES} - ${CMAKE_CURRENT_BINARY_DIR}/plugin.rc -) - -set_target_properties(unistim PROPERTIES - PREFIX "" - LINK_FLAGS "${WS_LINK_FLAGS}" - FOLDER "Plugins" -) - -if(ENABLE_APPLICATION_BUNDLE) - set_target_properties(unistim PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/PlugIns/wireshark - ) -endif() - -target_link_libraries(unistim epan) +add_plugin_library(unistim) install(TARGETS unistim LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} NAMELINK_SKIP RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} ) - diff --git a/plugins/wimax/CMakeLists.txt b/plugins/wimax/CMakeLists.txt index 77a146c22c..b16646575c 100644 --- a/plugins/wimax/CMakeLists.txt +++ b/plugins/wimax/CMakeLists.txt @@ -19,29 +19,10 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # -# Create the Windows .rc file for the plugin. -# The values come from several files in the source, I can't see how to reuse them +include(WiresharkPlugin) # This info is from moduleinfo.nmake -set(PACKAGE wimax) -set(MODULE_VERSION_MAJOR 1) -set(MODULE_VERSION_MINOR 1) -set(MODULE_VERSION_MICRO 0) -set(MODULE_VERSION_EXTRA 0) -set(MODULE_VERSION "${MODULE_VERSION_MAJOR}.${MODULE_VERSION_MINOR}.${MODULE_VERSION_MICRO}.${MODULE_VERSION_EXTRA}") -set(RC_MODULE_VERSION "${MODULE_VERSION_MAJOR},${MODULE_VERSION_MINOR},${MODULE_VERSION_MICRO},${MODULE_VERSION_EXTRA}") - -# This info is from Makefile.common -set(PLUGIN_NAME ${PACKAGE}) - -# This info is from config.nmake -set(MSVC_VARIANT "${CMAKE_GENERATOR}") - -# The rc.in requires a plain VERSION variable -set(VERSION ${PROJECT_VERSION}) - -# Create the plugin.rc file from the template -configure_file(plugin.rc.in plugin.rc @ONLY) +set_module_info(wimax 1 1 0 0) set(DISSECTOR_SRC packet-wmx.c @@ -116,28 +97,10 @@ register_dissector_files(plugin.c ${DISSECTOR_SRC} ) -add_library(wimax ${LINK_MODE_MODULE} - ${PLUGIN_FILES} - ${CMAKE_CURRENT_BINARY_DIR}/plugin.rc -) - -set_target_properties(wimax PROPERTIES - PREFIX "" - LINK_FLAGS "${WS_LINK_FLAGS}" - FOLDER "Plugins" -) - -if(ENABLE_APPLICATION_BUNDLE) - set_target_properties(wimax PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/PlugIns/wireshark - ) -endif() - -target_link_libraries(wimax epan) +add_plugin_library(wimax) install(TARGETS wimax LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} NAMELINK_SKIP RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} ) - diff --git a/plugins/wimaxasncp/CMakeLists.txt b/plugins/wimaxasncp/CMakeLists.txt index 96d2a98e99..6e16beb786 100644 --- a/plugins/wimaxasncp/CMakeLists.txt +++ b/plugins/wimaxasncp/CMakeLists.txt @@ -19,29 +19,10 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # -# Create the Windows .rc file for the plugin. -# The values come from several files in the source, I can't see how to reuse them +include(WiresharkPlugin) # This info is from moduleinfo.nmake -set(PACKAGE wimaxasncp) -set(MODULE_VERSION_MAJOR 0) -set(MODULE_VERSION_MINOR 0) -set(MODULE_VERSION_MICRO 1) -set(MODULE_VERSION_EXTRA 0) -set(MODULE_VERSION "${MODULE_VERSION_MAJOR}.${MODULE_VERSION_MINOR}.${MODULE_VERSION_MICRO}.${MODULE_VERSION_EXTRA}") -set(RC_MODULE_VERSION "${MODULE_VERSION_MAJOR},${MODULE_VERSION_MINOR},${MODULE_VERSION_MICRO},${MODULE_VERSION_EXTRA}") - -# This info is from Makefile.common -set(PLUGIN_NAME ${PACKAGE}) - -# This info is from config.nmake -set(MSVC_VARIANT "${CMAKE_GENERATOR}") - -# The rc.in requires a plain VERSION variable -set(VERSION ${PROJECT_VERSION}) - -# Create the plugin.rc file from the template -configure_file(plugin.rc.in plugin.rc @ONLY) +set_module_info(wimaxasncp 0 0 1 0) set(DISSECTOR_SRC packet-wimaxasncp.c @@ -75,28 +56,10 @@ register_dissector_files(plugin.c ${DISSECTOR_SRC} ) -add_library(wimaxasncp ${LINK_MODE_MODULE} - ${PLUGIN_FILES} - ${CMAKE_CURRENT_BINARY_DIR}/plugin.rc -) - -set_target_properties(wimaxasncp PROPERTIES - PREFIX "" - LINK_FLAGS "${WS_LINK_FLAGS}" - FOLDER "Plugins" -) - -if(ENABLE_APPLICATION_BUNDLE) - set_target_properties(wimaxasncp PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/PlugIns/wireshark - ) -endif() - -target_link_libraries(wimaxasncp epan) +add_plugin_library(wimaxasncp) install(TARGETS wimaxasncp LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} NAMELINK_SKIP RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} ) - diff --git a/plugins/wimaxmacphy/CMakeLists.txt b/plugins/wimaxmacphy/CMakeLists.txt index 657dd1d380..996ada1649 100644 --- a/plugins/wimaxmacphy/CMakeLists.txt +++ b/plugins/wimaxmacphy/CMakeLists.txt @@ -19,29 +19,10 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # -# Create the Windows .rc file for the plugin. -# The values come from several files in the source, I can't see how to reuse them +include(WiresharkPlugin) # This info is from moduleinfo.nmake -set(PACKAGE wimaxmacphy) -set(MODULE_VERSION_MAJOR 0) -set(MODULE_VERSION_MINOR 0) -set(MODULE_VERSION_MICRO 1) -set(MODULE_VERSION_EXTRA 0) -set(MODULE_VERSION "${MODULE_VERSION_MAJOR}.${MODULE_VERSION_MINOR}.${MODULE_VERSION_MICRO}.${MODULE_VERSION_EXTRA}") -set(RC_MODULE_VERSION "${MODULE_VERSION_MAJOR},${MODULE_VERSION_MINOR},${MODULE_VERSION_MICRO},${MODULE_VERSION_EXTRA}") - -# This info is from Makefile.common -set(PLUGIN_NAME ${PACKAGE}) - -# This info is from config.nmake -set(MSVC_VARIANT "${CMAKE_GENERATOR}") - -# The rc.in requires a plain VERSION variable -set(VERSION ${PROJECT_VERSION}) - -# Create the plugin.rc file from the template -configure_file(plugin.rc.in plugin.rc @ONLY) +set_module_info(wimaxmacphy 0 0 1 0) set(DISSECTOR_SRC packet-wimaxmacphy.c @@ -71,28 +52,10 @@ register_dissector_files(plugin.c ${DISSECTOR_SRC} ) -add_library(wimaxmacphy ${LINK_MODE_MODULE} - ${PLUGIN_FILES} - ${CMAKE_CURRENT_BINARY_DIR}/plugin.rc -) - -set_target_properties(wimaxmacphy PROPERTIES - PREFIX "" - LINK_FLAGS "${WS_LINK_FLAGS}" - FOLDER "Plugins" -) - -if(ENABLE_APPLICATION_BUNDLE) - set_target_properties(wimaxmacphy PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/PlugIns/wireshark - ) -endif() - -target_link_libraries(wimaxmacphy epan) +add_plugin_library(wimaxmacphy) install(TARGETS wimaxmacphy LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} NAMELINK_SKIP RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} ) - -- cgit v1.2.3