Merge pull request #66 from AsamK/qmake_improvements_next

More qmake improvements
This commit is contained in:
Cyril Soler 2015-09-01 20:49:57 -04:00
commit d2dc8deeaf
13 changed files with 112 additions and 139 deletions

View File

@ -27,12 +27,12 @@ addons:
project:
name: "RetroShare/RetroShare"
description: "RetroShare Build submitted via Travis CI"
build_command_prepend: "qmake; make clean"
build_command_prepend: "qmake CONFIG+=NO_SQLCIPHER; make clean"
build_command: "make -j 4"
branch_pattern: coverity_scan
before_script:
- qmake
- qmake CONFIG+=NO_SQLCIPHER
#script: make
script: if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then make ; fi

View File

@ -37,7 +37,7 @@ Compilation on Linux
3. Compile
```bash
cd trunk
qmake CONFIG=debug
qmake CONFIG+=debug
make
```
@ -51,11 +51,22 @@ Compilation on Linux
/usr/bin/RetroShare06
/usr/bin/RetroShare06-nogui
Compile only retroshare-nogui
-----------------------------
If you want to run RetroShare on a server and dont need the gui and plugins,
you can run the following commands to only compile/install the nogui version:
```bash
qmake
make retroshare-nogui
sudo make retroshare-nogui-install_subtargets
```
For packagers
-------------
Packagers can use PREFIX and LIB\_DIR to customize the installation paths:
```bash
qmake PREFIX=/usr LIB_DIR=/usr/lib64
qmake PREFIX=/usr LIB_DIR=/usr/lib64 "CONFIG-=debug" "CONFIG+=release"
make
make INSTALL_ROOT=${PKGDIR} install
```

View File

