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 14KB

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