From 99cec89cb369beb8dce6c92db837bb5951f627d5 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Sat, 24 Sep 2011 11:43:58 +0200 Subject: [PATCH] make qmake build system more configurable (as suggested by lukejr) --- bitcoin-qt.pro | 48 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/bitcoin-qt.pro b/bitcoin-qt.pro index dcd3d3d40ba..c7eb563bb41 100644 --- a/bitcoin-qt.pro +++ b/bitcoin-qt.pro @@ -5,7 +5,12 @@ DEFINES += QT_GUI # DEFINES += SSL CONFIG += no_include_pwd -LIBS += -lssl -lcrypto -ldb_cxx +# for boost 1.37, add -mt to the boost libraries +# use: qmake BOOST_LIB_SUFFIX=-mt + +# Dependency library locations can be customized with BOOST_INCLUDE_PATH, +# BOOST_LIB_PATH, BDB_INCLUDE_PATH, BDB_LIB_PATH +# OPENSSL_INCLUDE_PATH and OPENSSL_LIB_PATH respectively # use: qmake "USE_UPNP=1" # miniupnpc (http://miniupnp.free.fr/files/) must be installed @@ -170,19 +175,38 @@ TRANSLATIONS = src/qt/locale/bitcoin_nl.ts src/qt/locale/bitcoin_de.ts \ OTHER_FILES += \ README.rst -# Platform-specific libraries/includes -# for boost 1.37, add -mt to the boost libraries -unix:!macx:LIBS += -lboost_system -lboost_filesystem -lboost_program_options -lboost_thread -macx:LIBS += -lboost_system-mt -lboost_filesystem-mt -lboost_program_options-mt -lboost_thread-mt -macx:DEFINES += __WXMAC_OSX__ MSG_NOSIGNAL=0 BOOST_FILESYSTEM_VERSION=3 -windows:LIBS += -lboost_system-mgw44-mt-1_43 -lboost_filesystem-mgw44-mt-1_43 -lboost_program_options-mgw44-mt-1_43 -lboost_thread-mgw44-mt-1_43 -lws2_32 -lgdi32 +# platform specific defaults, if not overridden on command line +isEmpty(BOOST_LIB_SUFFIX) { + macx:BOOST_LIB_SUFFIX = -mt + windows:BOOST_LIB_SUFFIX = -mgw44-mt-1_43 +} + +isEmpty(BDB_LIB_PATH) { + macx:BDB_LIB_PATH = /opt/local/lib/db48 +} + +isEmpty(BDB_INCLUDE_PATH) { + macx:BDB_INCLUDE_PATH = /opt/local/include/db48 +} + +isEmpty(BOOST_LIB_PATH) { + macx:BOOST_LIB_PATH = /opt/local/lib +} + +isEmpty(BOOST_INCLUDE_PATH) { + macx:BOOST_INCLUDE_PATH = /opt/local/include +} + +windows:LIBS += -lws2_32 -lgdi32 windows:DEFINES += __WXMSW__ windows:RC_FILE = src/qt/res/bitcoin-qt.rc -# For use with MacPorts -macx:INCLUDEPATH += /opt/local/include /opt/local/include/db48 -macx:LIBS += -L/opt/local/lib -L/opt/local/lib/db48 - -# Additional Mac options +macx:DEFINES += __WXMAC_OSX__ MSG_NOSIGNAL=0 BOOST_FILESYSTEM_VERSION=3 macx:ICON = src/qt/res/icons/bitcoin.icns macx:TARGET = "Bitcoin Qt" + +# Set libraries and includes at end, to use platform-defined defaults if not overridden +INCLUDEPATH += $$BOOST_INCLUDE_PATH $$BDB_INCLUDE_PATH $$OPENSSL_INCLUDE_PATH +LIBS += $$join(BOOST_LIB_PATH,,-L,) $$join(BDB_LIB_PATH,,-L,) $$join(OPENSSL_LIB_PATH,,-L,) +LIBS += -lssl -lcrypto -ldb_cxx +LIBS += -lboost_system$$BOOST_LIB_SUFFIX -lboost_filesystem$$BOOST_LIB_SUFFIX -lboost_program_options$$BOOST_LIB_SUFFIX -lboost_thread$$BOOST_LIB_SUFFIX