1# Copyright 2005-2019 The Mumble Developers. All rights reserved.
2# Use of this source code is governed by a BSD-style license
3# that can be found in the LICENSE file at the root of the
4# Mumble source tree or at <https://www.mumble.info/LICENSE>.
5
6include(../mumble.pri)
7include(../../qmake/python.pri)
8include(../../qmake/lrelease.pri)
9
10DEFINES *= MUMBLE
11TEMPLATE = app
12TARGET = mumble
13
14!CONFIG(qt4-legacy-compat) {
15  CONFIG += no-qt4-legacy-compat
16}
17
18CONFIG(no-qt4-legacy-compat):isEqual(QT_MAJOR_VERSION, 4) {
19  error("$$escape_expand(\\n)$$escape_expand(\\n)"\
20        "Mumble client support for Qt 4 is deprecated and will be dropped$$escape_expand(\\n)"\
21        "completely in the future. We highly recommend switching to$$escape_expand(\\n)"\
22        "building Mumble with Qt 5. For now CONFIG+=qt4-legacy-compat$$escape_expand(\\n)"\
23        "can be used to build with Qt 4. Note that if built this way,$$escape_expand(\\n)"\
24        "Mumble might lack certain bug-fixes and capabilities available$$escape_expand(\\n)"\
25        "when built with Qt 5.$$escape_expand(\\n)"\
26        "$$escape_expand(\\n)")
27}
28
29isEqual(QT_MAJOR_VERSION, 4) {
30  warning("$$escape_expand(\\n)$$escape_expand(\\n)"\
31          "Mumble client support for Qt 4 is deprecated and will be dropped$$escape_expand(\\n)"\
32          "completely in the future. We highly recommend switching to$$escape_expand(\\n)"\
33          "building Mumble with Qt 5. When built with Qt 4, Mumble might$$escape_expand(\\n)"\
34          "lack certain bug-fixes and capabilities available when built$$escape_expand(\\n)"\
35          "with Qt 5 already.$$escape_expand(\\n)"\
36          "$$escape_expand(\\n)")
37}
38
39CONFIG(static) {
40  # On Windows, building a static client
41  # means building the main app into a DLL.
42  win32 {
43    TEMPLATE = lib
44    TARGET = mumble_app
45    VERSION =
46
47    CONFIG -= static
48    CONFIG += shared qt_static mumble_dll
49    DEFINES += USE_MUMBLE_DLL
50    isEqual(QT_MAJOR_VERSION, 5) {
51      # Qt 5 uses an auto-generated .cpp file for importing plugins.
52      # However, it is only automatically enabled for TEMPLATE = app.
53      # Since we're building mumble_app.dll, we're not an app, but a library.
54      # This means we'll have to explicitly ask Qt to generate and build the
55      # plugin importer.
56      CONFIG += force_import_plugins
57    }
58  }
59
60  DEFINES *= USE_STATIC
61  CONFIG += static_qt_plugins
62}
63
64QT  *= network sql xml svg
65isEqual(QT_MAJOR_VERSION, 5) {
66  QT *= widgets
67
68  CONFIG(qtspeech) {
69    qtHaveModule(texttospeech) {
70      QT *= texttospeech
71    } else {
72      error("You enabled the 'qtspeech' CONFIG option, but the required 'texttospeech' module is not available on your system!")
73    }
74  }
75}
76
77HEADERS *= BanEditor.h \
78    ACLEditor.h \
79    ConfigWidget.h \
80    Log.h \
81    AudioConfigDialog.h \
82    AudioStats.h \
83    AudioInput.h \
84    AudioOutput.h \
85    AudioOutputSample.h \
86    AudioOutputSpeech.h \
87    AudioOutputUser.h \
88    CELTCodec.h \
89    OpusCodec.h \
90    CustomElements.h \
91    MainWindow.h \
92    ServerHandler.h \
93    About.h \
94    ConnectDialog.h \
95    GlobalShortcut.h \
96    TextToSpeech.h \
97    Settings.h \
98    Database.h \
99    VersionCheck.h \
100    Global.h \
101    UserModel.h \
102    Audio.h \
103    ConfigDialog.h \
104    Plugins.h \
105    PTTButtonWidget.h \
106    LookConfig.h \
107    Overlay.h \
108    OverlayText.h \
109    SharedMemory.h \
110    AudioWizard.h \
111    ViewCert.h \
112    TextMessage.h \
113    NetworkConfig.h \
114    LCD.h \
115    Usage.h \
116    Cert.h \
117    ClientUser.h \
118    UserEdit.h \
119    UserListModel.h \
120    UserLocalVolumeDialog.h \
121    Tokens.h \
122    UserView.h \
123    RichTextEditor.h \
124    UserInformation.h \
125    SocketRPC.h \
126    VoiceRecorder.h \
127    VoiceRecorderDialog.h \
128    WebFetch.h \
129    ../SignalCurry.h \
130    OverlayClient.h \
131    OverlayUser.h \
132    OverlayUserGroup.h \
133    OverlayConfig.h \
134    OverlayEditor.h \
135    OverlayEditorScene.h \
136    MumbleApplication.h \
137    ApplicationPalette.h \
138    ThemeInfo.h \
139    Themes.h \
140    OverlayPositionableItem.h \
141    widgets/MUComboBox.h \
142    DeveloperConsole.h \
143    PathListWidget.h \
144    XMLTools.h \
145    SvgIcon.h
146
147SOURCES *= BanEditor.cpp \
148    ACLEditor.cpp \
149    ConfigWidget.cpp \
150    Log.cpp \
151    AudioConfigDialog.cpp \
152    AudioStats.cpp \
153    AudioInput.cpp \
154    AudioOutput.cpp \
155    AudioOutputSample.cpp \
156    AudioOutputSpeech.cpp \
157    AudioOutputUser.cpp \
158    main.cpp \
159    CELTCodec.cpp \
160    OpusCodec.cpp \
161    CustomElements.cpp \
162    MainWindow.cpp \
163    ServerHandler.cpp \
164    About.cpp \
165    ConnectDialog.cpp \
166    Settings.cpp \
167    Database.cpp \
168    VersionCheck.cpp \
169    Global.cpp \
170    UserModel.cpp \
171    Audio.cpp \
172    ConfigDialog.cpp \
173    Plugins.cpp \
174    PTTButtonWidget.cpp \
175    LookConfig.cpp \
176    OverlayClient.cpp \
177    OverlayConfig.cpp \
178    OverlayEditor.cpp \
179    OverlayEditorScene.cpp \
180    OverlayUser.cpp \
181    OverlayUserGroup.cpp \
182    Overlay.cpp \
183    OverlayText.cpp \
184    SharedMemory.cpp \
185    AudioWizard.cpp \
186    ViewCert.cpp \
187    Messages.cpp \
188    TextMessage.cpp \
189    GlobalShortcut.cpp \
190    NetworkConfig.cpp \
191    LCD.cpp \
192    Usage.cpp \
193    Cert.cpp \
194    ClientUser.cpp \
195    UserEdit.cpp \
196    UserListModel.cpp \
197    UserLocalVolumeDialog.cpp \
198    Tokens.cpp \
199    UserView.cpp \
200    RichTextEditor.cpp \
201    UserInformation.cpp \
202    SocketRPC.cpp \
203    VoiceRecorder.cpp \
204    VoiceRecorderDialog.cpp \
205    WebFetch.cpp \
206    MumbleApplication.cpp \
207    ../../3rdparty/smallft-src/smallft.cpp \
208    ThemeInfo.cpp \
209    Themes.cpp \
210    OverlayPositionableItem.cpp \
211    widgets/MUComboBox.cpp \
212    DeveloperConsole.cpp \
213    PathListWidget.cpp \
214    XMLTools.cpp \
215    SvgIcon.cpp
216
217CONFIG(qtspeech) {
218  SOURCES *= TextToSpeech.cpp
219}
220
221RESOURCES *= mumble.qrc mumble_translations.qrc ../../themes/MumbleTheme.qrc
222
223!CONFIG(no-classic-theme) {
224  RESOURCES *= ../../themes/ClassicTheme.qrc
225}
226
227# Add the various mumble_flags_XX.qrc files to RESOURCES...
228include(flags/mumble_flags.pri)
229
230FORMS *= ConfigDialog.ui \
231    MainWindow.ui \
232    ConnectDialog.ui \
233    ConnectDialogEdit.ui \
234    BanEditor.ui \
235    ACLEditor.ui \
236    Plugins.ui \
237    PTTButtonWidget.ui \
238    Overlay.ui \
239    OverlayEditor.ui \
240    LookConfig.ui \
241    AudioInput.ui \
242    AudioOutput.ui \
243    Log.ui \
244    TextMessage.ui \
245    AudioStats.ui \
246    NetworkConfig.ui \
247    LCD.ui \
248    GlobalShortcut.ui \
249    GlobalShortcutTarget.ui \
250    Cert.ui \
251    UserEdit.ui \
252    UserLocalVolumeDialog.ui \
253    AudioWizard.ui \
254    Tokens.ui \
255    RichTextEditor.ui \
256    RichTextEditorLink.ui \
257    UserInformation.ui \
258    VoiceRecorderDialog.ui
259
260# Include TRANSLATIONS variable
261include(translations.pri)
262
263PRECOMPILED_HEADER = mumble_pch.hpp
264INCLUDEPATH *= ../../3rdparty/qqbonjour-src
265INCLUDEPATH *= ../../3rdparty/smallft-src
266INCLUDEPATH *= widgets
267
268CONFIG(static) {
269  # Ensure that static Mumble.app on Mac OS X
270  # includes and exports its Qt symbols to plugins.
271  #
272  # Some plugins (libmanual) already make use of Qt
273  # functionality, and it's not inconceivable that some
274  # Mumble features will be split into plugins in the
275  # future.
276  macx {
277    QMAKE_LFLAGS -= -Wl,-dead_strip
278    QMAKE_LFLAGS += -Wl,-all_load
279  }
280}
281
282!CONFIG(no-manual-plugin) {
283  SOURCES *= ManualPlugin.cpp
284  HEADERS *= ManualPlugin.h
285  FORMS *= ManualPlugin.ui
286  DEFINES *= USE_MANUAL_PLUGIN
287}
288
289unix:!CONFIG(bundled-speex):system($$PKG_CONFIG --atleast-version=1.2 speexdsp):system($$PKG_CONFIG --atleast-version=1.2 speex) {
290  CONFIG *= no-bundled-speex
291}
292
293CONFIG(no-crash-report) {
294  DEFINES *= NO_CRASH_REPORT
295} else:unix:!macx {
296  DEFINES *= NO_CRASH_REPORT
297} else {
298  HEADERS *= CrashReporter.h
299  SOURCES *= CrashReporter.cpp
300}
301
302CONFIG(no-xinput2) {
303  DEFINES *= NO_XINPUT2
304}
305
306CONFIG(no-bundled-speex) {
307  must_pkgconfig(speex)
308  must_pkgconfig(speexdsp)
309}
310
311!CONFIG(no-bundled-speex) {
312  INCLUDEPATH *= ../../3rdparty/speex-src/include ../../3rdparty/speex-src/libspeex ../../3rdparty/speex-build ../../3rdparty/speexdsp-src/include ../../3rdparty/speexdsp-src/libspeexdsp
313  LIBS   *= -lspeex
314}
315
316CONFIG(sbcelt) {
317  SOURCES -= CELTCodec.cpp
318  SOURCES += CELTCodec_sbcelt.cpp
319  INCLUDEPATH *= ../../3rdparty/celt-0.7.0-src/libcelt ../../3rdparty/sbcelt-src
320  LIBS *= -lcelt -lsbcelt
321  DEFINES *= SBCELT_PREFIX_API SBCELT_COMPAT_API USE_SBCELT
322} else {
323  unix:!CONFIG(bundled-celt):system($$PKG_CONFIG --atleast-version=0.7.0 celt) {
324    CONFIG *= no-bundled-celt
325  }
326  CONFIG(no-bundled-celt) {
327    INCLUDEPATH *= /usr/include/celt
328    unix {
329      QMAKE_CFLAGS *= "-I/usr/include/celt" "-isystem /usr/include/celt"
330      QMAKE_CXXFLAGS *= "-I/usr/include/celt" "-isystem /usr/include/celt"
331    }
332  }
333  !CONFIG(no-bundled-celt) {
334    INCLUDEPATH *= ../../3rdparty/celt-0.7.0-src/libcelt
335    unix {
336      QMAKE_CFLAGS *= "-I../../3rdparty/celt-0.7.0-src/libcelt" "-isystem ../../3rdparty/celt-0.7.0-src/libcelt"
337      QMAKE_CXXFLAGS *= "-I../../3rdparty/celt-0.7.0-src/libcelt" "-isystem ../../3rdparty/celt-0.7.0-src/libcelt"
338    }
339  }
340}
341
342!win32:!macx:!CONFIG(no-dbus) {
343  CONFIG  *= dbus
344}
345!contains(UNAME, FreeBSD):!CONFIG(no-g15) {
346  CONFIG *= g15
347}
348
349!CONFIG(no-bonjour) {
350  CONFIG *= bonjour
351}
352
353CONFIG(no-vorbis-recording) {
354  DEFINES *= NO_VORBIS_RECORDING
355}
356
357unix:!CONFIG(bundled-opus):system($$PKG_CONFIG --exists opus) {
358  must_pkgconfig(opus)
359  DEFINES *= USE_OPUS
360} else {
361  !CONFIG(no-opus) {
362    CONFIG *= opus
363  }
364
365  CONFIG(opus) {
366    INCLUDEPATH *= ../../3rdparty/opus-src/celt ../../3rdparty/opus-src/include ../../3rdparty/opus-src/src ../../3rdparty/opus-build/src
367    DEFINES *= USE_OPUS
368    unix {
369      QMAKE_CFLAGS *= "-I../../3rdparty/opus-src/celt" "-isystem  ../../3rdparty/opus-src/celt"
370      QMAKE_CFLAGS *= "-I../../3rdparty/opus-src/include" "-isystem ../../3rdparty/opus-src/include"
371      QMAKE_CXXFLAGS *= "-I../../3rdparty/opus-src/celt" "-isystem  ../../3rdparty/opus-src/celt"
372      QMAKE_CXXFLAGS *= "-I../../3rdparty/opus-src/include" "-isystem ../../3rdparty/opus-src/include"
373    }
374  }
375}
376
377unix:!CONFIG(bundled-rnnoise):system($$PKG_CONFIG --exists rnnoise) {
378  must_pkgconfig(rnnoise)
379  DEFINES *= USE_RNNOISE
380} else {
381  !CONFIG(no-rnnoise) {
382    CONFIG *= rnnoise
383  }
384
385  CONFIG(rnnoise) {
386    INCLUDEPATH *= ../../3rdparty/rnnoise-src/include
387    DEFINES *= USE_RNNOISE
388    LIBS *= -lrnnoise
389  }
390}
391
392win32 {
393  CONFIG(mumble_dll) {
394    RC_FILE = mumble_dll.rc
395  } else {
396    RC_FILE = mumble.rc
397  }
398  HEADERS *= GlobalShortcut_win.h Overlay_win.h TaskList.h UserLockFile.h
399  SOURCES *= GlobalShortcut_win.cpp Overlay_win.cpp SharedMemory_win.cpp Log_win.cpp os_win.cpp TaskList.cpp WinGUIDs.cpp ../../overlay/ods.cpp UserLockFile_win.cpp os_early_win.cpp
400
401  !CONFIG(qtspeech) {
402    SOURCES *= TextToSpeech_win.cpp
403  }
404
405  LIBS  *= -ldxguid -ldinput8 -lsapi -lole32 -lws2_32 -ladvapi32 -lwintrust -ldbghelp -lshell32 -lshlwapi -luser32 -lgdi32 -lpsapi
406  win32-g++ {
407    LIBS *= -lsndfile -lvorbis -lvorbisfile -lvorbisenc -logg -lFLAC
408  }
409  win32-msvc* {
410    LIBS *= -lsndfile -lvorbis -lvorbisfile -logg -lFLAC
411  }
412
413  # Boost
414  win32-msvc* {
415    LIBS *= -llibboost_system-mt -llibboost_thread-mt
416  }
417  win32-g++ {
418    LIBS *= -lboost_system-mt
419
420    # The library has a different name in MXE
421    contains(QMAKE_HOST.os, Linux) {
422      LIBS *= -lboost_thread_win32-mt
423    } else {
424      LIBS *= -lboost_thread-mt
425    }
426  }
427
428  LIBS  *= -ldelayimp -delayload:shell32.dll
429
430  DEFINES *= WIN32
431  !CONFIG(no-asio) {
432    CONFIG *= asio
433  }
434  !CONFIG(no-directsound) {
435    CONFIG *= directsound
436  }
437  !CONFIG(no-wasapi) {
438    CONFIG *= wasapi
439  }
440  !CONFIG(no-gkey) {
441    CONFIG *= gkey
442  }
443
444  CONFIG(gkey) {
445    HEADERS *= GKey.h
446    SOURCES *= GKey.cpp
447    DEFINES *= USE_GKEY
448  }
449
450  !CONFIG(no-xboxinput) {
451    CONFIG *= xboxinput
452  }
453  CONFIG(xboxinput) {
454    HEADERS *= XboxInput.h
455    SOURCES *= XboxInput.cpp
456    DEFINES *= USE_XBOXINPUT
457  }
458
459  # XInputCheck (3rdparty/xinputheck-src)
460  INCLUDEPATH *= ../../3rdparty/xinputcheck-src
461  LIBS *= -lxinputcheck
462
463  !CONFIG(mumble_dll) {
464    !CONFIG(no-elevation) {
465      CONFIG(release, debug|release) {
466        QMAKE_LFLAGS *= /MANIFESTUAC:\"level=\'asInvoker\' uiAccess=\'true\'\"
467      }
468    }
469    win32-msvc* {
470      QMAKE_POST_LINK = $$QMAKE_POST_LINK$$escape_expand(\\n\\t)$$quote(mt.exe -nologo -updateresource:$(DESTDIR_TARGET);1 -manifest mumble.appcompat.manifest)
471    }
472  }
473}
474
475unix {
476  HAVE_PULSEAUDIO=$$system($$PKG_CONFIG --modversion --silence-errors libpulse)
477  HAVE_JACKAUDIO=$$system($$PKG_CONFIG --modversion --silence-errors jack)
478
479  !isEmpty(HAVE_PULSEAUDIO):!CONFIG(no-pulseaudio) {
480    CONFIG *= pulseaudio
481  }
482
483  !isEmpty(HAVE_JACKAUDIO):!CONFIG(no-jackaudio) {
484    CONFIG *= jackaudio
485  }
486
487
488  !CONFIG(no-bundled-speex) {
489    QMAKE_CFLAGS *= -I../../3rdparty/speex-src/include -I../../3rdparty/speex-build
490    QMAKE_CXXFLAGS *= -I../../3rdparty/speex-src/include -I../../3rdparty/speex-build
491    QMAKE_CXXFLAGS_RELEASE *= -I../../3rdparty/speex-src/include -I../../3rdparty/speex-build
492    QMAKE_CXXFLAGS_DEBUG *= -I../../3rdparty/speex-src/include -I../../3rdparty/speex-build
493  }
494
495  CONFIG *= link_pkgconfig
496
497  must_pkgconfig(sndfile)
498
499  macx {
500    TARGET = Mumble
501    ICON = ../../icons/mumble.icns
502    QMAKE_INFO_PLIST = mumble.plist
503    QMAKE_PKGINFO_TYPEINFO = MBLE
504
505    LIBS += -framework Security -framework SecurityInterface -framework ApplicationServices
506
507    HEADERS *= GlobalShortcut_macx.h AppNap.h
508    SOURCES *= SharedMemory_unix.cpp
509    OBJECTIVE_SOURCES *= GlobalShortcut_macx.mm os_macx.mm Log_macx.mm AppNap.mm
510
511    !CONFIG(qtspeech) {
512      OBJECTIVE_SOURCES *= TextToSpeech_macx.mm
513    }
514
515    !CONFIG(universal) {
516      # Link against libxar so we can inspect Mac OS X installer packages.
517      CONFIG(static) {
518        LIBS += -lxml2 -lbz2 -lxar
519      } else {
520        LIBS += -lxar
521      }
522
523      LIBS += -framework ScriptingBridge
524      OBJECTIVE_SOURCES += Overlay_macx.mm
525    } else {
526      SOURCES += Overlay_unix.cpp
527    }
528
529    # CoreAudio
530    LIBS += -framework CoreAudio -framework AudioUnit -framework AudioToolbox
531    SOURCES += CoreAudio.cpp
532    HEADERS += CoreAudio.h
533  } else {
534    HEADERS *= GlobalShortcut_unix.h
535    SOURCES *= os_unix.cpp GlobalShortcut_unix.cpp Overlay_unix.cpp SharedMemory_unix.cpp Log_unix.cpp
536
537    !CONFIG(qtspeech) {
538      SOURCES *= TextToSpeech_unix.cpp
539    }
540
541    must_pkgconfig(x11)
542    linux* {
543      LIBS *= -lrt
544    }
545    LIBS *= -lXi
546
547    !CONFIG(no-oss) {
548      CONFIG  *= oss
549    }
550
551    !CONFIG(no-alsa):contains(UNAME, Linux) {
552      CONFIG *= alsa
553    }
554
555    !CONFIG(no-speechd) {
556      CONFIG *= speechd
557    } else {
558      DEFINES *= USE_NO_TTS
559    }
560  }
561}
562
563alsa {
564  DEFINES *= USE_ALSA
565  must_pkgconfig(alsa)
566  HEADERS *= ALSAAudio.h
567  SOURCES *= ALSAAudio.cpp
568}
569
570oss {
571  DEFINES *= USE_OSS
572  HEADERS *= OSS.h
573  SOURCES *= OSS.cpp
574  INCLUDEPATH *= /usr/lib/oss/include
575}
576
577pulseaudio {
578  DEFINES *= USE_PULSEAUDIO
579  must_pkgconfig(libpulse)
580  HEADERS *= PulseAudio.h
581  SOURCES *= PulseAudio.cpp
582}
583
584jackaudio {
585  DEFINES *= USE_JACKAUDIO
586  PKGCONFIG *= jack
587  HEADERS *= JackAudio.h
588  SOURCES *= JackAudio.cpp
589}
590
591portaudio {
592  DEFINES *= USE_PORTAUDIO
593  must_pkgconfig(portaudio-2.0)
594  HEADERS *= PAAudio.h
595  SOURCES *= PAAudio.cpp
596}
597
598asio {
599  DEFINES *= USE_ASIO
600  HEADERS *= ASIOInput.h
601  SOURCES *= ASIOInput.cpp
602  FORMS *= ASIOInput.ui
603
604  # If 3rdparty/asio exists, use that...
605  exists(../../3rdparty/asio) {
606    INCLUDEPATH *= ../../3rdparty/asio/common ../../3rdparty/asio/host ../../3rdparty/asio/host/pc
607  # Otherwise, fall back to the path from winpaths_*.pri.
608  } else {
609    INCLUDEPATH *= "$$ASIO_PATH/common" "$$ASIO_PATH/host" "$$ASIO_PATH/host/pc"
610  }
611}
612
613bonjour {
614  DEFINES *= USE_BONJOUR
615
616  HEADERS *= \
617    ../../3rdparty/qqbonjour-src/BonjourRecord.h \
618    ../../3rdparty/qqbonjour-src/BonjourServiceResolver.h \
619    ../../3rdparty/qqbonjour-src/BonjourServiceBrowser.h \
620    BonjourClient.h
621  SOURCES *= \
622    ../../3rdparty/qqbonjour-src/BonjourServiceResolver.cpp \
623    ../../3rdparty/qqbonjour-src/BonjourServiceBrowser.cpp \
624    BonjourClient.cpp
625  win32 {
626    INCLUDEPATH *= "$$BONJOUR_PATH/include"
627    QMAKE_LIBDIR *= "$$BONJOUR_PATH/lib/win32"
628    LIBS *= -lDNSSD
629  }
630  unix:!macx {
631    system($$PKG_CONFIG --exists avahi-compat-libdns_sd avahi-client) {
632      must_pkgconfig(avahi-compat-libdns_sd)
633      must_pkgconfig(avahi-client)
634    } else {
635      LIBS *= -ldns_sd
636    }
637  }
638}
639
640dbus {
641  DEFINES *= USE_DBUS
642  QT *= dbus
643  HEADERS *= DBus.h
644  SOURCES *= DBus.cpp
645}
646
647speechd {
648  DEFINES *= USE_SPEECHD
649  system($$PKG_CONFIG --atleast-version=0.8 speech-dispatcher) {
650    DEFINES *= USE_SPEECHD_PKGCONFIG
651    must_pkgconfig(speech-dispatcher)
652  } else {
653    LIBS *= -lspeechd
654    INCLUDEPATH *= /usr/include/speech-dispatcher
655  }
656}
657
658directsound {
659  DEFINES *= USE_DIRECTSOUND
660  HEADERS *= DirectSound.h
661  SOURCES *= DirectSound.cpp
662  LIBS *= -ldsound
663  win32-g++ {
664    LIBS *= -lksuser
665  }
666}
667
668wasapi {
669  DEFINES *= USE_WASAPI
670  HEADERS *= WASAPI.h WASAPINotificationClient.h
671  SOURCES *= WASAPI.cpp WASAPINotificationClient.cpp
672  LIBS *= -lavrt -delayload:avrt.DLL
673}
674
675g15 {
676  DEFINES *= USE_G15
677  win32|macx {
678    SOURCES *= G15LCDEngine_helper.cpp
679    HEADERS *= G15LCDEngine_helper.h ../../g15helper/g15helper.h
680  }
681  unix:!macx:!contains(UNAME, FreeBSD) {
682    SOURCES *= G15LCDEngine_unix.cpp
683    HEADERS *= G15LCDEngine_unix.h
684    LIBS *= -lg15daemon_client
685  }
686}
687
688CONFIG(no-update) {
689  DEFINES *= NO_UPDATE_CHECK
690}
691
692!CONFIG(no-embed-qt-translations):!exists($$[QT_INSTALL_TRANSLATIONS]) {
693  error("$$escape_expand(\\n)$$escape_expand(\\n)"\
694        "The QT_INSTALL_TRANSLATIONS directory ($$[QT_INSTALL_TRANSLATIONS])$$escape_expand(\\n)"\
695  "does not exist.$$escape_expand(\\n)"\
696  "$$escape_expand(\\n)"\
697  "The Mumble build process is attempting to embed Qt translations into the Mumble binary,$$escape_expand(\\n)"\
698  "but it cannot, because the files are missing.$$escape_expand(\\n)"\
699  "$$escape_expand(\\n)"\
700  "If you wish to embed Qt translations into the Mumble binary,$$escape_expand(\\n)"\
701  "you will need to install the translation package for your verison of Qt.$$escape_expand(\\n)"\
702  "For example, On Ubuntu with Qt 5, that package is 'qttranslations5-l10n'.$$escape_expand(\\n)"\
703  "$$escape_expand(\\n)"\
704  "You can also tell the Mumble build process to not embed Qt's$$escape_expand(\\n)"\
705  "translations into the Mumble binary by using the 'no-embed-qt-translations'$$escape_expand(\\n)"\
706  "CONFIG option when running qmake, such as:$$escape_expand(\\n)"\
707  "$$escape_expand(\\n)"\
708  "    $ qmake -recursive main.pro CONFIG+=$$escape_expand(\")no-embed-qt-translations$$escape_expand(\")$$escape_expand(\\n)"\
709  "$$escape_expand(\\n)"\
710  "Please refer to the INSTALL file at the root of the source tree for more information$$escape_expand(\\n)"\
711  "about the build process.$$escape_expand(\\n)"\
712        "$$escape_expand(\\n)")
713}
714
715!CONFIG(no-embed-qt-translations) {
716  QT_TRANSLATIONS_FALLBACK_DIR = qttranslations
717  QT_TRANSLATIONS_FALLBACK_FILES = $$files($$QT_TRANSLATIONS_FALLBACK_DIR/*.ts)
718  for(fn, QT_TRANSLATIONS_FALLBACK_FILES) {
719    !system($$QMAKE_LRELEASE -silent $$fn) {
720      error(Failed to run lrelease for $$fn)
721    }
722  }
723  GENQRC = $$PYTHON ../../scripts/generate-mumble_qt-qrc.py
724  !system($$GENQRC mumble_qt_auto.qrc $$[QT_INSTALL_TRANSLATIONS] $$QT_TRANSLATIONS_FALLBACK_DIR) {
725    error(Failed to run generate-mumble_qt-qrc.py script)
726  }
727  RESOURCES *= mumble_qt_auto.qrc
728}
729
730CONFIG(static_qt_plugins) {
731  DEFINES += USE_STATIC_QT_PLUGINS
732
733  # If QSQLite is a plugin we need to import it in order to use the database
734  exists($$[QT_INSTALL_PLUGINS]/sqldrivers/*qsqlite*) {
735      QTPLUGIN += qsqlite
736  }
737
738  # Since Qt 5.3, qt.prf will automatically populate QT_PLUGINS for static builds
739  # for TEMPLATE=app.
740  #
741  # On Windows, in CONFIG(static), we don't use TEMPLATE=app, so we still need this
742  # code there. But for macOS, we don't need it anymore.
743  !contains(TEMPLATE, .*app)|lessThan(QT_VERSION_INT, 50300) {
744    QTPLUGIN += qsvg qsvgicon
745
746    # For Qt 4 and Qt 5 below 5.4, we need to manually add qtaccessiblewidgets to PLUGINS.
747    # In Qt 5.4, the plugin was integrated into the QtWidgets library.
748    # See QTBUG-43007 and Qt commit 4255ba40ab073a for more information.
749    lessThan(QT_VERSION_INT, 50400) {
750      QTPLUGIN *= qtaccessiblewidgets
751    }
752
753    macx {
754      isEqual(QT_MAJOR_VERSION, 5) {
755        QTPLUGIN += qicns qcocoa
756      } else {
757        QTPLUGIN += qicnsicon
758      }
759    }
760
761    win32 {
762      QTPLUGIN *= qico
763      isEqual(QT_MAJOR_VERSION, 5) {
764        QTPLUGIN += qwindows
765      }
766    }
767  }
768
769  # Icon engines are special; they don't get their lib directory
770  # included automatically by mkspecs/features/qt.prf
771  LIBS *= -L$$[QT_INSTALL_PLUGINS]/iconengines
772}
773
774lrel.output = ${QMAKE_FILE_BASE}.qm
775lrel.commands = $${QMAKE_LRELEASE} ${QMAKE_FILE_NAME}
776lrel.input = TRANSLATIONS
777lrel.CONFIG *= no_link
778lrel.variable_out = rcc.depends
779
780QMAKE_EXTRA_COMPILERS *= lrel
781
782include(../../qmake/symbols.pri)
783