diff options
-rw-r--r-- | tools/dissectors/CMakeLists.txt | 100 | ||||
-rw-r--r-- | tools/dissectors/epan/rfnoc/CMakeLists.txt | 21 |
2 files changed, 59 insertions, 62 deletions
diff --git a/tools/dissectors/CMakeLists.txt b/tools/dissectors/CMakeLists.txt index 99eb51f76..8fa854203 100644 --- a/tools/dissectors/CMakeLists.txt +++ b/tools/dissectors/CMakeLists.txt @@ -20,69 +20,69 @@ set(PLUGIN_C_GENERATOR ${CMAKE_SOURCE_DIR}/make-plugin-reg.py) macro(register_plugin_files _outputfile _registertype) add_custom_command( - OUTPUT ${_outputfile} - DEPENDS ${ARGN} ${PLUGIN_C_GENERATOR} - COMMAND ${PYTHON_EXECUTABLE} - ${PLUGIN_C_GENERATOR} - ${CMAKE_CURRENT_SOURCE_DIR} - ${_registertype} - ${ARGN} - COMMENT "Generating ${_outputfile}" + OUTPUT ${_outputfile} + DEPENDS ${ARGN} ${PLUGIN_C_GENERATOR} + COMMAND ${PYTHON_EXECUTABLE} + ${PLUGIN_C_GENERATOR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${_registertype} + ${ARGN} + COMMENT "Generating ${_outputfile}" ) endmacro(register_plugin_files) # Plugin name and version info (major minor micro extra) macro(SET_MODULE_INFO _plugin _ver_major _ver_minor _ver_micro _ver_extra) - if(WIN32) - # Create the Windows .rc file for the plugin. - set(MODULE_NAME ${_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}") - - set(MSVC_VARIANT "${CMAKE_GENERATOR}") - - # Create the plugin.rc file from the template - set(_plugin_rc_in ${CMAKE_CURRENT_SOURCE_DIR}/plugin.rc.in) - configure_file(${_plugin_rc_in} plugin.rc @ONLY) - set(PLUGIN_RC_FILE ${CMAKE_CURRENT_BINARY_DIR}/plugin.rc) - endif() - - set(PLUGIN_VERSION "${_ver_major}.${_ver_minor}.${_ver_micro}") - add_definitions(-DPLUGIN_VERSION=\"${PLUGIN_VERSION}\") - add_definitions(-DVERSION_MAJOR=${Wireshark_VERSION_MAJOR}) - add_definitions(-DVERSION_MINOR=${Wireshark_VERSION_MINOR}) + if(WIN32) + # Create the Windows .rc file for the plugin. + set(MODULE_NAME ${_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}") + + set(MSVC_VARIANT "${CMAKE_GENERATOR}") + + # Create the plugin.rc file from the template + set(_plugin_rc_in ${CMAKE_CURRENT_SOURCE_DIR}/plugin.rc.in) + configure_file(${_plugin_rc_in} plugin.rc @ONLY) + set(PLUGIN_RC_FILE ${CMAKE_CURRENT_BINARY_DIR}/plugin.rc) + endif() + + set(PLUGIN_VERSION "${_ver_major}.${_ver_minor}.${_ver_micro}") + add_definitions(-DPLUGIN_VERSION=\"${PLUGIN_VERSION}\") + add_definitions(-DVERSION_MAJOR=${Wireshark_VERSION_MAJOR}) + add_definitions(-DVERSION_MINOR=${Wireshark_VERSION_MINOR}) endmacro() macro(ADD_PLUGIN_LIBRARY _plugin _subfolder) - add_library(${_plugin} MODULE - ${PLUGIN_FILES} - ${PLUGIN_RC_FILE} - ) - - set_target_properties(${_plugin} PROPERTIES - PREFIX "" - LINK_FLAGS "${WS_LINK_FLAGS}" - FOLDER "Plugins" - ) - - set_target_properties(${_plugin} PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${_subfolder} - INSTALL_RPATH "" - ) + add_library(${_plugin} MODULE + ${PLUGIN_FILES} + ${PLUGIN_RC_FILE} + ) + + set_target_properties(${_plugin} PROPERTIES + PREFIX "" + LINK_FLAGS "${WS_LINK_FLAGS}" + FOLDER "Plugins" + ) + + set_target_properties(${_plugin} PROPERTIES + LIBRARY_OUTPUT_DIRECTORY ${_subfolder} + INSTALL_RPATH "" + ) endmacro() macro(INSTALL_PLUGIN _plugin _subfolder) install(TARGETS ${_plugin} LIBRARY DESTINATION ${_subfolder} NAMELINK_SKIP ) - #LIBRARY DESTINATION ${Wireshark_PLUGIN_INSTALL_DIR}/${_subfolder} NAMELINK_SKIP - #RUNTIME DESTINATION ${Wireshark_PLUGIN_INSTALL_DIR} - #ARCHIVE DESTINATION ${Wireshark_PLUGIN_INSTALL_DIR} + #LIBRARY DESTINATION ${Wireshark_PLUGIN_INSTALL_DIR}/${_subfolder} NAMELINK_SKIP + #RUNTIME DESTINATION ${Wireshark_PLUGIN_INSTALL_DIR} + #ARCHIVE DESTINATION ${Wireshark_PLUGIN_INSTALL_DIR} endmacro() @@ -90,7 +90,7 @@ find_package(Wireshark CONFIG REQUIRED) find_package(GLIB2) if(NOT Wireshark_PLUGINS_ENABLED) - message(FATAL_ERROR "Wireshark was compiled without support for plugins") + message(FATAL_ERROR "Wireshark was compiled without support for plugins") endif() if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) @@ -134,5 +134,3 @@ if(ENABLE_ZPU) endif(ENABLE_ZPU) WS_PRINT_COMPONENT_SUMMARY() - - diff --git a/tools/dissectors/epan/rfnoc/CMakeLists.txt b/tools/dissectors/epan/rfnoc/CMakeLists.txt index 31766044b..1fe762468 100644 --- a/tools/dissectors/epan/rfnoc/CMakeLists.txt +++ b/tools/dissectors/epan/rfnoc/CMakeLists.txt @@ -3,30 +3,29 @@ set(DISSECTOR_NAME "rfnoc${RFNOC_CHDR_WIDTH}") set_module_info(${DISSECTOR_NAME} 4 0 0 0) set(DISSECTOR_SRC - ${CMAKE_CURRENT_SOURCE_DIR}/packet-rfnoc.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/../../../../host/lib/exception.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/../../../../host/lib/rfnoc/chdr_types.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/../../../../host/lib/rfnoc/chdr_packet_writer.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/packet-rfnoc.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/../../../../host/lib/exception.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/../../../../host/lib/rfnoc/chdr_types.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/../../../../host/lib/rfnoc/chdr_packet_writer.cpp ) set(PLUGIN_FILES - ${CMAKE_CURRENT_BINARY_DIR}/plugin.c - ${DISSECTOR_SRC} + ${CMAKE_CURRENT_BINARY_DIR}/plugin.c + ${DISSECTOR_SRC} ) register_plugin_files(${CMAKE_CURRENT_BINARY_DIR}/plugin.c - plugin - ${DISSECTOR_SRC} + plugin + ${DISSECTOR_SRC} ) add_plugin_library(${DISSECTOR_NAME} epan) set_target_properties(${DISSECTOR_NAME} PROPERTIES PREFIX "" - CXX_STANDARD 14 - CXX_STANDARD_REQUIRED YES + CXX_STANDARD 14 + CXX_STANDARD_REQUIRED YES ) set_target_properties(${DISSECTOR_NAME} PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}") target_link_libraries(${DISSECTOR_NAME} wireshark epan) install_plugin(${DISSECTOR_NAME} epan) - |