8b34d6c211066649900a2c38466fabd146b716a6
[novacoin.git] / bitcoin-qt.pro
1 TEMPLATE = app
2 TARGET =
3 VERSION = 0.6.0
4 INCLUDEPATH += src src/json src/qt
5 DEFINES += QT_GUI BOOST_THREAD_USE_LIB
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 # disable quite some warnings because bitcoin core "sins" a lot
84 QMAKE_CXXFLAGS_WARN_ON = -fdiagnostics-show-option -Wall -Wno-strict-aliasing -Wno-invalid-offsetof -Wno-unused-variable -Wno-unused-parameter -Wno-sign-compare -Wno-char-subscripts -Wno-unused-value -Wno-sequence-point -Wno-parentheses -Wno-unknown-pragmas -Wno-switch
85
86 # Input
87 DEPENDPATH += src/qt src src json/include
88 HEADERS += src/qt/bitcoingui.h \
89     src/qt/transactiontablemodel.h \
90     src/qt/addresstablemodel.h \
91     src/qt/optionsdialog.h \
92     src/qt/sendcoinsdialog.h \
93     src/qt/addressbookpage.h \
94     src/qt/messagepage.h \
95     src/qt/aboutdialog.h \
96     src/qt/editaddressdialog.h \
97     src/qt/bitcoinaddressvalidator.h \
98     src/addrman.h \
99     src/base58.h \
100     src/bignum.h \
101     src/checkpoints.h \
102     src/compat.h \
103     src/util.h \
104     src/uint256.h \
105     src/serialize.h \
106     src/strlcpy.h \
107     src/main.h \
108     src/net.h \
109     src/key.h \
110     src/db.h \
111     src/script.h \
112     src/init.h \
113     src/headers.h \
114     src/irc.h \
115     src/mruset.h \
116     src/json/json_spirit_writer_template.h \
117     src/json/json_spirit_writer.h \
118     src/json/json_spirit_value.h \
119     src/json/json_spirit_utils.h \
120     src/json/json_spirit_stream_reader.h \
121     src/json/json_spirit_reader_template.h \
122     src/json/json_spirit_reader.h \
123     src/json/json_spirit_error_position.h \
124     src/json/json_spirit.h \
125     src/qt/clientmodel.h \
126     src/qt/guiutil.h \
127     src/qt/transactionrecord.h \
128     src/qt/guiconstants.h \
129     src/qt/optionsmodel.h \
130     src/qt/monitoreddatamapper.h \
131     src/qt/transactiondesc.h \
132     src/qt/transactiondescdialog.h \
133     src/qt/bitcoinamountfield.h \
134     src/wallet.h \
135     src/keystore.h \
136     src/qt/transactionfilterproxy.h \
137     src/qt/transactionview.h \
138     src/qt/walletmodel.h \
139     src/bitcoinrpc.h \
140     src/qt/overviewpage.h \
141     src/qt/csvmodelwriter.h \
142     src/crypter.h \
143     src/qt/sendcoinsentry.h \
144     src/qt/qvalidatedlineedit.h \
145     src/qt/bitcoinunits.h \
146     src/qt/qvaluecombobox.h \
147     src/qt/askpassphrasedialog.h \
148     src/protocol.h \
149     src/qt/notificator.h \
150     src/qt/qtipcserver.h \
151     src/allocators.h \
152     src/ui_interface.h
153
154 SOURCES += src/qt/bitcoin.cpp src/qt/bitcoingui.cpp \
155     src/qt/transactiontablemodel.cpp \
156     src/qt/addresstablemodel.cpp \
157     src/qt/optionsdialog.cpp \
158     src/qt/sendcoinsdialog.cpp \
159     src/qt/addressbookpage.cpp \
160     src/qt/messagepage.cpp \
161     src/qt/aboutdialog.cpp \
162     src/qt/editaddressdialog.cpp \
163     src/qt/bitcoinaddressvalidator.cpp \
164     src/util.cpp \
165     src/netbase.cpp \
166     src/key.cpp \
167     src/script.cpp \
168     src/main.cpp \
169     src/init.cpp \
170     src/net.cpp \
171     src/irc.cpp \
172     src/checkpoints.cpp \
173     src/addrman.cpp \
174     src/db.cpp \
175     src/json/json_spirit_writer.cpp \
176     src/json/json_spirit_value.cpp \
177     src/json/json_spirit_reader.cpp \
178     src/qt/clientmodel.cpp \
179     src/qt/guiutil.cpp \
180     src/qt/transactionrecord.cpp \
181     src/qt/optionsmodel.cpp \
182     src/qt/monitoreddatamapper.cpp \
183     src/qt/transactiondesc.cpp \
184     src/qt/transactiondescdialog.cpp \
185     src/qt/bitcoinstrings.cpp \
186     src/qt/bitcoinamountfield.cpp \
187     src/wallet.cpp \
188     src/keystore.cpp \
189     src/qt/transactionfilterproxy.cpp \
190     src/qt/transactionview.cpp \
191     src/qt/walletmodel.cpp \
192     src/bitcoinrpc.cpp \
193     src/rpcdump.cpp \
194     src/qt/overviewpage.cpp \
195     src/qt/csvmodelwriter.cpp \
196     src/crypter.cpp \
197     src/qt/sendcoinsentry.cpp \
198     src/qt/qvalidatedlineedit.cpp \
199     src/qt/bitcoinunits.cpp \
200     src/qt/qvaluecombobox.cpp \
201     src/qt/askpassphrasedialog.cpp \
202     src/protocol.cpp \
203     src/qt/notificator.cpp \
204     src/qt/qtipcserver.cpp
205
206 RESOURCES += \
207     src/qt/bitcoin.qrc
208
209 FORMS += \
210     src/qt/forms/sendcoinsdialog.ui \
211     src/qt/forms/addressbookpage.ui \
212     src/qt/forms/messagepage.ui \
213     src/qt/forms/aboutdialog.ui \
214     src/qt/forms/editaddressdialog.ui \
215     src/qt/forms/transactiondescdialog.ui \
216     src/qt/forms/overviewpage.ui \
217     src/qt/forms/sendcoinsentry.ui \
218     src/qt/forms/askpassphrasedialog.ui
219
220 contains(USE_QRCODE, 1) {
221 HEADERS += src/qt/qrcodedialog.h
222 SOURCES += src/qt/qrcodedialog.cpp
223 FORMS += src/qt/forms/qrcodedialog.ui
224 }
225
226 contains(BITCOIN_QT_TEST, 1) {
227 SOURCES += src/qt/test/test_main.cpp \
228     src/qt/test/uritests.cpp
229 HEADERS += src/qt/test/uritests.h
230 DEPENDPATH += src/qt/test
231 QT += testlib
232 TARGET = bitcoin-qt_test
233 DEFINES += BITCOIN_QT_TEST
234 }
235
236 CODECFORTR = UTF-8
237
238 # for lrelease/lupdate
239 # also add new translations to src/qt/bitcoin.qrc under translations/
240 TRANSLATIONS = $$files(src/qt/locale/bitcoin_*.ts)
241
242 isEmpty(QMAKE_LRELEASE) {
243     win32:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\\lrelease.exe
244     else:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease
245 }
246 isEmpty(TS_DIR):TS_DIR = src/qt/locale
247 # automatically build translations, so they can be included in resource file
248 TSQM.name = lrelease ${QMAKE_FILE_IN}
249 TSQM.input = TRANSLATIONS
250 TSQM.output = $$TS_DIR/${QMAKE_FILE_BASE}.qm
251 TSQM.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN}
252 TSQM.CONFIG = no_link
253 QMAKE_EXTRA_COMPILERS += TSQM
254 PRE_TARGETDEPS += compiler_TSQM_make_all
255
256 # "Other files" to show in Qt Creator
257 OTHER_FILES += \
258     doc/*.rst doc/*.txt doc/README README.md
259
260 # platform specific defaults, if not overridden on command line
261 isEmpty(BOOST_LIB_SUFFIX) {
262     macx:BOOST_LIB_SUFFIX = -mt
263     windows:BOOST_LIB_SUFFIX = -mgw44-mt-1_43
264 }
265
266 isEmpty(BOOST_THREAD_LIB_SUFFIX) {
267     BOOST_THREAD_LIB_SUFFIX = $$BOOST_LIB_SUFFIX
268 }
269
270 isEmpty(BDB_LIB_PATH) {
271     macx:BDB_LIB_PATH = /opt/local/lib/db48
272 }
273
274 isEmpty(BDB_LIB_SUFFIX) {
275     macx:BDB_LIB_SUFFIX = -4.8
276 }
277
278 isEmpty(BDB_INCLUDE_PATH) {
279     macx:BDB_INCLUDE_PATH = /opt/local/include/db48
280 }
281
282 isEmpty(BOOST_LIB_PATH) {
283     macx:BOOST_LIB_PATH = /opt/local/lib
284 }
285
286 isEmpty(BOOST_INCLUDE_PATH) {
287     macx:BOOST_INCLUDE_PATH = /opt/local/include
288 }
289
290 windows:LIBS += -lws2_32 -lshlwapi
291 windows:DEFINES += WIN32
292 windows:RC_FILE = src/qt/res/bitcoin-qt.rc
293
294 windows:!contains(MINGW_THREAD_BUGFIX, 0) {
295     # At least qmake's win32-g++-cross profile is missing the -lmingwthrd
296     # thread-safety flag. GCC has -mthreads to enable this, but it doesn't
297     # work with static linking. -lmingwthrd must come BEFORE -lmingw, so
298     # it is prepended to QMAKE_LIBS_QT_ENTRY.
299     # It can be turned off with MINGW_THREAD_BUGFIX=0, just in case it causes
300     # any problems on some untested qmake profile now or in the future.
301     DEFINES += _MT
302     QMAKE_LIBS_QT_ENTRY = -lmingwthrd $$QMAKE_LIBS_QT_ENTRY
303 }
304
305 !windows:!mac {
306     DEFINES += LINUX
307     LIBS += -lrt
308 }
309
310 macx:HEADERS += src/qt/macdockiconhandler.h
311 macx:OBJECTIVE_SOURCES += src/qt/macdockiconhandler.mm
312 macx:LIBS += -framework Foundation -framework ApplicationServices -framework AppKit
313 macx:DEFINES += MAC_OSX MSG_NOSIGNAL=0
314 macx:ICON = src/qt/res/icons/bitcoin.icns
315 macx:TARGET = "Bitcoin-Qt"
316
317 # Set libraries and includes at end, to use platform-defined defaults if not overridden
318 INCLUDEPATH += $$BOOST_INCLUDE_PATH $$BDB_INCLUDE_PATH $$OPENSSL_INCLUDE_PATH $$QRENCODE_INCLUDE_PATH
319 LIBS += $$join(BOOST_LIB_PATH,,-L,) $$join(BDB_LIB_PATH,,-L,) $$join(OPENSSL_LIB_PATH,,-L,) $$join(QRENCODE_LIB_PATH,,-L,)
320 LIBS += -lssl -lcrypto -ldb_cxx$$BDB_LIB_SUFFIX
321 # -lgdi32 has to happen after -lcrypto (see  #681)
322 windows:LIBS += -lole32 -luuid -lgdi32
323 LIBS += -lboost_system$$BOOST_LIB_SUFFIX -lboost_filesystem$$BOOST_LIB_SUFFIX -lboost_program_options$$BOOST_LIB_SUFFIX -lboost_thread$$BOOST_THREAD_LIB_SUFFIX
324
325 contains(RELEASE, 1) {
326     !windows:!macx {
327         # Linux: turn dynamic linking back on for c/c++ runtime libraries
328         LIBS += -Wl,-Bdynamic
329     }
330 }
331
332 system($$QMAKE_LRELEASE -silent $$_PRO_FILE_)