1f9238dc6f3f2b64dcbf21765266f1e15a2db1be
[obnox/wireshark/wip.git] / ui / qt / QtShark.pro
1 #-------------------------------------------------
2 #
3 # Project created by QtCreator 2010-12-21T11:38:10
4 #
5 #-------------------------------------------------
6
7 QT += core gui
8
9 TARGET = Wireshark
10 TEMPLATE = app
11
12 unix {
13     CONFIG += link_pkgconfig
14     PKGCONFIG += \
15         glib-2.0
16
17     # Some versions of Ubuntu don't ship with zlib.pc
18     eval(PKGCONFIG += zlib) {
19         PKGCONFIG += zlib
20     }
21 }
22
23 # XXX We need to figure out how to pull this in from config.nmake.
24
25 win32 {
26     !include( config.pri ) {
27         error("Can't find config.pri. Have you run 'nmake -f Makefile.nmake' two directories up?")
28     }
29 }
30
31 INCLUDEPATH += ../.. ../../wiretap
32 win32:INCLUDEPATH += \
33     $${WIRESHARK_LIB_DIR}/gtk2/include/glib-2.0 $${WIRESHARK_LIB_DIR}/gtk2/lib/glib-2.0/include \
34     $${WIRESHARK_LIB_DIR}/WpdPack/Include \
35     $${WIRESHARK_LIB_DIR}/AirPcap_Devpack_4_1_0_1622/Airpcap_Devpack/include \
36     $${WIRESHARK_LIB_DIR}/zlib125/include
37
38 # XXX - If we add ../gtk/recent.c to SOURCES, jom will try to compile everything
39 # in ../gtk. Until we move the things we need in recent.c to a common file, simply
40 # copy it to our current directory.
41 #recent.target = recent.c
42 #!win32:recent.commands = $$QMAKE_COPY ../gtk/$$recent.target .
43 #win32:recent.commands = $$QMAKE_COPY ..\\gtk\\$$recent.target .
44 #recent.depends = ../gtk/$$recent.target
45 #QMAKE_EXTRA_TARGETS += recent
46
47 SOURCES += \
48     ../../airpcap_loader.c \
49     ../../alert_box.c     \
50     ../../capture-pcap-util.c     \
51     ../../capture.c       \
52     ../../capture_ifinfo.c \
53     ../../capture_info.c  \
54     ../../capture_opts.c \
55     ../../capture_sync.c  \
56     ../../capture_ui_utils.c \
57     ../../cfile.c \
58     ../../clopts_common.c \
59     ../../color_filters.c \
60     ../../disabled_protos.c       \
61     ../../file.c  \
62     ../../fileset.c       \
63     ../../filters.c       \
64     ../../frame_data_sequence.c   \
65     ../../g711.c \
66     ../../merge.c \
67     ../../packet-range.c  \
68     ../../print.c \
69     ../../proto_hier_stats.c      \
70     ../../ps.c    \
71     ../../recent.c \
72     ../../summary.c       \
73     ../../sync_pipe_write.c       \
74     ../../tap-megaco-common.c     \
75     ../../tap-rtp-common.c    \
76     ../../tempfile.c      \
77     ../../timestats.c     \
78     ../../u3.c \
79     ../../util.c  \
80     ../../version_info.c \
81     byte_view_tab.cpp \
82     byte_view_text.cpp \
83     capture_file_dialog.cpp \
84     capture_info_dialog.cpp \
85     capture_interface_dialog.cpp \
86     color_dialog.cpp \
87     color_utils.cpp \
88     display_filter_combo.cpp \
89     display_filter_edit.cpp \
90     fileset_dialog.cpp \
91     interface_tree.cpp \
92     main.cpp \
93     main_status_bar.cpp \
94     main_welcome.cpp \
95     main_window.cpp \
96     monospace_font.cpp \
97     packet_list.cpp \
98     packet_list_model.cpp \
99     packet_list_record.cpp \
100     progress_dialog.cpp \
101     proto_tree.cpp \
102     qt_ui_utils.cpp \
103     recent_file_status.cpp \
104     simple_dialog_qt.cpp \
105     wireshark_application.cpp \
106     label_stack.cpp
107
108
109 unix:SOURCES += ../../capture-pcap-util-unix.c
110 win32:SOURCES += ../../capture-wpcap.c ../../capture_wpcap_packet.c
111
112 HEADERS  += \
113     ../../wsutil/privileges.h \
114     byte_view_tab.h \
115     byte_view_text.h \
116     capture_file_dialog.h \
117     capture_info_dialog.h \
118     capture_interface_dialog.h \
119     color_dialog.h \
120     color_utils.h \
121     display_filter_combo.h \
122     display_filter_edit.h \
123     fileset_dialog.h \
124     interface_tree.h \
125     main_status_bar.h \
126     main_welcome.h \
127     main_window.h \
128     monospace_font.h \
129     packet_list.h \
130     packet_list_model.h \
131     packet_list_record.h \
132     progress_dialog.h \
133     proto_tree.h \
134     qt_ui_utils.h \
135     qt_ui_utils.h \
136     recent_file_status.h \
137     simple_dialog_qt.h \
138     wireshark_application.h \
139     label_stack.h
140
141
142 FORMS += main_window.ui
143
144 DEFINES += HAVE_CONFIG_H INET6 REENTRANT
145 unix:DEFINES += _U_=\"__attribute__((unused))\"
146
147 macx:QMAKE_LFLAGS += \
148     -framework CoreServices \
149     -framework ApplicationServices -framework CoreFoundation -framework CoreServices
150
151 unix:LIBS += -L../../lib -Wl,-rpath ../../lib -lwireshark -lwiretap -lwsutil \
152     -lpcap -lportaudio
153 macx:LIBS += -Wl,-macosx_version_min,10.5 -liconv
154
155 # http://stackoverflow.com/questions/3984104/qmake-how-to-copy-a-file-to-the-output
156 unix: {
157     EXTRA_BINFILES = \
158         ../../dumpcap \
159         ../../lib/*.so  \
160 }
161 unix:!macx {
162     for(FILE,EXTRA_BINFILES){
163         QMAKE_POST_LINK += $$quote(cp $${FILE} .$$escape_expand(\n\t))
164     }
165 }
166 # qmake 2.01a / Qt 4.7.0 doesn't set DESTDIR on OS X.
167 macx {
168     for(FILE,EXTRA_BINFILES){
169         QMAKE_POST_LINK += $$quote(cp $${FILE} Wireshark.app/Contents/MacOS$$escape_expand(\n\t))
170     }
171 }
172
173 win32 {
174     LIBS += \
175         wsock32.lib user32.lib shell32.lib comctl32.lib \
176         -L../../epan -llibwireshark -L../../wsutil -llibwsutil -L../../wiretap -lwiretap-1.7.0 \
177         -L$${GLIB_DIR}/lib -lglib-2.0 -lgmodule-2.0
178
179     !isEmpty(PORTAUDIO_DIR) {
180         PA_SOURCES = \
181             common/pa_allocation.c \
182             common/pa_converters.c \
183             common/pa_cpuload.c \
184             common/pa_dither.c \
185             common/pa_front.c \
186             common/pa_process.c \
187             common/pa_skeleton.c \
188             common/pa_stream.c \
189             common/pa_trace.c \
190             hostapi/wmme/pa_win_wmme.c \
191             os/win/pa_win_hostapis.c \
192             os/win/pa_win_util.c \
193             os/win/pa_win_waveformat.c \
194             os/win/pa_x86_plain_converters.c
195
196         for(FILE,PA_SOURCES){
197             SOURCES += $${PORTAUDIO_DIR}/src/$${FILE}
198         }
199     }
200
201     EXTRA_BINFILES = \
202         ../../dumpcap.exe \
203         ../../epan/libwireshark.dll ../../wiretap/wiretap-1.7.0.dll ../../wsutil/libwsutil.dll \
204         $${GLIB_DIR}/bin/libglib-2.0-0.dll $${GLIB_DIR}/bin/libgmodule-2.0-0.dll \
205         $${GLIB_DIR}/bin/libgthread-2.0-0.dll $${GLIB_DIR}/bin/intl.dll \
206         $${C_ARES_DIR}/bin/libcares-2.dll $${ZLIB_DIR}/zlib1.dll \
207         $${GNUTLS_DIR}/bin/libgcrypt-11.dll $${GNUTLS_DIR}/bin/libgnutls-26.dll \
208         $${GNUTLS_DIR}/bin/libgpg-error-0.dll $${GNUTLS_DIR}/bin/ $${GNUTLS_DIR}/bin/libtasn1-3.dll \
209         $${GNUTLS_DIR}/bin/libintl-8.dll $${SMI_DIR}/bin/libsmi-2.dll \
210         $${KFW_DIR}/bin/comerr32.dll $${KFW_DIR}/bin/krb5_32.dll $${KFW_DIR}/bin/k5sprt32.dll \
211         $${LUA_DIR}/lua5.1.dll \
212         ../../colorfilters ../../dfilters ../../cfilters
213
214     EXTRA_BINFILES ~= s,/,\\,g
215     for(FILE,EXTRA_BINFILES){
216         QMAKE_POST_LINK +=$$quote($(COPY_FILE) $${FILE} $(DESTDIR)$$escape_expand(\n\t))
217     }
218     PLUGINS_DIR = $(DESTDIR)\plugins\\$${VERSION}
219     QMAKE_POST_LINK +=$$quote($(CHK_DIR_EXISTS) $${PLUGINS_DIR} $(MKDIR) $${PLUGINS_DIR}$$escape_expand(\n\t))
220     QMAKE_POST_LINK +=$$quote($(COPY_FILE) ..\..\wireshark-gtk2\plugins\\$${VERSION}\*.dll $(DESTDIR)\plugins\\$${VERSION}$$escape_expand(\n\t))
221
222     # This doesn't depend on wireshark-gtk2. It also doesn't work.
223     #PLUGINS_IN_PWD=$${IN_PWD}
224     #PLUGINS_OUT_PWD=$${OUT_PWD}
225     #QMAKE_POST_LINK +=$$quote(cd $$replace(PLUGINS_IN_PWD, /, \\)\\..\\..\\plugins$$escape_expand(\n\t))
226     #QMAKE_POST_LINK +=$$quote(nmake -f Makefile.nmake INSTALL_DIR=$$replace(PLUGINS_OUT_PWD, /, \\)\\$(DESTDIR)$$escape_expand(\n\t))
227     #QMAKE_POST_LINK +=$$quote(cd $$replace(PLUGINS_IN_PWD, /, \\)$$escape_expand(\n\t))
228
229 }
230
231
232 RESOURCES += \
233     toolbar.qrc \
234     welcome.qrc \
235     display_filter.qrc
236
237 ICON = ../../packaging/macosx/Resources/Wireshark.icns