aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerald Combs <gerald@zing.org>2015-01-18 13:27:13 -0800
committerGerald Combs <gerald@wireshark.org>2015-01-20 16:12:20 +0000
commit6e6a1291d0b36fe97d0f684e1abdfe546aaeae7f (patch)
treee441c514c057d4cadd74ae21ec6cc321b63ef285
parentaf3924a333aa8fc614ad45163751a614a9b9fc3d (diff)
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 <gerald@wireshark.org>
-rw-r--r--CMakeLists.txt89
-rw-r--r--Makefile.am2
-rw-r--r--cmake/modules/WiresharkPlugin.cmake61
-rw-r--r--plugins/docsis/CMakeLists.txt43
-rw-r--r--plugins/ethercat/CMakeLists.txt43
-rw-r--r--plugins/gryphon/CMakeLists.txt43
-rw-r--r--plugins/irda/CMakeLists.txt43
-rw-r--r--plugins/m2m/CMakeLists.txt43
-rw-r--r--plugins/mate/CMakeLists.txt43
-rw-r--r--plugins/opcua/CMakeLists.txt42
-rw-r--r--plugins/profinet/CMakeLists.txt43
-rw-r--r--plugins/stats_tree/CMakeLists.txt47
-rw-r--r--plugins/tpg/CMakeLists.txt25
-rw-r--r--plugins/unistim/CMakeLists.txt42
-rw-r--r--plugins/wimax/CMakeLists.txt43
-rw-r--r--plugins/wimaxasncp/CMakeLists.txt43
-rw-r--r--plugins/wimaxmacphy/CMakeLists.txt43
-rw-r--r--wsutil/plugins.c10
18 files changed, 168 insertions, 580 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a77d243321..73040b4013 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -812,44 +812,6 @@ ADD_CUSTOM_COMMAND(
${CMAKE_CURRENT_SOURCE_DIR}/make-version.pl
)
-if(ENABLE_PLUGINS)
- set(HAVE_PLUGINS 1)
- if(IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR})
- set(PLUGIN_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION}")
- else()
- set(PLUGIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION}")
- endif()
- set(PLUGIN_SRC_DIRS
- plugins/docsis
- plugins/ethercat
- plugins/gryphon
- plugins/irda
- plugins/m2m
- plugins/mate
- plugins/opcua
- plugins/profinet
- plugins/stats_tree
- plugins/unistim
- plugins/wimax
- plugins/wimaxasncp
- plugins/wimaxmacphy
- ${CUSTOM_PLUGIN_SRC_DIR}
- )
-# It seems this stuff doesn't build with autofoo either...
-# if(YAPP_FOUND)
-# set(PLUGIN_SRC_DIRS
-# ${PLUGIN_SRC_DIRS}
-# plugins/tpg
-# )
-# endif()
-else()
- set(PLUGIN_SRC_DIRS )
-endif()
-
-foreach(PLUGIN_DIR ${PLUGIN_SRC_DIRS})
- add_subdirectory( ${PLUGIN_DIR} )
-endforeach()
-
add_subdirectory( asn1 EXCLUDE_FROM_ALL )
add_subdirectory( capchild )
add_subdirectory( caputils )
@@ -894,6 +856,57 @@ if(ENABLE_EXTCAP)
set(EXTCAP_DIR "${DATAFILE_DIR}/extcap/")
endif()
+# Location of our plugins. PLUGIN_DIRECTORY should allow running
+# from the build directory similar to DATAFILE_DIR above.
+if(ENABLE_PLUGINS)
+ set(HAVE_PLUGINS 1)
+ if(IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR})
+ set(PLUGIN_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION}")
+ else()
+ set(PLUGIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION}")
+ endif()
+ set(PLUGIN_SRC_DIRS
+ plugins/docsis
+ plugins/ethercat
+ plugins/gryphon
+ plugins/irda
+ plugins/m2m
+ plugins/mate
+ plugins/opcua
+ plugins/profinet
+ plugins/stats_tree
+ plugins/unistim
+ plugins/wimax
+ plugins/wimaxasncp
+ plugins/wimaxmacphy
+ ${CUSTOM_PLUGIN_SRC_DIR}
+ )
+# It seems this stuff doesn't build with autofoo either...
+# if(YAPP_FOUND)
+# set(PLUGIN_SRC_DIRS
+# ${PLUGIN_SRC_DIRS}
+# plugins/tpg
+# )
+# endif()
+else()
+ set(PLUGIN_SRC_DIRS )
+endif()
+
+if(ENABLE_APPLICATION_BUNDLE)
+ set(_plugin_dir "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/PlugIns/wireshark")
+else()
+ get_target_property(_libwireshark_location epan LOCATION)
+ get_filename_component(_plugin_dir "${_libwireshark_location}" PATH)
+ set(_plugin_dir "${_plugin_dir}/plugins")
+endif()
+# XXX The NMake environment appends the version. Should we do so here?
+set (PLUGIN_DIR ${_plugin_dir} CACHE INTERNAL "Build time plugin location.")
+
+foreach(_plugin_src_dir ${PLUGIN_SRC_DIRS})
+ add_subdirectory( ${_plugin_src_dir} )
+endforeach()
+
+
# Basedir where to install guides
set(DOC_DIR "$ENV{docdir}" CACHE FILEPATH "Installation directory for ug and dg pdfs.")
message(STATUS "docdir: ${DOC_DIR}")
diff --git a/Makefile.am b/Makefile.am
index 1b9f743350..897d9a7255 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1247,6 +1247,7 @@ EXTRA_DIST = \
cmake/modules/FindPCAP.cmake \
cmake/modules/FindPOD.cmake \
cmake/modules/FindPORTAUDIO.cmake \
+ cmake/modules/FindPowerShell.cmake \
cmake/modules/FindSBC.cmake \
cmake/modules/FindSED.cmake \
cmake/modules/FindSETCAP.cmake \
@@ -1273,6 +1274,7 @@ EXTRA_DIST = \
cmake/modules/UseWinLibs.cmake \
cmake/modules/WiresharkConfig.cmake.in \
cmake/modules/WiresharkConfigVersion.cmake.in \
+ cmake/modules/WiresharkPlugin.cmake \
cmake/TestFileOffsetBits.c \
cmake/TestLargeFiles.c.cmakein \
cmake/TestWindowsFSeek.c \
diff --git a/cmake/modules/WiresharkPlugin.cmake b/cmake/modules/WiresharkPlugin.cmake
new file mode 100644
index 0000000000..e5c69fca97
--- /dev/null
+++ b/cmake/modules/WiresharkPlugin.cmake
@@ -0,0 +1,61 @@
+# Plugin convenience macros.
+
+# Set information similar to moduleinfo.nmake
+macro(SET_MODULE_INFO _plugin _ver_major _ver_minor _ver_micro _ver_extra)
+ # 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
+
+ # This info is from moduleinfo.nmake
+ set(PACKAGE ${_plugin})
+ set(MODULE_VERSION_MAJOR ${_ver_major})
+ set(MODULE_VERSION_MINOR ${_ver_minor})
+ set(MODULE_VERSION_MICRO ${_ver_micro})
+ set(MODULE_VERSION_EXTRA ${_ver_extra})
+ 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)
+endmacro()
+
+macro(ADD_PLUGIN_LIBRARY _plugin)
+ add_library(${_plugin} ${LINK_MODE_MODULE}
+ ${PLUGIN_FILES}
+ ${CMAKE_CURRENT_BINARY_DIR}/plugin.rc
+ )
+
+ set_target_properties(${_plugin} PROPERTIES
+ PREFIX ""
+ LINK_FLAGS "${WS_LINK_FLAGS}"
+ FOLDER "Plugins"
+ )
+
+ # LIBRARY_OUTPUT_DIRECTORY alone appears to be sufficient.
+ set_target_properties(${_plugin} PROPERTIES
+ #ARCHIVE_OUTPUT_DIRECTORY ${PLUGIN_DIR}
+ LIBRARY_OUTPUT_DIRECTORY ${PLUGIN_DIR}
+ #RUNTIME_OUTPUT_DIRECTORY ${PLUGIN_DIR}
+ )
+
+ # Try to force output to ${PLUGIN_DIR} without the configuration
+ # type appended.
+ foreach(_config_type ${CMAKE_CONFIGURATION_TYPES})
+ string(TOUPPER ${_config_type} _config_upper)
+ set_target_properties(${_plugin} PROPERTIES
+ #ARCHIVE_OUTPUT_DIRECTORY_${_config_upper} ${PLUGIN_DIR}
+ LIBRARY_OUTPUT_DIRECTORY_${_config_upper} ${PLUGIN_DIR}
+ #RUNTIME_OUTPUT_DIRECTORY_${_config_upper} ${PLUGIN_DIR}
+ )
+ endforeach()
+
+ target_link_libraries(${_plugin} epan)
+endmacro()
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}
)
-
diff --git a/wsutil/plugins.c b/wsutil/plugins.c
index aea9f811c4..18b4776da4 100644
--- a/wsutil/plugins.c
+++ b/wsutil/plugins.c
@@ -265,17 +265,17 @@ scan_plugins(void)
{
/*
* Scan the global plugin directory.
- * If we're running from a build directory, scan the subdirectories
- * of that directory, as the global plugin directory is the
- * "plugins" directory of the source tree, and the subdirectories
- * are the source directories for the plugins, with the plugins
- * built in those subdirectories.
+ * If we're running from a build directory, scan the "plugins"
+ * subdirectory, as that's where plugins are located in an
+ * out-of-tree build. If we find subdirectories scan those since
+ * they will contain plugins in the case of an in-tree build.
*/
plugin_dir = get_plugin_dir();
if (running_in_build_directory())
{
if ((dir = ws_dir_open(plugin_dir, 0, NULL)) != NULL)
{
+ plugins_scan_dir(plugin_dir);
while ((file = ws_dir_read_name(dir)) != NULL)
{
name = ws_dir_get_name(file);