You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

bitcoin-qt.pro 13KB

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