]>
Commit | Line | Data |
---|---|---|
aaa1c3c4 | 1 | TEMPLATE = app |
6fe375c3 | 2 | TARGET = bitcoin-qt |
03fa53a6 | 3 | VERSION = 0.7.0 |
6ccff2cb | 4 | INCLUDEPATH += src src/json src/qt |
e422bebb | 5 | DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE |
8fe2308b | 6 | CONFIG += no_include_pwd |
5363cb05 | 7 | |
82ec7d55 | 8 | # for boost 1.37, add -mt to the boost libraries |
99cec89c | 9 | # use: qmake BOOST_LIB_SUFFIX=-mt |
0e569e4a MC |
10 | # for boost thread win32 with _win32 sufix |
11 | # use: BOOST_THREAD_LIB_SUFFIX=_win32-... | |
07e28823 | 12 | # or when linking against a specific BerkelyDB version: BDB_LIB_SUFFIX=-4.8 |
99cec89c | 13 | |
82ec7d55 PK |
14 | # Dependency library locations can be customized with: |
15 | # BOOST_INCLUDE_PATH, BOOST_LIB_PATH, BDB_INCLUDE_PATH, | |
16 | # BDB_LIB_PATH, OPENSSL_INCLUDE_PATH and OPENSSL_LIB_PATH respectively | |
1d7e321c | 17 | |
36eccc51 MC |
18 | OBJECTS_DIR = build |
19 | MOC_DIR = build | |
20 | UI_DIR = build | |
21 | ||
a5f07cbe GA |
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 | ||
8e2ebc01 PK |
33 | # for extra security on Windows: enable ASLR and DEP via GCC linker flags |
34 | win32:QMAKE_LFLAGS *= -Wl,--dynamicbase -Wl,--nxcompat | |
35 | ||
b03cb157 MC |
36 | # use: qmake "USE_QRCODE=1" |
37 | # libqrencode (http://fukuchi.org/works/qrencode/index.en.html) must be installed for support | |
38 | contains(USE_QRCODE, 1) { | |
39 | message(Building with QRCode support) | |
40 | DEFINES += USE_QRCODE | |
41 | LIBS += -lqrencode | |
42 | } | |
43 | ||
5d3083c3 LD |
44 | # use: qmake "USE_UPNP=1" ( enabled by default; default) |
45 | # or: qmake "USE_UPNP=0" (disabled by default) | |
46 | # or: qmake "USE_UPNP=-" (not supported) | |
47 | # miniupnpc (http://miniupnp.free.fr/files/) must be installed for support | |
48 | contains(USE_UPNP, -) { | |
49 | message(Building without UPNP support) | |
50 | } else { | |
0aca8577 | 51 | message(Building with UPNP support) |
5d3083c3 LD |
52 | count(USE_UPNP, 0) { |
53 | USE_UPNP=1 | |
54 | } | |
aaf71d84 MC |
55 | DEFINES += USE_UPNP=$$USE_UPNP STATICLIB |
56 | INCLUDEPATH += $$MINIUPNPC_INCLUDE_PATH | |
57 | LIBS += $$join(MINIUPNPC_LIB_PATH,,-L,) -lminiupnpc | |
58 | win32:LIBS += -liphlpapi | |
0aca8577 WL |
59 | } |
60 | ||
9b490f71 | 61 | # use: qmake "USE_DBUS=1" |
07e28823 | 62 | contains(USE_DBUS, 1) { |
cf9195c8 | 63 | message(Building with DBUS (Freedesktop notifications) support) |
010c4fc0 | 64 | DEFINES += USE_DBUS |
cf9195c8 WL |
65 | QT += dbus |
66 | } | |
67 | ||
2bc4fd60 LD |
68 | # use: qmake "FIRST_CLASS_MESSAGING=1" |
69 | contains(FIRST_CLASS_MESSAGING, 1) { | |
70 | message(Building with first-class messaging) | |
71 | DEFINES += FIRST_CLASS_MESSAGING | |
72 | } | |
73 | ||
9655d73f LD |
74 | # use: qmake "USE_IPV6=1" ( enabled by default; default) |
75 | # or: qmake "USE_IPV6=0" (disabled by default) | |
e422bebb LD |
76 | # or: qmake "USE_IPV6=-" (not supported) |
77 | contains(USE_IPV6, -) { | |
0eeb54cb | 78 | message(Building without IPv6 support) |
e422bebb | 79 | } else { |
0eeb54cb LD |
80 | count(USE_IPV6, 0) { |
81 | USE_IPV6=1 | |
82 | } | |
83 | DEFINES += USE_IPV6=$$USE_IPV6 | |
e422bebb LD |
84 | } |
85 | ||
5f2e76b8 MC |
86 | contains(BITCOIN_NEED_QT_PLUGINS, 1) { |
87 | DEFINES += BITCOIN_NEED_QT_PLUGINS | |
2e5a781c | 88 | QTPLUGIN += qcncodecs qjpcodecs qtwcodecs qkrcodecs qtaccessiblewidgets |
5f2e76b8 MC |
89 | } |
90 | ||
533c82ce WL |
91 | !windows { |
92 | # for extra security against potential buffer overflows | |
93 | QMAKE_CXXFLAGS += -fstack-protector | |
94 | QMAKE_LFLAGS += -fstack-protector | |
3f37f20d | 95 | # do not enable this on windows cross compile with mingw 4.2.x, as it will result in a non-working executable! |
533c82ce | 96 | } |
ea8440d7 | 97 | |
a20c0d0f | 98 | # regenerate src/build.h |
30d509c1 | 99 | !windows|contains(USE_BUILD_INFO, 1) { |
5d464a4a | 100 | genbuild.depends = FORCE |
8c35bfba | 101 | genbuild.commands = cd $$PWD; /bin/sh share/genbuild.sh $$OUT_PWD/build/build.h |
ffd8060a WL |
102 | genbuild.target = $$OUT_PWD/build/build.h |
103 | PRE_TARGETDEPS += $$OUT_PWD/build/build.h | |
a20c0d0f PW |
104 | QMAKE_EXTRA_TARGETS += genbuild |
105 | DEFINES += HAVE_BUILD_INFO | |
106 | } | |
107 | ||
f621326c | 108 | QMAKE_CXXFLAGS_WARN_ON = -fdiagnostics-show-option -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter |
1d7e321c | 109 | |
aaa1c3c4 | 110 | # Input |
68103043 | 111 | DEPENDPATH += src src/json src/qt |
ba4081c1 WL |
112 | HEADERS += src/qt/bitcoingui.h \ |
113 | src/qt/transactiontablemodel.h \ | |
114 | src/qt/addresstablemodel.h \ | |
115 | src/qt/optionsdialog.h \ | |
116 | src/qt/sendcoinsdialog.h \ | |
3479849d | 117 | src/qt/addressbookpage.h \ |
47894585 | 118 | src/qt/signverifymessagedialog.h \ |
ba4081c1 WL |
119 | src/qt/aboutdialog.h \ |
120 | src/qt/editaddressdialog.h \ | |
121 | src/qt/bitcoinaddressvalidator.h \ | |
f35c6c4f | 122 | src/alert.h \ |
5fee401f | 123 | src/addrman.h \ |
ba4081c1 WL |
124 | src/base58.h \ |
125 | src/bignum.h \ | |
eb5fff9e | 126 | src/checkpoints.h \ |
67a42f92 | 127 | src/compat.h \ |
7f3ccb59 | 128 | src/sync.h \ |
ba4081c1 WL |
129 | src/util.h \ |
130 | src/uint256.h \ | |
131 | src/serialize.h \ | |
ba4081c1 WL |
132 | src/strlcpy.h \ |
133 | src/main.h \ | |
134 | src/net.h \ | |
135 | src/key.h \ | |
136 | src/db.h \ | |
9eace6b1 | 137 | src/walletdb.h \ |
ba4081c1 | 138 | src/script.h \ |
ba4081c1 | 139 | src/init.h \ |
ba4081c1 | 140 | src/irc.h \ |
c4341fa6 | 141 | src/mruset.h \ |
ba4081c1 WL |
142 | src/json/json_spirit_writer_template.h \ |
143 | src/json/json_spirit_writer.h \ | |
144 | src/json/json_spirit_value.h \ | |
145 | src/json/json_spirit_utils.h \ | |
146 | src/json/json_spirit_stream_reader.h \ | |
147 | src/json/json_spirit_reader_template.h \ | |
148 | src/json/json_spirit_reader.h \ | |
149 | src/json/json_spirit_error_position.h \ | |
150 | src/json/json_spirit.h \ | |
ba4081c1 WL |
151 | src/qt/clientmodel.h \ |
152 | src/qt/guiutil.h \ | |
153 | src/qt/transactionrecord.h \ | |
154 | src/qt/guiconstants.h \ | |
155 | src/qt/optionsmodel.h \ | |
156 | src/qt/monitoreddatamapper.h \ | |
ba4081c1 | 157 | src/qt/transactiondesc.h \ |
f193c57a | 158 | src/qt/transactiondescdialog.h \ |
e8ef3da7 WL |
159 | src/qt/bitcoinamountfield.h \ |
160 | src/wallet.h \ | |
ceb6d4e1 WL |
161 | src/keystore.h \ |
162 | src/qt/transactionfilterproxy.h \ | |
ef079e18 | 163 | src/qt/transactionview.h \ |
8fe2308b | 164 | src/qt/walletmodel.h \ |
64c8b699 | 165 | src/bitcoinrpc.h \ |
fbaee7a8 | 166 | src/qt/overviewpage.h \ |
0b814f9e | 167 | src/qt/csvmodelwriter.h \ |
a5e6d723 WL |
168 | src/crypter.h \ |
169 | src/qt/sendcoinsentry.h \ | |
e285ffcd | 170 | src/qt/qvalidatedlineedit.h \ |
ee014e5b | 171 | src/qt/bitcoinunits.h \ |
b7bcaf94 | 172 | src/qt/qvaluecombobox.h \ |
c5aa1b13 | 173 | src/qt/askpassphrasedialog.h \ |
cf9195c8 | 174 | src/protocol.h \ |
7d145a0f | 175 | src/qt/notificator.h \ |
6cb6d623 | 176 | src/qt/qtipcserver.h \ |
5cccb13d | 177 | src/allocators.h \ |
460c51fd | 178 | src/ui_interface.h \ |
4942b212 | 179 | src/qt/rpcconsole.h \ |
c3856bb0 | 180 | src/version.h \ |
f8759211 PK |
181 | src/netbase.h \ |
182 | src/clientversion.h | |
c5aa1b13 | 183 | |
ba4081c1 WL |
184 | SOURCES += src/qt/bitcoin.cpp src/qt/bitcoingui.cpp \ |
185 | src/qt/transactiontablemodel.cpp \ | |
186 | src/qt/addresstablemodel.cpp \ | |
187 | src/qt/optionsdialog.cpp \ | |
188 | src/qt/sendcoinsdialog.cpp \ | |
3479849d | 189 | src/qt/addressbookpage.cpp \ |
47894585 | 190 | src/qt/signverifymessagedialog.cpp \ |
ba4081c1 WL |
191 | src/qt/aboutdialog.cpp \ |
192 | src/qt/editaddressdialog.cpp \ | |
193 | src/qt/bitcoinaddressvalidator.cpp \ | |
f35c6c4f | 194 | src/alert.cpp \ |
a20c0d0f | 195 | src/version.cpp \ |
7f3ccb59 | 196 | src/sync.cpp \ |
ba4081c1 | 197 | src/util.cpp \ |
67a42f92 | 198 | src/netbase.cpp \ |
93db3fce | 199 | src/key.cpp \ |
ba4081c1 WL |
200 | src/script.cpp \ |
201 | src/main.cpp \ | |
202 | src/init.cpp \ | |
ba4081c1 WL |
203 | src/net.cpp \ |
204 | src/irc.cpp \ | |
eb5fff9e | 205 | src/checkpoints.cpp \ |
5fee401f | 206 | src/addrman.cpp \ |
ba4081c1 | 207 | src/db.cpp \ |
9eace6b1 | 208 | src/walletdb.cpp \ |
ba4081c1 WL |
209 | src/qt/clientmodel.cpp \ |
210 | src/qt/guiutil.cpp \ | |
211 | src/qt/transactionrecord.cpp \ | |
212 | src/qt/optionsmodel.cpp \ | |
213 | src/qt/monitoreddatamapper.cpp \ | |
214 | src/qt/transactiondesc.cpp \ | |
6315130e | 215 | src/qt/transactiondescdialog.cpp \ |
f193c57a | 216 | src/qt/bitcoinstrings.cpp \ |
e8ef3da7 WL |
217 | src/qt/bitcoinamountfield.cpp \ |
218 | src/wallet.cpp \ | |
ceb6d4e1 WL |
219 | src/keystore.cpp \ |
220 | src/qt/transactionfilterproxy.cpp \ | |
ef079e18 | 221 | src/qt/transactionview.cpp \ |
8fe2308b | 222 | src/qt/walletmodel.cpp \ |
64c8b699 | 223 | src/bitcoinrpc.cpp \ |
95d888a6 | 224 | src/rpcdump.cpp \ |
70ab73a0 | 225 | src/rpcnet.cpp \ |
7600e7fc | 226 | src/rpcmining.cpp \ |
e3bc5698 | 227 | src/rpcwallet.cpp \ |
c625ae04 | 228 | src/rpcblockchain.cpp \ |
a2709fad | 229 | src/rpcrawtransaction.cpp \ |
fbaee7a8 | 230 | src/qt/overviewpage.cpp \ |
0b814f9e | 231 | src/qt/csvmodelwriter.cpp \ |
a5e6d723 WL |
232 | src/crypter.cpp \ |
233 | src/qt/sendcoinsentry.cpp \ | |
e285ffcd | 234 | src/qt/qvalidatedlineedit.cpp \ |
ee014e5b | 235 | src/qt/bitcoinunits.cpp \ |
b7bcaf94 | 236 | src/qt/qvaluecombobox.cpp \ |
c5aa1b13 | 237 | src/qt/askpassphrasedialog.cpp \ |
cf9195c8 | 238 | src/protocol.cpp \ |
7d145a0f | 239 | src/qt/notificator.cpp \ |
460c51fd | 240 | src/qt/qtipcserver.cpp \ |
0c587936 | 241 | src/qt/rpcconsole.cpp \ |
82ec7d55 | 242 | src/noui.cpp |
13740b7e WL |
243 | |
244 | RESOURCES += \ | |
ba4081c1 | 245 | src/qt/bitcoin.qrc |
df577886 WL |
246 | |
247 | FORMS += \ | |
ba4081c1 | 248 | src/qt/forms/sendcoinsdialog.ui \ |
3479849d | 249 | src/qt/forms/addressbookpage.ui \ |
47894585 | 250 | src/qt/forms/signverifymessagedialog.ui \ |
ba4081c1 WL |
251 | src/qt/forms/aboutdialog.ui \ |
252 | src/qt/forms/editaddressdialog.ui \ | |
64c8b699 | 253 | src/qt/forms/transactiondescdialog.ui \ |
a5e6d723 | 254 | src/qt/forms/overviewpage.ui \ |
b7bcaf94 | 255 | src/qt/forms/sendcoinsentry.ui \ |
460c51fd | 256 | src/qt/forms/askpassphrasedialog.ui \ |
0c587936 | 257 | src/qt/forms/rpcconsole.ui \ |
c4443c2b | 258 | src/qt/forms/optionsdialog.ui |
ab2fe68f | 259 | |
22123c85 | 260 | contains(USE_QRCODE, 1) { |
261 | HEADERS += src/qt/qrcodedialog.h | |
262 | SOURCES += src/qt/qrcodedialog.cpp | |
263 | FORMS += src/qt/forms/qrcodedialog.ui | |
264 | } | |
265 | ||
24548467 MC |
266 | contains(BITCOIN_QT_TEST, 1) { |
267 | SOURCES += src/qt/test/test_main.cpp \ | |
fa2544e7 LD |
268 | src/qt/test/uritests.cpp |
269 | HEADERS += src/qt/test/uritests.h | |
24548467 MC |
270 | DEPENDPATH += src/qt/test |
271 | QT += testlib | |
272 | TARGET = bitcoin-qt_test | |
273 | DEFINES += BITCOIN_QT_TEST | |
274 | } | |
275 | ||
ab2fe68f | 276 | CODECFORTR = UTF-8 |
59020408 | 277 | |
317c7335 | 278 | # for lrelease/lupdate |
5c92622a WL |
279 | # also add new translations to src/qt/bitcoin.qrc under translations/ |
280 | TRANSLATIONS = $$files(src/qt/locale/bitcoin_*.ts) | |
2c1fd3c3 | 281 | |
59020408 | 282 | isEmpty(QMAKE_LRELEASE) { |
100da736 | 283 | win32:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\\lrelease.exe |
59020408 WL |
284 | else:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease |
285 | } | |
ffd8060a | 286 | isEmpty(QM_DIR):QM_DIR = $$PWD/src/qt/locale |
59020408 WL |
287 | # automatically build translations, so they can be included in resource file |
288 | TSQM.name = lrelease ${QMAKE_FILE_IN} | |
289 | TSQM.input = TRANSLATIONS | |
ffd8060a WL |
290 | TSQM.output = $$QM_DIR/${QMAKE_FILE_BASE}.qm |
291 | TSQM.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_OUT} | |
59020408 WL |
292 | TSQM.CONFIG = no_link |
293 | QMAKE_EXTRA_COMPILERS += TSQM | |
59020408 | 294 | |
f33a43ef | 295 | # "Other files" to show in Qt Creator |
2c1fd3c3 | 296 | OTHER_FILES += \ |
4942b212 | 297 | doc/*.rst doc/*.txt doc/README README.md res/bitcoin-qt.rc src/test/*.cpp src/test/*.h src/qt/test/*.cpp src/qt/test/*.h |
2c1fd3c3 | 298 | |
99cec89c WL |
299 | # platform specific defaults, if not overridden on command line |
300 | isEmpty(BOOST_LIB_SUFFIX) { | |
301 | macx:BOOST_LIB_SUFFIX = -mt | |
a1755ec4 | 302 | windows:BOOST_LIB_SUFFIX = -mgw44-mt-s-1_50 |
99cec89c WL |
303 | } |
304 | ||
0e569e4a MC |
305 | isEmpty(BOOST_THREAD_LIB_SUFFIX) { |
306 | BOOST_THREAD_LIB_SUFFIX = $$BOOST_LIB_SUFFIX | |
307 | } | |
308 | ||
99cec89c WL |
309 | isEmpty(BDB_LIB_PATH) { |
310 | macx:BDB_LIB_PATH = /opt/local/lib/db48 | |
311 | } | |
312 | ||
b50ac8f7 GA |
313 | isEmpty(BDB_LIB_SUFFIX) { |
314 | macx:BDB_LIB_SUFFIX = -4.8 | |
315 | } | |
316 | ||
99cec89c WL |
317 | isEmpty(BDB_INCLUDE_PATH) { |
318 | macx:BDB_INCLUDE_PATH = /opt/local/include/db48 | |
319 | } | |
320 | ||
321 | isEmpty(BOOST_LIB_PATH) { | |
322 | macx:BOOST_LIB_PATH = /opt/local/lib | |
323 | } | |
324 | ||
325 | isEmpty(BOOST_INCLUDE_PATH) { | |
326 | macx:BOOST_INCLUDE_PATH = /opt/local/include | |
327 | } | |
328 | ||
5b146221 | 329 | windows:LIBS += -lws2_32 -lshlwapi -lmswsock |
49e1501b | 330 | windows:DEFINES += WIN32 |
9b490f71 WL |
331 | windows:RC_FILE = src/qt/res/bitcoin-qt.rc |
332 | ||
49e1501b LD |
333 | windows:!contains(MINGW_THREAD_BUGFIX, 0) { |
334 | # At least qmake's win32-g++-cross profile is missing the -lmingwthrd | |
335 | # thread-safety flag. GCC has -mthreads to enable this, but it doesn't | |
336 | # work with static linking. -lmingwthrd must come BEFORE -lmingw, so | |
337 | # it is prepended to QMAKE_LIBS_QT_ENTRY. | |
338 | # It can be turned off with MINGW_THREAD_BUGFIX=0, just in case it causes | |
339 | # any problems on some untested qmake profile now or in the future. | |
340 | DEFINES += _MT | |
341 | QMAKE_LIBS_QT_ENTRY = -lmingwthrd $$QMAKE_LIBS_QT_ENTRY | |
342 | } | |
343 | ||
f18a119a MC |
344 | !windows:!mac { |
345 | DEFINES += LINUX | |
30dfc64f | 346 | LIBS += -lrt |
f18a119a MC |
347 | } |
348 | ||
527137e3 | 349 | macx:HEADERS += src/qt/macdockiconhandler.h |
350 | macx:OBJECTIVE_SOURCES += src/qt/macdockiconhandler.mm | |
351 | macx:LIBS += -framework Foundation -framework ApplicationServices -framework AppKit | |
c4de9184 | 352 | macx:DEFINES += MAC_OSX MSG_NOSIGNAL=0 |
2c1fd3c3 | 353 | macx:ICON = src/qt/res/icons/bitcoin.icns |
b50ac8f7 | 354 | macx:TARGET = "Bitcoin-Qt" |
99cec89c WL |
355 | |
356 | # Set libraries and includes at end, to use platform-defined defaults if not overridden | |
0b5d6f1e MC |
357 | INCLUDEPATH += $$BOOST_INCLUDE_PATH $$BDB_INCLUDE_PATH $$OPENSSL_INCLUDE_PATH $$QRENCODE_INCLUDE_PATH |
358 | LIBS += $$join(BOOST_LIB_PATH,,-L,) $$join(BDB_LIB_PATH,,-L,) $$join(OPENSSL_LIB_PATH,,-L,) $$join(QRENCODE_LIB_PATH,,-L,) | |
07e28823 | 359 | LIBS += -lssl -lcrypto -ldb_cxx$$BDB_LIB_SUFFIX |
3f9144d4 | 360 | # -lgdi32 has to happen after -lcrypto (see #681) |
f9417736 | 361 | windows:LIBS += -lole32 -luuid -lgdi32 |
0e569e4a | 362 | LIBS += -lboost_system$$BOOST_LIB_SUFFIX -lboost_filesystem$$BOOST_LIB_SUFFIX -lboost_program_options$$BOOST_LIB_SUFFIX -lboost_thread$$BOOST_THREAD_LIB_SUFFIX |
ba7ba84f | 363 | windows:LIBS += -lboost_chrono$$BOOST_LIB_SUFFIX |
07e28823 | 364 | |
a5f07cbe GA |
365 | contains(RELEASE, 1) { |
366 | !windows:!macx { | |
367 | # Linux: turn dynamic linking back on for c/c++ runtime libraries | |
368 | LIBS += -Wl,-Bdynamic | |
369 | } | |
370 | } | |
371 | ||
07e28823 | 372 | system($$QMAKE_LRELEASE -silent $$_PRO_FILE_) |