Update documentatin for the qt build to reflect the cmake work.
[obnox/wireshark/wip.git] / doc / README.qt
1 0. Abstract
2
3 Wireshark's user interface is showing its age. While GTK+ is wonderful on
4 Linux and BSD its low-tier status on Windows and even-lower-tier status on OS
5 X makes it hard to deliver a good product to users on those platforms.
6
7 The Qt port is an attempt at an updated UI which will better serve our users
8 and let us add features more easily.
9
10
11 1. Getting up and running
12
13 The Qt interface for Wireshark has been compiled and tested on Mac OS X 10.6
14 (XCode gcc), Windows 7 x86 (Visual C++ 2010), and Ubuntu 10.04 (gcc).
15 Compilation via Qt Creator has been tested but command-line compilation using
16 QMake and make or nmake should work.
17
18 There are several ways of building qtshark:
19
20 1) Using qtcreator:
21    The ui/qt directory is loosely coupled with the rest of the codebase. The main
22    Wireshark sources must be built beforehand using CMake on Linux and OS X and
23    nmake on Windows. Autotools + QMake is a basket full of crazy that hasn't yet
24    been sorted and folded.  (Autotools + Boring Old Make, without using
25    QMake at all, might actually be simpler:
26
27         http://www.mail-archive.com/automake@gnu.org/msg11149.html
28
29 2) Using cmake:
30    set BUILD_qtshark to ON (default: OFF) in CmakeOptions.txt (may be set
31    in parallel with BUILD_wireshark).
32    Do the normal out-of-tree or in-tree build.
33    This has only been tested on a current openSUSE Linux system with fairly
34    current QT and cmake. It may be necessary to copy the FindQt4.cmake and
35    supporting files from cmake to Wireshark's cmake/modules/
36    If using cmake installing qtcreator is not required. Basically almost
37    all stuff below can be ignored ;-)
38
39 Work is in progress on this.)
40
41 1.1 Prerequisites
42
43 Before compiling you need the Qt SDK and Qt Creator.
44
45 1.1.1 OS X
46
47 Download the latest Qt SDK (currently 1.1.4) and install it. Build the
48 top-level directory using CMake.
49
50 1.1.2 Windows
51
52 The default Qt SDK libraries are built using MinGW, which isn't supported for
53 Wireshark. Instead of downloading the Qt SDK all-in-one package, download the
54 Qt Libraries package that matches your compiler (VS 2008 or VS 2010) and Qt
55 Creator for Windows.
56
57 Settings in config.nmake are passed to the Qt environment via
58 ui/qt/config.pri. This file should be created automatically when you
59 compile Wireshark in the top-level source directory. You can create it
60 by hand by running "nmake -f Makefile.nmake ui\qt\config.pri".
61
62 Qt Creator can be used to compile and run Wireshark.
63 Alternatively qmake and nmake at the cmd line can be used.
64
65 The Windows Qt version of Wireshark will be compiled and linked with essentially
66 the same options as that used when building the Gtk version of Wireshark.
67
68 1.1.2.1 Qt Creator
69
70 Before compiling in Qt Creator select "Projects" in the left toolbar,
71 select "Build Settings" and do the following:
72
73 - In "Edit build configuration" make sure the "Release" build is selected.
74   (The "Debug" build won't work unless Wireshark is recompiled to link with a "debug"
75    the "debug" C runtime library (using /MDd). See ui\qt\QtShark.pro for details).
76
77 - Make sure "Qt version" matches your version of Visual Studio.
78 - Make sure "Tool chain" matches your Visual C++ version.
79
80 If you require plugin support select "Run Settings" and add
81 "WIRESHARK_RUN_FROM_BUILD_DIRECTORY=1" to the Run Environment.
82
83 XXX: (WMeier): I've not had too much satisfaction using the "native Windows debugger" (CDB ?)
84      accessed via Qt Creator. (In fact, a web search turns up some fairly negative comments
85      about the debugger. I've successfully (and pretty easily) been able to use the
86      Visual Studio debugger; See below under "Command Line".
87      ToDo: Investigate "Qt Visual Studio AddIn":
88            http://developer.qt.nokia.com/wiki/QtVSAddin#6112edd2e39a1695c242723d5c764aae
89
90 1.1.2.2 Command Line
91
92 - Setup environment:
93     c:\qt\4.8.0\bin\qtvars.bat [vsvars]     ;;; optional 'vsvars' to also setup VC env vars
94
95 - [Create and] Switch to a working dir to be used for .obj files, etc for Wireshark-qt compilation
96
97 - Use qmake to create Windows Makefile (based upon info in ui\qt\QtShark.pro and config.pri)
98     qmake -o Makefile.nmake ...\ui\qt\QtShark.pro
99                                   ;; (Only needs to be run once;
100                                   ;; nmake -f Makefile.nmake  will redo qmake if any
101                                   ;; dependendencies (e.g., QtShark.pro) change.
102
103 - Compile & Build
104     nmake -f Makefile.nmake       ;; Wireshark.exe + all DLL's will be in <working-dir>\wireshark-qt
105 - Run:
106     <working-dir>\wireshark
107
108 - Debug (with Visual Studio debugger)
109     Start Visual Studio;
110     File ! Open ! Project/Solution  ! .../<working-dir>/wireshark-qt/wireshark.exe
111     (Using  Solution Explorer ! Properties ! Environment to
112      add PATH=C:\Qt\4.8.0\bin;%PATH% will pobably be required).
113     ... Debug in the usual manner
114
115
116 1.1.3 Linux
117
118 Install the Qt libraries and Qt Creator via your package manager or from
119 http://qt.nokia.com/downloads/. On Debian and Ubuntu the "qt-sdk" meta-package
120 should provide everything you need. Build the top-level directory using CMake
121 (no out of tree builds yet). Inside ui/qt/ do "qtcreate QtShark.pro".
122
123
124 2. Going forward
125
126 DO NOT simply port things over. Every feature, window, and element should be
127 re-thought. For example, should the user have to navigate two dialogs to get
128 HTTP request statistics?