aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/modules
diff options
context:
space:
mode:
authorJoão Valverde <j@v6e.pt>2023-12-13 12:42:40 +0000
committerJoão Valverde <j@v6e.pt>2023-12-14 14:18:55 +0000
commitb51a3933ba8ace3f583259f5fd420a47912c86ad (patch)
treefbb7048352f6b8b9aa5267c52f968fae347d6ddb /cmake/modules
parent70383151ae5623860e18381186a74984f5c394e2 (diff)
CMake: Refactor plugin add_library() macros
Replace the macro subfolder argument with type specific plugin macros.
Diffstat (limited to 'cmake/modules')
-rw-r--r--cmake/modules/WiresharkPlugin.cmake28
1 files changed, 14 insertions, 14 deletions
diff --git a/cmake/modules/WiresharkPlugin.cmake b/cmake/modules/WiresharkPlugin.cmake
index 76277e2568..b8975d3989 100644
--- a/cmake/modules/WiresharkPlugin.cmake
+++ b/cmake/modules/WiresharkPlugin.cmake
@@ -28,7 +28,7 @@ macro(SET_MODULE_INFO _plugin _ver_major _ver_minor _ver_micro _ver_extra)
add_definitions(-DPLUGIN_VERSION=\"${PLUGIN_VERSION}\")
endmacro()
-macro(ADD_WIRESHARK_PLUGIN_LIBRARY _plugin _subfolder)
+macro(ADD_PLUGIN_LIBRARY _plugin _output_dir)
add_library(${_plugin} MODULE
${PLUGIN_FILES}
${PLUGIN_RC_FILE}
@@ -40,30 +40,30 @@ macro(ADD_WIRESHARK_PLUGIN_LIBRARY _plugin _subfolder)
PREFIX ""
LINK_FLAGS "${WS_LINK_FLAGS}"
FOLDER "Plugins"
+ LIBRARY_OUTPUT_DIRECTORY ${_output_dir}
+ INSTALL_RPATH ""
)
if(MSVC)
set_target_properties(${_plugin} PROPERTIES LINK_FLAGS_DEBUG "${WS_MSVC_DEBUG_LINK_FLAGS}")
endif()
- set_target_properties(${_plugin} PROPERTIES
- LIBRARY_OUTPUT_DIRECTORY ${PLUGIN_DIR}/${_subfolder}
- INSTALL_RPATH ""
- )
-
add_dependencies(plugins ${_plugin})
endmacro()
-macro(ADD_PLUGIN_LIBRARY _plugin _subfolder)
- message(WARNING "${CMAKE_PARENT_LIST_FILE}: add_plugin_library is deprecated. Use add_wireshark_plugin_library instead.")
- ADD_WIRESHARK_PLUGIN_LIBRARY(${_plugin} ${_subfolder})
+macro(ADD_WIRESHARK_EPAN_PLUGIN_LIBRARY _plugin)
+ ADD_PLUGIN_LIBRARY(${_plugin} "${PLUGIN_DIR}/epan")
endmacro()
-macro(ADD_LOGRAY_PLUGIN_LIBRARY _plugin _subfolder)
- ADD_WIRESHARK_PLUGIN_LIBRARY(${_plugin} ${_subfolder})
+macro(ADD_WIRESHARK_WIRETAP_PLUGIN_LIBRARY _plugin)
+ ADD_PLUGIN_LIBRARY(${_plugin} "${PLUGIN_DIR}/wiretap")
+endmacro()
- set_target_properties(${_plugin} PROPERTIES
- LIBRARY_OUTPUT_DIRECTORY ${LOGRAY_PLUGIN_DIR}/${_subfolder}
- )
+macro(ADD_WIRESHARK_CODEC_PLUGIN_LIBRARY _plugin)
+ ADD_PLUGIN_LIBRARY(${_plugin} "${PLUGIN_DIR}/codecs")
+endmacro()
+
+macro(ADD_LOGRAY_EPAN_PLUGIN_LIBRARY _plugin)
+ ADD_PLUGIN_LIBRARY(${_plugin} "${LOGRAY_PLUGIN_DIR}/epan")
endmacro()
macro(INSTALL_PLUGIN _plugin _subfolder)