plugins.example: Add package target

Basic package target to create a .zip or tar.gz of the plugin
and README file.
pespin/osmux-wip
João Valverde 2022-03-28 12:16:54 +01:00 committed by A Wireshark GitLab Utility
parent c451e572e5
commit e3765215aa
1 changed files with 17 additions and 0 deletions

View File

@ -49,3 +49,20 @@ add_custom_target(copy_plugin
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:hello> ${Wireshark_PLUGIN_INSTALL_DIR}
COMMENT "Installing plugin to: ${Wireshark_PLUGIN_INSTALL_DIR}"
)
string(TOLOWER "${PROJECT_NAME}-${PROJECT_VERSION}" _pkgname)
add_custom_target(package_prep
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/${_pkgname}
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/README $<TARGET_FILE:hello> ${CMAKE_BINARY_DIR}/${_pkgname}
)
add_custom_target(package
COMMAND ${CMAKE_COMMAND} -E tar czf ${CMAKE_BINARY_DIR}/${_pkgname}.tar.gz --format=gnutar -- ${CMAKE_BINARY_DIR}/${_pkgname}
)
add_dependencies(package package_prep)
add_custom_target(package_zip
COMMAND ${CMAKE_COMMAND} -E tar cf ${CMAKE_BINARY_DIR}/${_pkgname}.zip --format=zip -- ${CMAKE_BINARY_DIR}/${_pkgname}
)
add_dependencies(package_zip package_prep)