@ -1,3 +1,5 @@
!include("retroshare.pri"): error("Could not include file retroshare.pri")
TEMPLATE = subdirs
SUBDIRS += \
@ -24,43 +26,12 @@ pegmarkdown.file = supportlibs/pegmarkdown/pegmarkdown.pro
retroshare_gui.file = retroshare-gui/src/retroshare-gui.pro
retroshare_gui.depends = libretroshare libresapi pegmarkdown
retroshare_gui.target = retroshare-gui
retroshare_nogui.file = retroshare-nogui/src/retroshare-nogui.pro
retroshare_nogui.depends = libretroshare libresapi
retroshare_nogui.target = retroshare-nogui
plugins.file = plugins/plugins.pro
plugins.depends = retroshare_gui
unix {
isEmpty(PREFIX) { PREFIX = /usr }
isEmpty(INC_DIR) { INC_DIR = "$${PREFIX}/include/retroshare06" }
isEmpty(LIB_DIR) { LIB_DIR = "$${PREFIX}/lib" }
isEmpty(DATA_DIR) { DATA_DIR = "$${PREFIX}/share/RetroShare06" }
icon_files.path = "$${PREFIX}/share/icons/hicolor"
icon_files.files = data/24x24
icon_files.files += data/48x48
icon_files.files += data/64x64
icon_files.files += data/128x128
INSTALLS += icon_files
desktop_files.path = "$${PREFIX}/share/applications"
desktop_files.files = data/retroshare06.desktop
INSTALLS += desktop_files
pixmap_files.path = "$${PREFIX}/share/pixmaps"
pixmap_files.files = data/retroshare06.xpm
INSTALLS += pixmap_files
data_files.path = "$${DATA_DIR}"
data_files.files = libbitdht/src/bitdht/bdboot.txt
INSTALLS += data_files
webui_files.path = "$${DATA_DIR}/webui"
webui_files.files = libresapi/src/webfiles/*
INSTALLS += webui_files
webui_img_files.path = "$${DATA_DIR}/webui/img"
webui_img_files.files = retroshare-gui/src/gui/images/logo/logo_splash.png
INSTALLS += webui_img_files
}
plugins.target = plugins

View File

@ -3,7 +3,7 @@
configure: configure-stamp
configure-stamp:
dh_testdir
cd src && qmake-qt4 CONFIG=release PREFIX=/usr LIB_DIR=/usr/lib RetroShare.pro
cd src && qmake-qt4 "CONFIG-=debug" "CONFIG+=release" PREFIX=/usr LIB_DIR=/usr/lib RetroShare.pro
touch $@

View File

@ -56,7 +56,7 @@ cd lib/sqlcipher
make
cd -
cd src
qmake-qt4 CONFIG=release PREFIX=%{_prefix} LIB_DIR=%{_libdir} RetroShare.pro
qmake-qt4 "CONFIG-=debug" "CONFIG+=release" PREFIX=%{_prefix} LIB_DIR=%{_libdir} RetroShare.pro
make
cd -

View File

@ -1,3 +1,5 @@
!include("../../retroshare.pri"): error("Could not include file ../../retroshare.pri")
TEMPLATE = lib
CONFIG += staticlib
CONFIG -= qt
@ -37,6 +39,13 @@ linux-g++-64 {
OBJECTS_DIR = temp/linux-g++-64/obj
}
unix {
data_files.path = "$${DATA_DIR}"
data_files.files = bitdht/bdboot.txt
INSTALLS += data_files
}
#################### Cross compilation for windows under Linux ####################
win32-x-g++ {

View File

@ -1,3 +1,5 @@
!include("../../retroshare.pri"): error("Could not include file ../../retroshare.pri")
TEMPLATE = lib
CONFIG += staticlib
CONFIG -= qt
@ -8,6 +10,16 @@ CONFIG += libmicrohttpd
INCLUDEPATH += ../../libretroshare/src
unix {
webui_files.path = "$${DATA_DIR}/webui"
webui_files.files = webfiles/*
INSTALLS += webui_files
webui_img_files.path = "$${DATA_DIR}/webui/img"
webui_img_files.files = ../../retroshare-gui/src/gui/images/logo/logo_splash.png
INSTALLS += webui_img_files
}
win32{
DEFINES *= WINDOWS_SYS
INCLUDEPATH += $$PWD/../../../libs/include

View File

@ -1,5 +1,8 @@
!include("../../retroshare.pri"): error("Could not include file ../../retroshare.pri")
TEMPLATE = lib
CONFIG += staticlib bitdht
CONFIG += create_prl
CONFIG -= qt
TARGET = retroshare
@ -80,6 +83,8 @@ SOURCES += tcponudp/udppeer.cc \
# The next line is for compliance with debian packages. Keep it!
INCLUDEPATH += ../libbitdht
DEFINES *= RS_USE_BITDHT
PRE_TARGETDEPS *= ../../libbitdht/src/lib/libbitdht.a
LIBS += ../../libbitdht/src/lib/libbitdht.a
}
@ -135,15 +140,22 @@ linux-* {
DEPENDPATH += . $${SSL_DIR} $${UPNP_DIR}
INCLUDEPATH += . $${SSL_DIR} $${UPNP_DIR}
SQLCIPHER_OK = $$system(pkg-config --exists sqlcipher && echo yes)
isEmpty(SQLCIPHER_OK) {
# We need a explicit path here, to force using the home version of sqlite3 that really encrypts the database.
!exists(../../../lib/sqlcipher/.libs/libsqlcipher.a) {
message(libsqlcipher.a not found. Compilation will not use SQLCIPER. Database will be unencrypted.)
DEFINES *= NO_SQLCIPHER
contains(CONFIG, NO_SQLCIPHER) {
DEFINES *= NO_SQLCIPHER
LIBS *= -lsqlite3
} else {
SQLCIPHER_OK = $$system(pkg-config --exists sqlcipher && echo yes)
isEmpty(SQLCIPHER_OK) {
# We need a explicit path here, to force using the home version of sqlite3 that really encrypts the database.
exists(../../../lib/sqlcipher/.libs/libsqlcipher.a) {
LIBS += ../../../lib/sqlcipher/.libs/libsqlcipher.a
DEPENDPATH += ../../../lib/
INCLUDEPATH += ../../../lib/
} else {
error("libsqlcipher is not installed and libsqlcipher.a not found. SQLCIPHER is necessary for encrypted database, to build with unencrypted database, run: qmake CONFIG+=NO_SQLCIPHER")
}
} else {
DEPENDPATH += ../../../lib/
INCLUDEPATH += ../../../lib/
LIBS *= -lsqlcipher
}
}
@ -165,14 +177,11 @@ linux-* {
DEFINES *= UBUNTU
INCLUDEPATH += /usr/include/glib-2.0/ /usr/lib/glib-2.0/include
LIBS *= -lgnome-keyring
LIBS *= -lssl -lupnp -lixml
LIBS *= -lcrypto -lz -lpthread
}
unix {
isEmpty(PREFIX) { PREFIX = /usr }
isEmpty(INC_DIR) { INC_DIR = "$${PREFIX}/include/retroshare06" }
isEmpty(LIB_DIR) { LIB_DIR = "$${PREFIX}/lib" }
isEmpty(DATA_DIR) { DATA_DIR = "$${PREFIX}/share/RetroShare06" }
DEFINES *= LIB_DIR=\"\\\"$${LIB_DIR}\\\"\"
DEFINES *= DATA_DIR=\"\\\"$${DATA_DIR}\\\"\"
@ -330,6 +339,10 @@ openbsd-* {
################################### COMMON stuff ##################################
# openpgpsdk
PRE_TARGETDEPS *= ../../openpgpsdk/src/lib/libops.a
LIBS *= ../../openpgpsdk/src/lib/libops.a -lbz2
HEADERS += dbase/cachestrapper.h \
dbase/fimonitor.h \
dbase/findex.h \

View File

@ -1,8 +1,10 @@
!include("../../retroshare.pri"): error("Could not include file ../../retroshare.pri")
TEMPLATE = lib
win32 {
CONFIG += staticlib
} else {
macx {
CONFIG = staticlib
} else {
CONFIG += staticlib
}
DEFINES *= OPENSSL_NO_IDEA

View File

@ -1,3 +1,5 @@
!include("../../retroshare.pri"): error("Could not include file ../../retroshare.pri")
TEMPLATE = lib
CONFIG *= plugin
@ -5,9 +7,6 @@ DEPENDPATH += ../../libretroshare/src/ ../../retroshare-gui/src/
INCLUDEPATH += ../../libretroshare/src/ ../../retroshare-gui/src/
unix {
isEmpty(PREFIX) { PREFIX = /usr }
isEmpty(LIB_DIR) { LIB_DIR = "$${PREFIX}/lib" }
target.path = "$${LIB_DIR}/retroshare/extensions6"
INSTALLS += target
}

View File

@ -1,5 +1,8 @@
QT += network xml script
!include("../../retroshare.pri"): error("Could not include file ../../retroshare.pri")
QT += network xml
CONFIG += qt gui uic qrc resources idle bitdht
CONFIG += link_prl
# Plz never commit the .pro with these flags enabled.
# Use this flag when developping new features only.
@ -73,47 +76,20 @@ linux-* {
QMAKE_CXXFLAGS *= -D_FILE_OFFSET_BITS=64
PRE_TARGETDEPS *= ../../libretroshare/src/lib/libretroshare.a
PRE_TARGETDEPS *= ../../openpgpsdk/src/lib/libops.a
LIBS += ../../libretroshare/src/lib/libretroshare.a
LIBS += ../../openpgpsdk/src/lib/libops.a -lbz2
LIBS += -lssl -lupnp -lixml -lXss -lgnome-keyring
LIBS *= -lcrypto -ldl -lX11 -lz
LIBS *= -lX11 -lXss
LIBS += ../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
SQLCIPHER_OK = $$system(pkg-config --exists sqlcipher && echo yes)
isEmpty(SQLCIPHER_OK) {
# We need a explicit path here, to force using the home version of sqlite3 that really encrypts the database.
exists(../../../lib/sqlcipher/.libs/libsqlcipher.a) {
LIBS += ../../../lib/sqlcipher/.libs/libsqlcipher.a
DEPENDPATH += ../../../lib/sqlcipher/src/
INCLUDEPATH += ../../../lib/sqlcipher/src/
DEPENDPATH += ../../../lib/sqlcipher/tsrc/
INCLUDEPATH += ../../../lib/sqlcipher/tsrc/
} else {
message(libsqlcipher.a not found. Compilation will not use SQLCIPHER. Database will be unencrypted.)
DEFINES *= NO_SQLCIPHER
LIBS *= -lsqlite3
}
} else {
LIBS += -lsqlcipher
}
LIBS *= -lglib-2.0
LIBS *= -rdynamic
#LIBS *= -lglib-2.0
LIBS *= -rdynamic -ldl
DEFINES *= HAVE_XSS # for idle time, libx screensaver extensions
DEFINES *= UBUNTU
}
unix {
isEmpty(PREFIX) { PREFIX = /usr }
isEmpty(DATA_DIR) { DATA_DIR = "$${PREFIX}/share/RetroShare06" }
target.path = "$${PREFIX}/bin"
target.path = "$${BIN_DIR}"
INSTALLS += target
data_files.path="$${DATA_DIR}/"
@ -123,6 +99,22 @@ unix {
style_files.path="$${DATA_DIR}/stylesheets"
style_files.files=gui/qss/chat/Bubble gui/qss/chat/Bubble_Compact
INSTALLS += style_files
icon_files.path = "$${PREFIX}/share/icons/hicolor"
icon_files.files = ../../data/24x24
icon_files.files += ../../data/48x48
icon_files.files += ../../data/64x64
icon_files.files += ../../data/128x128
INSTALLS += icon_files
desktop_files.path = "$${PREFIX}/share/applications"
desktop_files.files = ../../data/retroshare06.desktop
INSTALLS += desktop_files
pixmap_files.path = "$${PREFIX}/share/pixmaps"
pixmap_files.files = ../../data/retroshare06.xpm
INSTALLS += pixmap_files
}
linux-g++ {
@ -198,12 +190,10 @@ win32 {
#QTPLUGIN += qjpeg
PRE_TARGETDEPS *= ../../libretroshare/src/lib/libretroshare.a
PRE_TARGETDEPS *= ../../openpgpsdk/src/lib/libops.a
LIBS_DIR = $$PWD/../../../libs
LIBS += ../../libretroshare/src/lib/libretroshare.a
LIBS += ../../openpgpsdk/src/lib/libops.a -lbz2
LIBS += -L"$$LIBS_DIR/lib"
LIBS += ../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
@ -248,7 +238,6 @@ macx {
CONFIG += version_detail_bash_script
LIBS += ../../libretroshare/src/lib/libretroshare.a
LIBS += ../../openpgpsdk/src/lib/libops.a -lbz2
LIBS += -lssl -lcrypto -lz
#LIBS += -lssl -lcrypto -lz -lgpgme -lgpg-error -lassuan
LIBS += ../../../miniupnpc-1.0/libminiupnpc.a
@ -286,10 +275,8 @@ openbsd-* {
INCLUDEPATH *= /usr/local/include
PRE_TARGETDEPS *= ../../libretroshare/src/lib/libretroshare.a
PRE_TARGETDEPS *= ../../openpgpsdk/src/lib/libops.a
LIBS *= ../../libretroshare/src/lib/libretroshare.a
LIBS *= ../../openpgpsdk/src/lib/libops.a -lbz2
LIBS *= -lssl -lcrypto
LIBS *= -lgpgme
LIBS *= -lupnp
@ -311,11 +298,6 @@ openbsd-* {
# ###########################################
bitdht {
LIBS += ../../libbitdht/src/lib/libbitdht.a
PRE_TARGETDEPS *= ../../libbitdht/src/lib/libbitdht.a
}
DEPENDPATH += . ../../libretroshare/src/
INCLUDEPATH += ../../libretroshare/src/

View File

@ -1,3 +1,5 @@
!include("../../retroshare.pri"): error("Could not include file ../../retroshare.pri")
TEMPLATE = app
TARGET = RetroShare06-nogui
CONFIG += bitdht
@ -6,6 +8,7 @@ CONFIG += bitdht
# webinterface, requires libmicrohttpd
CONFIG += webui
CONFIG -= qt xml gui
CONFIG += link_prl
# if you are linking against the libretroshare with gxs.
# this option links against the required sqlite library.
@ -28,37 +31,11 @@ linux-* {
QMAKE_CXXFLAGS *= -D_FILE_OFFSET_BITS=64
LIBS += ../../libretroshare/src/lib/libretroshare.a
LIBS += ../../openpgpsdk/src/lib/libops.a -lbz2
LIBS += -lssl -lupnp -lixml -lgnome-keyring
LIBS *= -lcrypto -ldl -lz -lpthread
LIBS *= -rdynamic
gxs {
SQLCIPHER_OK = $$system(pkg-config --exists sqlcipher && echo yes)
isEmpty(SQLCIPHER_OK) {
# We need a explicit path here, to force using the home version of sqlite3 that really encrypts the database.
exists(../../../lib/sqlcipher/.libs/libsqlcipher.a) {
LIBS += ../../../lib/sqlcipher/.libs/libsqlcipher.a
DEPENDPATH += ../../../lib/sqlcipher/src/
INCLUDEPATH += ../../../lib/sqlcipher/src/
} else {
message(libsqlcipher.a not found. Compilation will not use SQLCIPHER. Database will be unencrypted.)
DEFINES *= NO_SQLCIPHER
LIBS *= -lsqlite3
}
} else {
LIBS *= -lsqlcipher
}
}
LIBS *= -rdynamic -ldl
}
unix {
isEmpty(PREFIX) { PREFIX = /usr }
target.path = "$${PREFIX}/bin"
target.path = "$${BIN_DIR}"
INSTALLS += target
}
@ -99,12 +76,10 @@ win32 {
MOC_DIR = temp/moc
PRE_TARGETDEPS *= ../../libretroshare/src/lib/libretroshare.a
PRE_TARGETDEPS *= ../../openpgpsdk/src/lib/libops.a
LIBS_DIR = $$PWD/../../../libs
LIBS += ../../libretroshare/src/lib/libretroshare.a
LIBS += ../../openpgpsdk/src/lib/libops.a -lbz2
LIBS += -L"$$LIBS_DIR/lib"
LIBS += -lssl -lcrypto -lpthread -lminiupnpc -lz
# added after bitdht
@ -134,7 +109,6 @@ macx {
LIBS += -Wl,-search_paths_first
LIBS += ../../libretroshare/src/lib/libretroshare.a
LIBS += ../../openpgpsdk/src/lib/libops.a -lbz2
LIBS += -lssl -lcrypto -lz
LIBS += ../../../miniupnpc-1.0/libminiupnpc.a
LIBS += -framework CoreFoundation
@ -173,24 +147,17 @@ openbsd-* {
INCLUDEPATH *= /usr/local/include
QMAKE_CXXFLAGS *= -Dfseeko64=fseeko -Dftello64=ftello -Dstat64=stat -Dstatvfs64=statvfs -Dfopen64=fopen
LIBS *= ../../libretroshare/src/lib/libretroshare.a
LIBS *= ../../openpgpsdk/src/lib/libops.a -lbz2
LIBS *= -lssl -lcrypto
LIBS *= -lgpgme
LIBS *= -lupnp
LIBS *= -lgnome-keyring
PRE_TARGETDEPS *= ../../libretroshare/src/lib/libretroshare.a
PRE_TARGETDEPS *= ../../openpgpsdk/src/lib/libops.a
LIBS *= -rdynamic
}
############################## Common stuff ######################################
# bitdht config
bitdht {
LIBS += ../../libbitdht/src/lib/libbitdht.a
}
DEPENDPATH += . ../../libretroshare/src
INCLUDEPATH += . ../../libretroshare/src

7
retroshare.pri Normal file
View File

@ -0,0 +1,7 @@
unix {
isEmpty(PREFIX) { PREFIX = "/usr" }
isEmpty(BIN_DIR) { BIN_DIR = "$${PREFIX}/bin" }
isEmpty(INC_DIR) { INC_DIR = "$${PREFIX}/include/retroshare06" }
isEmpty(LIB_DIR) { LIB_DIR = "$${PREFIX}/lib" }
isEmpty(DATA_DIR) { DATA_DIR = "$${PREFIX}/share/RetroShare06" }
}