]>
Commit | Line | Data |
---|---|---|
1 | TEMPLATE = app | |
2 | TARGET = | |
3 | VERSION = 0.6.99 | |
4 | INCLUDEPATH += src src/json src/qt | |
5 | DEFINES += QT_GUI BOOST_THREAD_USE_LIB USE_IPV6 | |
6 | CONFIG += no_include_pwd | |
7 | ||
8 | # for boost 1.37, add -mt to the boost libraries | |
9 | # use: qmake BOOST_LIB_SUFFIX=-mt | |
10 | # for boost thread win32 with _win32 sufix | |
11 | # use: BOOST_THREAD_LIB_SUFFIX=_win32-... | |
12 | # or when linking against a specific BerkelyDB version: BDB_LIB_SUFFIX=-4.8 | |
13 | ||
14 | # Dependency library locations can be customized with BOOST_INCLUDE_PATH, | |
15 | # BOOST_LIB_PATH, BDB_INCLUDE_PATH, BDB_LIB_PATH | |
16 | # OPENSSL_INCLUDE_PATH and OPENSSL_LIB_PATH respectively | |
17 | ||
18 | OBJECTS_DIR = build | |
19 | MOC_DIR = build | |
20 | UI_DIR = build | |
21 | ||
22 | # use: qmake "RELEASE=1" | |
23 | contains(RELEASE, 1) { | |
24 | # Mac: compile for maximum compatibility (10.5, 32-bit) | |
25 | macx:QMAKE_CXXFLAGS += -mmacosx-version-min=10.5 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk | |
26 | ||
27 | !windows:!macx { | |
28 | # Linux: static link | |
29 | LIBS += -Wl,-Bstatic | |
30 | } | |
31 | } | |
32 | ||
33 | # use: qmake "USE_QRCODE=1" | |
34 | # libqrencode (http://fukuchi.org/works/qrencode/index.en.html) must be installed for support | |
35 | contains(USE_QRCODE, 1) { | |
36 | message(Building with QRCode support) | |
37 | DEFINES += USE_QRCODE | |
38 | LIBS += -lqrencode | |
39 | } | |
40 | ||
41 | # use: qmake "USE_UPNP=1" ( enabled by default; default) | |
42 | # or: qmake "USE_UPNP=0" (disabled by default) | |
43 | # or: qmake "USE_UPNP=-" (not supported) | |
44 | # miniupnpc (http://miniupnp.free.fr/files/) must be installed for support | |
45 | contains(USE_UPNP, -) { | |
46 | message(Building without UPNP support) | |
47 | } else { | |
48 | message(Building with UPNP support) | |
49 | count(USE_UPNP, 0) { | |
50 | USE_UPNP=1 | |
51 | } | |
52 | DEFINES += USE_UPNP=$$USE_UPNP STATICLIB | |
53 | INCLUDEPATH += $$MINIUPNPC_INCLUDE_PATH | |
54 | LIBS += $$join(MINIUPNPC_LIB_PATH,,-L,) -lminiupnpc | |
55 | win32:LIBS += -liphlpapi | |
56 | } | |
57 | ||
58 | # use: qmake "USE_DBUS=1" | |
59 | contains(USE_DBUS, 1) { | |
60 | message(Building with DBUS (Freedesktop notifications) support) | |
61 | DEFINES += USE_DBUS | |
62 | QT += dbus | |
63 | } | |
64 | ||
65 | # use: qmake "FIRST_CLASS_MESSAGING=1" | |
66 | contains(FIRST_CLASS_MESSAGING, 1) { | |
67 | message(Building with first-class messaging) | |
68 | DEFINES += FIRST_CLASS_MESSAGING | |
69 | } | |
70 | ||
71 | contains(BITCOIN_NEED_QT_PLUGINS, 1) { | |
72 | DEFINES += BITCOIN_NEED_QT_PLUGINS | |
73 | QTPLUGIN += qcncodecs qjpcodecs qtwcodecs qkrcodecs qtaccessiblewidgets | |
74 | } | |
75 | ||
76 | !windows { | |
77 | # for extra security against potential buffer overflows | |
78 | QMAKE_CXXFLAGS += -fstack-protector | |
79 | QMAKE_LFLAGS += -fstack-protector | |
80 | # do not enable this on windows, as it will result in a non-working executable! | |
81 | } | |
82 | ||
83 | # regenerate src/build.h | |
84 | !windows || contains(USE_BUILD_INFO, 1) { | |
85 | genbuild.depends = FORCE | |
86 | genbuild.commands = cd $$PWD; share/genbuild.sh $$OUT_PWD/build/build.h | |
87 | genbuild.target = genbuildhook | |
88 | PRE_TARGETDEPS += genbuildhook | |
89 | QMAKE_EXTRA_TARGETS += genbuild | |
90 | DEFINES += HAVE_BUILD_INFO | |
91 | } | |
92 | ||
93 | QMAKE_CXXFLAGS_WARN_ON = -fdiagnostics-show-option -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter | |
94 | ||
95 | # Input | |
96 | DEPENDPATH += src src/json src/qt | |
97 | HEADERS += src/qt/bitcoingui.h \ | |
98 | src/qt/transactiontablemodel.h \ | |
99 | src/qt/addresstablemodel.h \ | |
100 | src/qt/optionsdialog.h \ | |
101 | src/qt/sendcoinsdialog.h \ | |
102 | src/qt/addressbookpage.h \ | |
103 | src/qt/messagepage.h \ | |
104 | src/qt/aboutdialog.h \ | |
105 | src/qt/editaddressdialog.h \ | |
106 | src/qt/bitcoinaddressvalidator.h \ | |
107 | src/addrman.h \ | |
108 | src/base58.h \ | |
109 | src/bignum.h \ | |
110 | src/checkpoints.h \ | |
111 | src/compat.h \ | |
112 | src/sync.h \ | |
113 | src/util.h \ | |
114 | src/uint256.h \ | |
115 | src/serialize.h \ | |
116 | src/strlcpy.h \ | |
117 | src/main.h \ | |
118 | src/net.h \ | |
119 | src/key.h \ | |
120 | src/db.h \ | |
121 | src/walletdb.h \ | |
122 | src/script.h \ | |
123 | src/init.h \ | |
124 | src/irc.h \ | |
125 | src/mruset.h \ | |
126 | src/json/json_spirit_writer_template.h \ | |
127 | src/json/json_spirit_writer.h \ | |
128 | src/json/json_spirit_value.h \ | |
129 | src/json/json_spirit_utils.h \ | |
130 | src/json/json_spirit_stream_reader.h \ | |
131 | src/json/json_spirit_reader_template.h \ | |
132 | src/json/json_spirit_reader.h \ | |
133 | src/json/json_spirit_error_position.h \ | |
134 | src/json/json_spirit.h \ | |
135 | src/qt/clientmodel.h \ | |
136 | src/qt/guiutil.h \ | |
137 | src/qt/transactionrecord.h \ | |
138 | src/qt/guiconstants.h \ | |
139 | src/qt/optionsmodel.h \ | |
140 | src/qt/monitoreddatamapper.h \ | |
141 | src/qt/transactiondesc.h \ | |
142 | src/qt/transactiondescdialog.h \ | |
143 | src/qt/bitcoinamountfield.h \ | |
144 | src/wallet.h \ | |
145 | src/keystore.h \ | |
146 | src/qt/transactionfilterproxy.h \ | |
147 | src/qt/transactionview.h \ | |
148 | src/qt/walletmodel.h \ | |
149 | src/bitcoinrpc.h \ | |
150 | src/qt/overviewpage.h \ | |
151 | src/qt/csvmodelwriter.h \ | |
152 | src/crypter.h \ | |
153 | src/qt/sendcoinsentry.h \ | |
154 | src/qt/qvalidatedlineedit.h \ | |
155 | src/qt/bitcoinunits.h \ | |
156 | src/qt/qvaluecombobox.h \ | |
157 | src/qt/askpassphrasedialog.h \ | |
158 | src/protocol.h \ | |
159 | src/qt/notificator.h \ | |
160 | src/qt/qtipcserver.h \ | |
161 | src/allocators.h \ | |
162 | src/ui_interface.h \ | |
163 | src/qt/rpcconsole.h | |
164 | ||
165 | SOURCES += src/qt/bitcoin.cpp src/qt/bitcoingui.cpp \ | |
166 | src/qt/transactiontablemodel.cpp \ | |
167 | src/qt/addresstablemodel.cpp \ | |
168 | src/qt/optionsdialog.cpp \ | |
169 | src/qt/sendcoinsdialog.cpp \ | |
170 | src/qt/addressbookpage.cpp \ | |
171 | src/qt/messagepage.cpp \ | |
172 | src/qt/aboutdialog.cpp \ | |
173 | src/qt/editaddressdialog.cpp \ | |
174 | src/qt/bitcoinaddressvalidator.cpp \ | |
175 | src/version.cpp \ | |
176 | src/sync.cpp \ | |
177 | src/util.cpp \ | |
178 | src/netbase.cpp \ | |
179 | src/key.cpp \ | |
180 | src/script.cpp \ | |
181 | src/main.cpp \ | |
182 | src/init.cpp \ | |
183 | src/net.cpp \ | |
184 | src/irc.cpp \ | |
185 | src/checkpoints.cpp \ | |
186 | src/addrman.cpp \ | |
187 | src/db.cpp \ | |
188 | src/walletdb.cpp \ | |
189 | src/json/json_spirit_writer.cpp \ | |
190 | src/json/json_spirit_value.cpp \ | |
191 | src/json/json_spirit_reader.cpp \ | |
192 | src/qt/clientmodel.cpp \ | |
193 | src/qt/guiutil.cpp \ | |
194 | src/qt/transactionrecord.cpp \ | |
195 | src/qt/optionsmodel.cpp \ | |
196 | src/qt/monitoreddatamapper.cpp \ | |
197 | src/qt/transactiondesc.cpp \ | |
198 | src/qt/transactiondescdialog.cpp \ | |
199 | src/qt/bitcoinstrings.cpp \ | |
200 | src/qt/bitcoinamountfield.cpp \ | |
201 | src/wallet.cpp \ | |
202 | src/keystore.cpp \ | |
203 | src/qt/transactionfilterproxy.cpp \ | |
204 | src/qt/transactionview.cpp \ | |
205 | src/qt/walletmodel.cpp \ | |
206 | src/bitcoinrpc.cpp \ | |
207 | src/rpcdump.cpp \ | |
208 | src/qt/overviewpage.cpp \ | |
209 | src/qt/csvmodelwriter.cpp \ | |
210 | src/crypter.cpp \ | |
211 | src/qt/sendcoinsentry.cpp \ | |
212 | src/qt/qvalidatedlineedit.cpp \ | |
213 | src/qt/bitcoinunits.cpp \ | |
214 | src/qt/qvaluecombobox.cpp \ | |
215 | src/qt/askpassphrasedialog.cpp \ | |
216 | src/protocol.cpp \ | |
217 | src/qt/notificator.cpp \ | |
218 | src/qt/qtipcserver.cpp \ | |
219 | src/qt/rpcconsole.cpp | |
220 | ||
221 | RESOURCES += \ | |
222 | src/qt/bitcoin.qrc | |
223 | ||
224 | FORMS += \ | |
225 | src/qt/forms/sendcoinsdialog.ui \ | |
226 | src/qt/forms/addressbookpage.ui \ | |
227 | src/qt/forms/messagepage.ui \ | |
228 | src/qt/forms/aboutdialog.ui \ | |
229 | src/qt/forms/editaddressdialog.ui \ | |
230 | src/qt/forms/transactiondescdialog.ui \ | |
231 | src/qt/forms/overviewpage.ui \ | |
232 | src/qt/forms/sendcoinsentry.ui \ | |
233 | src/qt/forms/askpassphrasedialog.ui \ | |
234 | src/qt/forms/rpcconsole.ui | |
235 | ||
236 | contains(USE_QRCODE, 1) { | |
237 | HEADERS += src/qt/qrcodedialog.h | |
238 | SOURCES += src/qt/qrcodedialog.cpp | |
239 | FORMS += src/qt/forms/qrcodedialog.ui | |
240 | } | |
241 | ||
242 | contains(BITCOIN_QT_TEST, 1) { | |
243 | SOURCES += src/qt/test/test_main.cpp \ | |
244 | src/qt/test/uritests.cpp | |
245 | HEADERS += src/qt/test/uritests.h | |
246 | DEPENDPATH += src/qt/test | |
247 | QT += testlib | |
248 | TARGET = bitcoin-qt_test | |
249 | DEFINES += BITCOIN_QT_TEST | |
250 | } | |
251 | ||
252 | CODECFORTR = UTF-8 | |
253 | ||
254 | # for lrelease/lupdate | |
255 | # also add new translations to src/qt/bitcoin.qrc under translations/ | |
256 | TRANSLATIONS = $$files(src/qt/locale/bitcoin_*.ts) | |
257 | ||
258 | isEmpty(QMAKE_LRELEASE) { | |
259 | win32:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\\lrelease.exe | |
260 | else:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease | |
261 | } | |
262 | isEmpty(TS_DIR):TS_DIR = src/qt/locale | |
263 | # automatically build translations, so they can be included in resource file | |
264 | TSQM.name = lrelease ${QMAKE_FILE_IN} | |
265 | TSQM.input = TRANSLATIONS | |
266 | TSQM.output = $$TS_DIR/${QMAKE_FILE_BASE}.qm | |
267 | TSQM.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN} | |
268 | TSQM.CONFIG = no_link | |
269 | QMAKE_EXTRA_COMPILERS += TSQM | |
270 | PRE_TARGETDEPS += compiler_TSQM_make_all | |
271 | ||
272 | # "Other files" to show in Qt Creator | |
273 | OTHER_FILES += \ | |
274 | doc/*.rst doc/*.txt doc/README README.md res/bitcoin-qt.rc | |
275 | ||
276 | # platform specific defaults, if not overridden on command line | |
277 | isEmpty(BOOST_LIB_SUFFIX) { | |
278 | macx:BOOST_LIB_SUFFIX = -mt | |
279 | windows:BOOST_LIB_SUFFIX = -mgw44-mt-1_43 | |
280 | } | |
281 | ||
282 | isEmpty(BOOST_THREAD_LIB_SUFFIX) { | |
283 | BOOST_THREAD_LIB_SUFFIX = $$BOOST_LIB_SUFFIX | |
284 | } | |
285 | ||
286 | isEmpty(BDB_LIB_PATH) { | |
287 | macx:BDB_LIB_PATH = /opt/local/lib/db48 | |
288 | } | |
289 | ||
290 | isEmpty(BDB_LIB_SUFFIX) { | |
291 | macx:BDB_LIB_SUFFIX = -4.8 | |
292 | } | |
293 | ||
294 | isEmpty(BDB_INCLUDE_PATH) { | |
295 | macx:BDB_INCLUDE_PATH = /opt/local/include/db48 | |
296 | } | |
297 | ||
298 | isEmpty(BOOST_LIB_PATH) { | |
299 | macx:BOOST_LIB_PATH = /opt/local/lib | |
300 | } | |
301 | ||
302 | isEmpty(BOOST_INCLUDE_PATH) { | |
303 | macx:BOOST_INCLUDE_PATH = /opt/local/include | |
304 | } | |
305 | ||
306 | windows:LIBS += -lws2_32 -lshlwapi | |
307 | windows:DEFINES += WIN32 | |
308 | windows:RC_FILE = src/qt/res/bitcoin-qt.rc | |
309 | ||
310 | windows:!contains(MINGW_THREAD_BUGFIX, 0) { | |
311 | # At least qmake's win32-g++-cross profile is missing the -lmingwthrd | |
312 | # thread-safety flag. GCC has -mthreads to enable this, but it doesn't | |
313 | # work with static linking. -lmingwthrd must come BEFORE -lmingw, so | |
314 | # it is prepended to QMAKE_LIBS_QT_ENTRY. | |
315 | # It can be turned off with MINGW_THREAD_BUGFIX=0, just in case it causes | |
316 | # any problems on some untested qmake profile now or in the future. | |
317 | DEFINES += _MT | |
318 | QMAKE_LIBS_QT_ENTRY = -lmingwthrd $$QMAKE_LIBS_QT_ENTRY | |
319 | } | |
320 | ||
321 | !windows:!mac { | |
322 | DEFINES += LINUX | |
323 | LIBS += -lrt | |
324 | } | |
325 | ||
326 | macx:HEADERS += src/qt/macdockiconhandler.h | |
327 | macx:OBJECTIVE_SOURCES += src/qt/macdockiconhandler.mm | |
328 | macx:LIBS += -framework Foundation -framework ApplicationServices -framework AppKit | |
329 | macx:DEFINES += MAC_OSX MSG_NOSIGNAL=0 | |
330 | macx:ICON = src/qt/res/icons/bitcoin.icns | |
331 | macx:TARGET = "Bitcoin-Qt" | |
332 | ||
333 | # Set libraries and includes at end, to use platform-defined defaults if not overridden | |
334 | INCLUDEPATH += $$BOOST_INCLUDE_PATH $$BDB_INCLUDE_PATH $$OPENSSL_INCLUDE_PATH $$QRENCODE_INCLUDE_PATH | |
335 | LIBS += $$join(BOOST_LIB_PATH,,-L,) $$join(BDB_LIB_PATH,,-L,) $$join(OPENSSL_LIB_PATH,,-L,) $$join(QRENCODE_LIB_PATH,,-L,) | |
336 | LIBS += -lssl -lcrypto -ldb_cxx$$BDB_LIB_SUFFIX | |
337 | # -lgdi32 has to happen after -lcrypto (see #681) | |
338 | windows:LIBS += -lole32 -luuid -lgdi32 | |
339 | LIBS += -lboost_system$$BOOST_LIB_SUFFIX -lboost_filesystem$$BOOST_LIB_SUFFIX -lboost_program_options$$BOOST_LIB_SUFFIX -lboost_thread$$BOOST_THREAD_LIB_SUFFIX | |
340 | ||
341 | contains(RELEASE, 1) { | |
342 | !windows:!macx { | |
343 | # Linux: turn dynamic linking back on for c/c++ runtime libraries | |
344 | LIBS += -Wl,-Bdynamic | |
345 | } | |
346 | } | |
347 | ||
348 | system($$QMAKE_LRELEASE -silent $$_PRO_FILE_) |