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/tpg/CMakeLists.txt | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) (limited to 'plugins/tpg') 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} ) - -- cgit v1.2.3