From 404844d542ba5c997055554e924239f945c36352 Mon Sep 17 00:00:00 2001 From: jmayer Date: Mon, 21 Sep 2009 00:19:07 +0000 Subject: [PATCH] CMake: - Add opcua to the list of plugins to build - Link the gtk stuff statically into wireshark - Beginnings of "make install" - Change a few things about install paths git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@30029 f5534014-38df-0310-8fa8-9805f1628bb7 --- CMakeLists.txt | 55 ++++++++++++++++++++- cmakeconfig.h.in | 19 ++++--- epan/wspython/CMakeLists.txt | 15 ++++++ gtk/CMakeLists.txt | 12 ++--- plugins/asn1/CMakeLists.txt | 6 +++ plugins/docsis/CMakeLists.txt | 6 +++ plugins/ethercat/CMakeLists.txt | 6 +++ plugins/gryphon/CMakeLists.txt | 6 +++ plugins/irda/CMakeLists.txt | 6 +++ plugins/m2m/CMakeLists.txt | 6 +++ plugins/mate/CMakeLists.txt | 6 +++ plugins/opcua/CMakeLists.txt | 88 +++++++++++++++++++++++++++++++++ 12 files changed, 215 insertions(+), 16 deletions(-) create mode 100644 plugins/opcua/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f71658ab5..58cf1b0540 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -316,12 +316,12 @@ if(ENABLE_PLUGINS) plugins/asn1 plugins/docsis plugins/ethercat - plugins/giop +# plugins/giop plugins/gryphon plugins/irda plugins/m2m plugins/mate -# plugins/opcua + plugins/opcua # plugins/profinet # plugins/sercosiii # plugins/stats_tree @@ -487,6 +487,41 @@ set(TSHARK_TAP_SRC tap-wspstat.c ) +set(INSTALL_DIRS + diameter + dtds + help + radius + tpncp + wimaxasncp +) + +set(INSTALL_FILES +# AUTHORS-SHORT + COPYING +# capinfos.html +# cfilters +# colorfilters +# console.lua +# dfilters +# dtd_gen.lua +# dumpcap.html +# editcap.html +# idl2wrs.html +# init.lua +# ipmap.html +# manuf +# mergecap.html +# rawshark.html +# services +# smi_modules +# text2pcap.html +# tshark.html +# wireshark-filter.html +# wireshark.html +# ws.css +) + set(LIBEPAN_LIBS # $(wireshark_optional_objects) wiretap @@ -716,3 +751,19 @@ if(BUILD_dumpcap) target_link_libraries(dumpcap ${dumpcap_LIBS}) install(TARGETS dumpcap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() + +install( + FILES + ${INSTALL_FILES} + DESTINATION + ${CMAKE_INSTALL_DATADIR}/${CPACK_PACKAGE_NAME} +) + +install( + DIRECTORY + ${INSTALL_DIRS} + DESTINATION + ${CMAKE_INSTALL_DATADIR}/${CPACK_PACKAGE_NAME} + PATTERN ".svn" EXCLUDE + PATTERN "Makefile.*" EXCLUDE +) diff --git a/cmakeconfig.h.in b/cmakeconfig.h.in index 894fa55a36..f3ce7afc9a 100644 --- a/cmakeconfig.h.in +++ b/cmakeconfig.h.in @@ -1,16 +1,22 @@ /* cmakeconfig.h.in */ +/* Note: You cannot use earlier #defines in later #cmakedefines (cmake 2.6.2). */ + /* Version number of package */ -#define VERSION "@CPACK_PACKAGE_VERSION@" +#define VERSION "${CPACK_PACKAGE_VERSION}" +/* FIXME: Move the path stuff to the CMakeInstallDirs.cmake file */ /* Directory for data */ -#define DATAFILE_DIR "@CMAKE_INSTALL_PREFIX@/share/@CPACK_PACKAGE_NAME@" +#define DATAFILE_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/${CPACK_PACKAGE_NAME}" -/* Define to 1 if we want to enable plugins */ -#cmakedefine HAVE_PLUGINS 1 +/* Path to Python. */ +#cmakedefine PYTHON_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/${CPACK_PACKAGE_NAME}/python/${CPACK_PACKAGE_VERSION}" /* Directory where plugins reside */ -#define PLUGIN_DIR "${DATAFILE_DIR}/plugins/${CPACK_PACKAGE_VERSION}" +#define PLUGIN_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION}" + +/* Define to 1 if we want to enable plugins */ +#cmakedefine HAVE_PLUGINS 1 /* Link plugins statically into Wireshark */ #cmakedefine ENABLE_STATIC 1 @@ -123,9 +129,6 @@ /* Define to 1 if you have libpython. */ #cmakedefine HAVE_PYTHON 1 -/* Path to Python. */ -#cmakedefine PYTHON_DIR "${CMAKE_INSTALL_PREFIX}/lib/${CPACK_PACKAGE_NAME}/python/${VERSION}" - /* Define to 1 if you have the header file. */ #cmakedefine HAVE_MEMORY_H 1 diff --git a/epan/wspython/CMakeLists.txt b/epan/wspython/CMakeLists.txt index 320dc3852c..6f38de15ef 100644 --- a/epan/wspython/CMakeLists.txt +++ b/epan/wspython/CMakeLists.txt @@ -30,3 +30,18 @@ add_library(wspython STATIC ${WSPYTHON_FILES} ) +install(PROGRAMS + register-dissector.py + wspy_dissector.py + wspy_libws.py + DESTINATION + ${CMAKE_INSTALL_DATADIR}/${CPACK_PACKAGE_NAME}/python/${CPACK_PACKAGE_VERSION} +) + + +install(DIRECTORY + wspy_dissectors + DESTINATION + ${CMAKE_INSTALL_DATADIR}/${CPACK_PACKAGE_NAME}/python/${CPACK_PACKAGE_VERSION} + PATTERN ".svn" EXCLUDE +) diff --git a/gtk/CMakeLists.txt b/gtk/CMakeLists.txt index a956f8273b..6811db585e 100644 --- a/gtk/CMakeLists.txt +++ b/gtk/CMakeLists.txt @@ -212,15 +212,15 @@ ADD_CUSTOM_COMMAND( ${WIRESHARK_TAP_SRC} ) -add_library(ui SHARED +add_library(ui STATIC ${WIRESHARK_GTK_SRC} ${WIRESHARK_TAP_SRC} wireshark-tap-register.c ) -install(TARGETS ui - LIBRARY DESTINATION lib - RUNTIME DESTINATION lib - ARCHIVE DESTINATION lib -) +#install(TARGETS ui +# LIBRARY DESTINATION lib +# RUNTIME DESTINATION lib +# ARCHIVE DESTINATION lib +#) diff --git a/plugins/asn1/CMakeLists.txt b/plugins/asn1/CMakeLists.txt index 0e6624da6c..0280063640 100644 --- a/plugins/asn1/CMakeLists.txt +++ b/plugins/asn1/CMakeLists.txt @@ -67,3 +67,9 @@ add_library(asn1 MODULE ${PLUGIN_FILES} ) +install(TARGETS asn1 + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} + 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/docsis/CMakeLists.txt b/plugins/docsis/CMakeLists.txt index fb415370ff..436259631a 100644 --- a/plugins/docsis/CMakeLists.txt +++ b/plugins/docsis/CMakeLists.txt @@ -101,3 +101,9 @@ add_library(docsis MODULE ${PLUGIN_FILES} ) +install(TARGETS docsis + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} + 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 cf52064324..97e5362c1f 100644 --- a/plugins/ethercat/CMakeLists.txt +++ b/plugins/ethercat/CMakeLists.txt @@ -73,3 +73,9 @@ add_library(ethercat MODULE ${PLUGIN_FILES} ) +install(TARGETS ethercat + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} + 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 66e4094ca2..1b716da40f 100644 --- a/plugins/gryphon/CMakeLists.txt +++ b/plugins/gryphon/CMakeLists.txt @@ -67,3 +67,9 @@ add_library(gryphon MODULE ${PLUGIN_FILES} ) +install(TARGETS gryphon + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} + 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 c95fad93a0..983b96ecbf 100644 --- a/plugins/irda/CMakeLists.txt +++ b/plugins/irda/CMakeLists.txt @@ -69,3 +69,9 @@ add_library(irda MODULE ${PLUGIN_FILES} ) +install(TARGETS irda + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} + 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 a2df6157c1..6d5047c1a2 100644 --- a/plugins/m2m/CMakeLists.txt +++ b/plugins/m2m/CMakeLists.txt @@ -67,3 +67,9 @@ add_library(m2m MODULE ${PLUGIN_FILES} ) +install(TARGETS m2m + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} + 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 97f92a7b42..c7b121b1cc 100644 --- a/plugins/mate/CMakeLists.txt +++ b/plugins/mate/CMakeLists.txt @@ -86,3 +86,9 @@ add_library(mate MODULE ${PLUGIN_FILES} ) +install(TARGETS mate + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} + 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 new file mode 100644 index 0000000000..5b39baa89c --- /dev/null +++ b/plugins/opcua/CMakeLists.txt @@ -0,0 +1,88 @@ +# CMakeLists.txt +# +# $Id$ +# +# Wireshark - Network traffic analyzer +# By Gerald Combs +# Copyright 1998 Gerald Combs +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# + +set(DISSECTOR_SRC + opcua.c +) + +set(DISSECTOR_SUPPORT_SRC + opcua_transport_layer.c + opcua_security_layer.c + opcua_application_layer.c + opcua_serviceparser.c + opcua_complextypeparser.c + opcua_enumparser.c + opcua_simpletypes.c + opcua_servicetable.c + opcua_hfindeces.c +) + +set(PLUGIN_FILES + plugin.c + ${DISSECTOR_SRC} + ${DISSECTOR_SUPPORT_SRC} +) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + +ADD_CUSTOM_COMMAND( +# FIXME: Only the Python stuff has been implemented +# Make this into a MACRO, to avoid duplication with epan/ +#plugin.c: $(DISSECTOR_SRC) $(top_srcdir)/tools/make-dissector-reg +# $(top_srcdir)/tools/make-dissector-reg.py +# @if test -n "$(PYTHON)"; then +# echo Making plugin.c with python ; +# $(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) +# plugin $(DISSECTOR_SRC) ; +# else +# echo Making plugin.c with shell script ; +# $(top_srcdir)/tools/make-dissector-reg $(srcdir) +# $(plugin_src) plugin $(DISSECTOR_SRC) ; +# fi + + OUTPUT plugin.c + COMMAND ${PYTHON_EXECUTABLE} + ${CMAKE_SOURCE_DIR}/tools/make-dissector-reg.py + ${CMAKE_CURRENT_SOURCE_DIR} + plugin + ${DISSECTOR_SRC} + DEPENDS + ${DISSECTOR_SRC} + ${CMAKE_SOURCE_DIR}/tools/make-dissector-reg + ${CMAKE_SOURCE_DIR}/tools/make-dissector-reg.py +) + +# todo +# Do I need any of this or is this handled by type MODULE? +# asn1_la_LDFLAGS = -module -avoid-version + +add_library(opcua MODULE + ${PLUGIN_FILES} +) + +install(TARGETS opcua + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} + RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} +) + -- 2.34.1