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