CMake:
authorjmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 21 Sep 2009 00:19:07 +0000 (00:19 +0000)
committerjmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 21 Sep 2009 00:19:07 +0000 (00:19 +0000)
- 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

12 files changed:
CMakeLists.txt
cmakeconfig.h.in
epan/wspython/CMakeLists.txt
gtk/CMakeLists.txt
plugins/asn1/CMakeLists.txt
plugins/docsis/CMakeLists.txt
plugins/ethercat/CMakeLists.txt
plugins/gryphon/CMakeLists.txt
plugins/irda/CMakeLists.txt
plugins/m2m/CMakeLists.txt
plugins/mate/CMakeLists.txt
plugins/opcua/CMakeLists.txt [new file with mode: 0644]

index 9f71658ab5539f2a2a6ba606073312484417ed5f..58cf1b05402f9df47e3fc311c67ae2523b8fe80e 100644 (file)
@@ -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
+)
index 894fa55a363856958d1ccb503c7c5ee086085564..f3ce7afc9a2c181dc6859631cb664ab58fb86682 100644 (file)
@@ -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
 /* 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 <memory.h> header file. */
 #cmakedefine HAVE_MEMORY_H 1
 
index 320dc3852ca89d269141c467a4006512466f2db3..6f38de15ef3a8533e82b2889212a71a8378c94d0 100644 (file)
@@ -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
+)
index a956f8273b14feaa7467b73419a0f0aebf921594..6811db585e88c9ca578942a9c5d461b5bd397d01 100644 (file)
@@ -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
+#)
 
index 0e6624da6c2277e8b18b69eec797738647a66b82..028006364072d5f94763e1051b141a78584d96d1 100644 (file)
@@ -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}
+)
+
index fb415370ffa2962567a8ad4a1ca0c24b8b078638..436259631ac5609961e5b45a3940241d8579d3cb 100644 (file)
@@ -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}
+)
+
index cf52064324249410f46609baced6ec17ebda5777..97e5362c1f0c254cba3fb87e119057563f892ac3 100644 (file)
@@ -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}
+)
+
index 66e4094ca2463e8115473f89b6f2a44c25e87d8e..1b716da40fec4822d835cf4066dce85cec76c1f1 100644 (file)
@@ -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}
+)
+
index c95fad93a00846af6fdf17e217d467191f80cdb3..983b96ecbf8e50813471585530c09133129fdd23 100644 (file)
@@ -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}
+)
+
index a2df6157c1f87f0f8a5ddc7a115cb1df0858dd24..6d5047c1a2e7d2c439930fee214bd16da62de919 100644 (file)
@@ -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}
+)
+
index 97f92a7b426f4ecf771dc8a235db607d9701a3ab..c7b121b1cc049c91522e2e158e5732059b679d2b 100644 (file)
@@ -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 (file)
index 0000000..5b39baa
--- /dev/null
@@ -0,0 +1,88 @@
+# CMakeLists.txt
+#
+# $Id$
+#
+# Wireshark - Network traffic analyzer
+# By Gerald Combs <gerald@wireshark.org>
+# 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}
+)
+