harbour-books/app/app.pro

257 lines
6.6 KiB
Prolog
Raw Normal View History

2016-10-07 17:41:59 +03:00
NAME = books
openrepos {
PREFIX = openrepos
DEFINES += OPENREPOS
} else {
PREFIX = harbour
}
TARGET = $${PREFIX}-$${NAME}
2015-06-28 14:22:35 +03:00
CONFIG += sailfishapp link_pkgconfig
2015-06-28 22:28:54 +03:00
PKGCONFIG += sailfishapp mlite5 glib-2.0
2016-10-07 17:41:59 +03:00
app_settings {
# This path is hardcoded in jolla-settings
TRANSLATIONS_PATH = /usr/share/translations
} else {
TRANSLATIONS_PATH = /usr/share/$${TARGET}/translations
}
2015-06-28 14:22:35 +03:00
!include(../common.pri)
CONFIG(debug, debug|release) {
DEFINES += HARBOUR_DEBUG=1
}
# Directories
FBREADER_DIR = $$_PRO_FILE_PWD_/../fbreader
FRIBIDI_DIR = $$_PRO_FILE_PWD_/../fribidi
LINEBREAK_DIR = $$_PRO_FILE_PWD_/../linebreak
HARBOUR_LIB_DIR = $$_PRO_FILE_PWD_/../harbour-lib
# Libraries
FBREADER_LIB = $$OUT_PWD/../fbreader/libfbreader.a
FRIBIDI_LIB = $$OUT_PWD/../fribidi/libfribidi.a
LINEBREAK_LIB = $$OUT_PWD/../linebreak/liblinebreak.a
HARBOUR_LIB = $$OUT_PWD/../harbour-lib/libharbour-lib.a
PRE_TARGETDEPS += \
$$FBREADER_LIB \
$$FRIBIDI_LIB \
$$LINEBREAK_LIB \
$$HARBOUR_LIB
LIBS += \
$$FBREADER_LIB \
$$FRIBIDI_LIB \
$$LINEBREAK_LIB \
$$HARBOUR_LIB \
-lbz2 -lz -ldl
OTHER_FILES += \
icons/harbour-books.svg \
2015-06-28 14:22:35 +03:00
harbour-books.desktop \
qml/*.qml \
qml/images/* \
2016-10-07 17:41:59 +03:00
settings/*.qml \
2015-06-28 14:22:35 +03:00
data/default/* \
data/zlibrary/core/encodings/* \
data/zlibrary/core/resources/* \
translations/*.ts
TARGET_DATA_DIR = /usr/share/harbour-books
TARGET_DEFAULT_DATA_DIR = $$TARGET_DATA_DIR/data
TARGET_ZLIBRARY_DATA_DIR = $$TARGET_DEFAULT_DATA_DIR
TARGET_ICON_ROOT = /usr/share/icons/hicolor
2015-06-28 14:22:35 +03:00
core_data.files = \
data/zlibrary/core/*.gz \
data/zlibrary/core/*.zip \
data/zlibrary/core/encodings \
data/zlibrary/core/resources
core_data.path = $$TARGET_ZLIBRARY_DATA_DIR
INSTALLS += core_data
text_data.files = data/zlibrary/text/*.zip
text_data.path = $$TARGET_ZLIBRARY_DATA_DIR
INSTALLS += text_data
defaults.files = data/default/*
defaults.path = $$TARGET_ZLIBRARY_DATA_DIR
INSTALLS += defaults
formats.files = data/formats/*
formats.path = $$TARGET_DEFAULT_DATA_DIR/formats
INSTALLS += formats
INCLUDEPATH += \
src \
$$HARBOUR_LIB_DIR/include \
$$FBREADER_DIR/fbreader/fbreader/src \
$$FBREADER_DIR/fbreader/zlibrary/text/include \
$$FBREADER_DIR/fbreader/zlibrary/core/include \
$$FBREADER_DIR/fbreader/zlibrary/core/src/view \
$$FBREADER_DIR/fbreader/zlibrary/core/src/dialogs \
$$FBREADER_DIR/fbreader/zlibrary/core/src/application \
$$FBREADER_DIR/fbreader/zlibrary/core/src/options \
$$FBREADER_DIR/fbreader/zlibrary/core/src/unix \
$$FBREADER_DIR/fbreader/zlibrary/ui/src/qt4
SOURCES += \
src/BooksBook.cpp \
src/BooksBookModel.cpp \
src/BooksConfig.cpp \
src/BooksCoverModel.cpp \
src/BooksCoverWidget.cpp \
src/BooksDialogManager.cpp \
src/BooksFeedback.cpp \
2015-07-12 17:11:55 +03:00
src/BooksHints.cpp \
2016-10-08 19:57:54 +03:00
src/BooksImageProvider.cpp \
2015-06-28 14:22:35 +03:00
src/BooksImportModel.cpp \
src/BooksListWatcher.cpp \
src/BooksLoadingProperty.cpp \
src/BooksMediaPlugin.cpp \
src/BooksPageStack.cpp \
2015-06-28 14:22:35 +03:00
src/BooksPageWidget.cpp \
src/BooksPaintContext.cpp \
src/BooksPathModel.cpp \
src/BooksPolicyPlugin.cpp \
src/BooksPos.cpp \
2015-06-28 14:22:35 +03:00
src/BooksSaveTimer.cpp \
src/BooksSettings.cpp \
src/BooksShelf.cpp \
src/BooksStorage.cpp \
src/BooksStorageModel.cpp \
src/BooksTask.cpp \
src/BooksTextStyle.cpp \
src/BooksTaskQueue.cpp \
src/BooksTextView.cpp \
src/BooksUtil.cpp \
2015-06-28 14:22:35 +03:00
src/main.cpp \
src/ZLApplication.cpp \
src/ZLibrary.cpp
2016-10-07 17:41:59 +03:00
# Some libraries are not allowed in harbour
openrepos {
LIBS += -lexpat -lmagic -ludev
} else {
SOURCES += \
stubs/libexpat.c \
stubs/libmagic.c \
stubs/libudev.c
}
2015-06-28 14:22:35 +03:00
HEADERS += \
src/BooksBook.h \
src/BooksBookModel.h \
src/BooksConfig.h \
src/BooksCoverModel.h \
src/BooksCoverWidget.h \
src/BooksDefs.h \
src/BooksDialogManager.h \
src/BooksFeedback.h \
2015-07-12 17:11:55 +03:00
src/BooksHints.h \
2016-10-08 19:57:54 +03:00
src/BooksImageProvider.h \
2015-06-28 14:22:35 +03:00
src/BooksImportModel.h \
src/BooksItem.h \
src/BooksListWatcher.h \
src/BooksLoadingProperty.h \
src/BooksMediaPlugin.h \
src/BooksPageStack.h \
2015-06-28 14:22:35 +03:00
src/BooksPageWidget.h \
src/BooksPaintContext.h \
src/BooksPathModel.h \
src/BooksPolicyPlugin.h \
2015-06-28 14:22:35 +03:00
src/BooksPos.h \
src/BooksSaveTimer.h \
src/BooksSettings.h \
src/BooksShelf.h \
src/BooksStorage.h \
src/BooksStorageModel.h \
src/BooksTask.h \
src/BooksTaskQueue.h \
src/BooksTextView.h \
src/BooksTextStyle.h \
src/BooksTypes.h \
src/BooksUtil.h
2016-10-07 17:41:59 +03:00
# Icons
ICON_SIZES = 86 108 128 256
for(s, ICON_SIZES) {
icon_target = icon$${s}
icon_dir = icons/$${s}x$${s}
$${icon_target}.files = $${icon_dir}/$${TARGET}.png
$${icon_target}.path = /usr/share/icons/hicolor/$${s}x$${s}/apps
equals(PREFIX, "openrepos") {
$${icon_target}.extra = cp $${icon_dir}/harbour-$${NAME}.png $$eval($${icon_target}.files)
$${icon_target}.CONFIG += no_check_exist
}
INSTALLS += $${icon_target}
}
# Settings
app_settings {
settings_json.files = settings/$${TARGET}.json
settings_json.path = /usr/share/jolla-settings/entries/
equals(PREFIX, "openrepos") {
settings_json.extra = sed s/harbour/openrepos/g settings/harbour-$${NAME}.json > $$eval(settings_json.files)
settings_json.CONFIG += no_check_exist
}
INSTALLS += settings_json
}
settings_qml.files = settings/*.qml
settings_qml.path = /usr/share/$${TARGET}/settings/
INSTALLS += settings_qml
# Desktop file
equals(PREFIX, "openrepos") {
desktop.extra = sed s/harbour/openrepos/g harbour-$${NAME}.desktop > $${TARGET}.desktop
desktop.CONFIG += no_check_exist
}
# Translations
TRANSLATION_SOURCES = \
$${_PRO_FILE_PWD_}/qml \
$${_PRO_FILE_PWD_}/settings
defineTest(addTrFile) {
in = $${_PRO_FILE_PWD_}/translations/harbour-$$1
out = $${OUT_PWD}/translations/$${PREFIX}-$$1
s = $$replace(1,-,_)
lupdate_target = lupdate_$$s
lrelease_target = lrelease_$$s
$${lupdate_target}.commands = lupdate -noobsolete $${TRANSLATION_SOURCES} -ts \"$${in}.ts\" && \
mkdir -p \"$${OUT_PWD}/translations\" && [ \"$${in}.ts\" != \"$${out}.ts\" ] && \
cp -af \"$${in}.ts\" \"$${out}.ts\" || :
$${lrelease_target}.target = $${out}.qm
2016-10-07 17:41:59 +03:00
$${lrelease_target}.depends = $${lupdate_target}
$${lrelease_target}.commands = lrelease -idbased \"$${out}.ts\"
QMAKE_EXTRA_TARGETS += $${lrelease_target} $${lupdate_target}
PRE_TARGETDEPS += $${out}.qm
qm.files += $${out}.qm
2016-10-07 17:41:59 +03:00
export($${lupdate_target}.commands)
export($${lrelease_target}.target)
export($${lrelease_target}.depends)
export($${lrelease_target}.commands)
export(QMAKE_EXTRA_TARGETS)
export(PRE_TARGETDEPS)
export(qm.files)
}
2018-02-02 00:45:13 +03:00
LANGUAGES = de fi nl ru sv es
2016-10-07 17:41:59 +03:00
addTrFile($${NAME})
for(l, LANGUAGES) {
addTrFile($${NAME}-$$l)
}
qm.path = $$TRANSLATIONS_PATH
qm.CONFIG += no_check_exist
INSTALLS += qm