- Support FilesystemHierarchyStandard on Linux/Unix using preprocessor macros in .pro files.

- Add support for "make install" and "qmake PREFIX=" to improve YACReader packageability.
- Add .desktop files for YACReader and YACReaderLibrary X11 desktop integration.
- Add central YACReader.pro file as alternative to compileX11.sh
- Add p7zip patch support and sourcecode check to .pro files
This commit is contained in:
Felix Kauselmann
2014-06-25 18:15:41 +02:00
parent 7681fe699b
commit 1d6d605a26
16 changed files with 225 additions and 11 deletions

View File

@ -8,6 +8,10 @@ DEPENDPATH += . \
DEFINES += NOMINMAX
unix:!macx{
QMAKE_CXXFLAGS += -std=c++11
}
isEqual(QT_MAJOR_VERSION, 5) {
Release:DESTDIR = ../release5
Debug:DESTDIR = ../debug5
@ -34,3 +38,57 @@ TRANSLATIONS = yacreader_es.ts \
yacreader_nl.ts \
yacreader_tr.ts \
yacreader_source.ts
win32:!exists (../compressed_archive/lib7zip) {
error(You\'ll need 7zip source code to compile YACReader. \
Please check the compressed_archive folder for further instructions.)
}
unix:exists (../compressed_archive/libp7zip) {
message(Found p7zip source code...)
system(patch -d ../compressed_archive -N -p0 -i libp7zip.patch)
} else {
error(You\'ll need 7zip source code to compile YACReader. \
Please check the compressed_archive folder for further instructions.)
}
unix:!macx {
#set install prefix if it's empty
isEmpty(PREFIX) {
PREFIX = /usr
}
BINDIR = $$PREFIX/bin
LIBDIR = $$PREFIX/lib
DATADIR = $$PREFIX/share
DEFINES += "LIBDIR=\\\"$$LIBDIR\\\"" "DATADIR=\\\"$$DATADIR\\\""
#MAKE INSTALL
INSTALLS += bin docs icon desktop translation
bin.path = $$BINDIR
isEmpty(DESTDIR) {
bin.files = YACReader
} else {
bin.files = $$DESTDIR/YACReader
}
docs.path = $$DATADIR/doc/YACReader
docs.files = ../*.txt
icon.path = $$DATADIR/YACReader
icon.files = ../images/icon.png
desktop.path = $$DATADIR/applications
desktop.extra = desktop-file-edit --set-icon=$$DATADIR/YACReader/icon.png $$PWD/../YACReader.desktop
desktop.files = ../YACReader.desktop
#TODO: icons should be located at /usr/share/icons and have the same basename as their application
translation.path = $$DATADIR/YACReader/languages
translation.files = ../release/languages/yacreader_*
}

View File

@ -95,7 +95,11 @@ int main(int argc, char * argv[])
QTranslator translator;
QString sufix = QLocale::system().name();
#if defined Q_OS_UNIX && !defined Q_OS_MAC
translator.load(QString(DATADIR)+"/YACReader/languages/yacreader_"+sufix);
#else
translator.load(QCoreApplication::applicationDirPath()+"/languages/yacreader_"+sufix);
#endif
app.installTranslator(&translator);
MainWindowViewer * mwv = new MainWindowViewer();