1# This file was created by KDevelop.
2# -------------------------------------------
3
4# Override settings in this file.
5include (x2goclientconfig.pri)
6
7CONFIG += $$(X2GO_CLIENT_TARGET)
8CONFIG += $$(X2GO_LINUX_STATIC)
9CONFIG += link_pkgconfig
10#CONFIG += console
11
12VERSION = "$$cat($${PWD}/VERSION)"
13
14FORMS += src/ui/cupsprintsettingsdialog.ui \
15         src/ui/cupsprintwidget.ui \
16         src/ui/printdialog.ui \
17         src/ui/printercmddialog.ui \
18         src/ui/printwidget.ui \
19         src/ui/xsettingsui.ui \
20         src/ui/brokerpassdialog.ui \
21         src/ui/contest.ui \
22         src/ui/appdialog.ui \
23         src/ui/helpdialog.ui \
24         src/ui/folderexplorer.ui
25
26TRANSLATIONS += res/i18n/x2goclient_cs.ts \
27                res/i18n/x2goclient_de.ts \
28                res/i18n/x2goclient_da.ts \
29                res/i18n/x2goclient_es.ts \
30                res/i18n/x2goclient_et.ts \
31                res/i18n/x2goclient_fi.ts \
32                res/i18n/x2goclient_fr.ts \
33                res/i18n/x2goclient_nb_no.ts \
34                res/i18n/x2goclient_nl.ts \
35                res/i18n/x2goclient_pt.ts \
36                res/i18n/x2goclient_ru.ts \
37                res/i18n/x2goclient_sv.ts \
38                res/i18n/x2goclient_tr.ts \
39                res/i18n/x2goclient_zh_tw.ts
40
41HEADERS += src/configdialog.h \
42           src/editconnectiondialog.h \
43           src/exportdialog.h \
44           src/imgframe.h \
45           src/LDAPSession.h \
46           src/onmainwindow.h \
47           src/sessionbutton.h \
48           src/sessionmanagedialog.h \
49           src/sshmasterconnection.h \
50           src/sshprocess.h \
51           src/SVGFrame.h \
52           src/InteractionDialog.h \
53           src/userbutton.h \
54           src/x2goclientconfig.h \
55           src/x2gologdebug.h \
56           src/printprocess.h \
57           src/cupsprint.h \
58           src/cupsprintwidget.h \
59           src/cupsprintersettingsdialog.h \
60           src/printwidget.h \
61           src/printercmddialog.h \
62           src/printdialog.h \
63           src/wapi.h \
64           src/sessionwidget.h \
65           src/configwidget.h \
66           src/connectionwidget.h \
67           src/settingswidget.h \
68           src/mediawidget.h \
69           src/sharewidget.h \
70           src/clicklineedit.h \
71           src/httpbrokerclient.h \
72           src/ongetpass.h \
73           src/onmainwindow_privat.h \
74           src/x2gosettings.h \
75           src/brokerpassdlg.h \
76           src/contest.h \
77           src/xsettingswidget.h \
78           src/appdialog.h \
79           src/x2goutils.h \
80           src/helpdialog.h \
81           src/sessionexplorer.h \
82           src/folderbutton.h \
83           src/folderexplorer.h \
84           src/non_modal_messagebox.h \
85           src/help.h \
86           src/unixhelper.h \
87           src/compat.h \
88           src/pulsemanager.h
89
90SOURCES += src/sharewidget.cpp \
91           src/settingswidget.cpp \
92           src/mediawidget.cpp \
93           src/configwidget.cpp \
94           src/sessionwidget.cpp \
95           src/connectionwidget.cpp \
96           src/configdialog.cpp \
97           src/editconnectiondialog.cpp \
98           src/exportdialog.cpp \
99           src/imgframe.cpp \
100           src/LDAPSession.cpp \
101           src/onmainwindow.cpp \
102           src/sessionbutton.cpp \
103           src/sessionmanagedialog.cpp \
104           src/sshmasterconnection.cpp \
105           src/sshprocess.cpp \
106           src/SVGFrame.cpp \
107           src/InteractionDialog.cpp \
108           src/userbutton.cpp \
109           src/x2gologdebug.cpp \
110           src/printprocess.cpp \
111           src/cupsprint.cpp \
112           src/cupsprintwidget.cpp \
113           src/cupsprintersettingsdialog.cpp \
114           src/printwidget.cpp \
115           src/printercmddialog.cpp \
116           src/printdialog.cpp \
117           src/wapi.cpp \
118           src/clicklineedit.cpp \
119           src/httpbrokerclient.cpp \
120           src/ongetpass.cpp \
121           src/x2gosettings.cpp \
122           src/brokerpassdlg.cpp \
123           src/contest.cpp \
124           src/xsettingswidget.cpp \
125           src/appdialog.cpp \
126           src/x2goutils.cpp \
127           src/helpdialog.cpp \
128           src/sessionexplorer.cpp \
129           src/folderbutton.cpp \
130           src/folderexplorer.cpp \
131           src/non_modal_messagebox.cpp \
132           src/help.cpp \
133           src/unixhelper.cpp \
134           src/compat.cpp \
135           src/pulsemanager.cpp
136
137unix {
138  isEmpty(PKG_CONFIG):PKG_CONFIG = pkg-config
139
140  !x2go_linux_static {
141    PKGCONFIG += libssh
142
143    # Failure to find libssh_threads is non-fatal, since newer libssh versions
144    # don't ship a separate library any longer.
145    # We can't just check for version 0.8.0, though, since some distros
146    # (looking at you, Ubuntu Bionic/18.04) ship a pre-release version of 0.8.0
147    # which is actually still based upon 0.7.x and still has libssh_threads...
148    system("$$PKG_CONFIG --exists 'libssh_threads'"):PKGCONFIG += libssh_threads
149  }
150  else {
151    # No pkgconfig stuff, because... for some reason we wanted to call the
152    # library libssh_static. This doesn't sound like a standard name a Linux
153    # distro would ship, but at the same time I doubt anyone is building this
154    # package statically anyway. And even if they do, they shouldn't.
155    # It's also unclear how libssh_threads is called in this scheme.
156    LIBS += -lssh_static
157  }
158}
159else:win32 {
160  # pkgconfig is... tricky on Windows. Additionally, libssh 0.7.x stopped
161  # distributing pkgconfig files on non-UNIX platforms, including Windows.
162  # We'll hardcode stuff here. Make sure that it's consistent with the
163  # libraries we use on Windows.
164  LIBS += -lssh
165}
166else {
167  # For backwards-compatibility.
168  LIBS += -lssh -lssh_threads
169}
170
171win32:LIBS += -lAdvAPI32 -lshell32 -lUser32
172
173RC_FILE = res/x2goclient.rc
174SOURCES += src/x2goclient.cpp
175TARGET = x2goclient
176DEFINES += CFGCLIENT
177
178!isEmpty(TRANSLATIONS) {
179  isEmpty(QMAKE_LRELEASE) {
180    # Some Qt versions (looking at you, EPEL 6) are broken
181    # and do not provide the qtPrepareTool test function.
182    # This section is only for working around bugs...
183    !defined(qtPrepareTool) {
184      win32:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\\lrelease.exe
185      else:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease
186    }
187    else {
188      qtPrepareTool(QMAKE_LRELEASE, lrelease)
189    }
190  }
191
192  isEmpty(TS_DIR):TS_DIR = .
193
194  TSQM.name = lrelease ${QMAKE_FILE_IN}
195  TSQM.input = TRANSLATIONS
196  TSQM.output = $$TS_DIR/${QMAKE_FILE_BASE}.qm
197  TSQM.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN}
198  TSQM.CONFIG = no_link
199  QMAKE_EXTRA_COMPILERS += TSQM
200  PRE_TARGETDEPS += compiler_TSQM_make_all
201}
202else:message("No translation files in project")
203
204TEMPLATE = app
205DEPENDPATH += .
206INCLUDEPATH += src
207RESOURCES += res/resources.qrc
208
209exists(res/txt/git-info) {
210  message("Configuring with --git-info")
211  RESOURCES += res/git.qrc
212}
213
214exists(res/txt/changelog) {
215  message("Configuring with --changelog")
216  RESOURCES += res/changelog.qrc
217}
218
219linux|linux-* {
220  message("building $$TARGET via $$QMAKESPEC with ldap and cups")
221  LIBS += -lldap -lcups -lX11 -lXpm
222  DEFINES += __linux__
223}
224x2go_linux_static {
225  message("linking all libs statically")
226  DEFINES += __linux__
227  LIBS += -lssl -lXpm
228  QMAKE_LFLAGS = -Bstatic $$QMAKE_LFLAGS
229}
230
231ICON = $${PWD}/res/img/icons/x2go-mac.icns
232
233macx {
234  message("building $$TARGET with ldap and cups")
235  LIBS += -framework LDAP -lcups -lcrypto -lssl -lz
236
237  !isEmpty(OSX_STDLIB) {
238    QMAKE_CXXFLAGS += -stdlib=$${OSX_STDLIB}
239  }
240
241  !isEmpty(MACPORTS_INCLUDE_PATH) {
242    INCLUDEPATH += $${MACPORTS_INCLUDE_PATH}
243  }
244
245  !isEmpty(MACPORTS_LIBRARY_PATH) {
246    LIBS = -L$${MACPORTS_LIBRARY_PATH} $${LIBS}
247  }
248
249  !isEmpty(MACPORTS_PREFIX) {
250    DEFINES += MACPORTS_PREFIX=\"\\\"$${MACPORTS_PREFIX}\\\"\"
251  }
252
253  # Strictly speaking, this is a bug in qmake and we should neither need $${PWD}
254  # nor QMAKE_INFO_PLIST_OUT nor PRE_TARGETDEPS nor QMAKE_POST_LINK.
255  # Not defining the latter two will however lead to it being empty and no
256  # Info.plist file being created in the first place.
257  # The last command takes care of actually putting the icon in place - yet
258  # another bug in qmake. Bummer.
259  # Qt 4.8 is currently missing patches for substituting FULL_VERSION. Work
260  # around by using the postbuild.sh script.
261  QMAKE_INFO_PLIST = $${PWD}/res/osxbundle/Info.plist
262  QMAKE_INFO_PLIST_OUT = $${TARGET}.app/Contents/Info.plist
263  PRE_TARGETDEPS += $${TARGET}.app/Contents/Info.plist
264  QMAKE_POST_LINK += $${PWD}/res/osxbundle/postbuild.sh \"$${TARGET}\" \"$${VERSION}\" \"$${QMAKE_INFO_PLIST_OUT}\" \"$${QMAKE_COPY}\" \"$${ICON}\" \"$${OUT_PWD}/$${TARGET}.app/Contents/Resources/\"
265}
266win32-* {
267  message("building $$TARGET for windows without ldap and cups")
268  LIBS += -lwinspool -lws2_32
269  CONFIG += static release
270}
271QT += svg network
272greaterThan(QT_MAJOR_VERSION, 4): QT += x11extras
273
274QMAKE_CXXFLAGS_DEBUG -= -g
275QMAKE_CXXFLAGS_DEBUG += -O2 -g3 -ggdb3 -gdwarf-4
276