2021-06-10 18:54:54 +08:00
|
|
|
|
######################################################################
|
|
|
|
|
# Automatically generated by qmake (3.1) Mon Jun 7 20:28:16 2021
|
|
|
|
|
######################################################################
|
|
|
|
|
TEMPLATE = app
|
|
|
|
|
TARGET = deepin-ocr
|
|
|
|
|
INCLUDEPATH += .
|
2021-06-28 11:46:54 +08:00
|
|
|
|
#CONFIG += C++17
|
|
|
|
|
#QMAKE_CXXFLAGS += -std=c++17 -std=gnu++17
|
2021-06-10 18:54:54 +08:00
|
|
|
|
|
|
|
|
|
# The following define makes your compiler warn you if you use any
|
|
|
|
|
# feature of Qt which has been marked as deprecated (the exact warnings
|
|
|
|
|
# depend on your compiler). Please consult the documentation of the
|
|
|
|
|
# deprecated API in order to know how to port your code away from it.
|
|
|
|
|
DEFINES += QT_DEPRECATED_WARNINGS
|
|
|
|
|
|
|
|
|
|
# You can also make your code fail to compile if you use deprecated APIs.
|
|
|
|
|
# In order to do so, uncomment the following line.
|
|
|
|
|
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
|
|
|
|
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
|
|
|
|
|
|
|
|
|
# Input
|
|
|
|
|
HEADERS += src/mainwindow.h \
|
|
|
|
|
src/service/ocrinterface.h \
|
|
|
|
|
src/service/dbusocr_adaptor.h \
|
|
|
|
|
src/ocrapplication.h \
|
|
|
|
|
src/mainwidget.h \
|
|
|
|
|
src/resulttextview.h \
|
|
|
|
|
src/textloadwidget.h \
|
2021-06-11 14:39:51 +08:00
|
|
|
|
src/view/imageview.h \
|
2021-06-21 16:06:30 +08:00
|
|
|
|
src/tessocrutils/tessocrutils.h \
|
|
|
|
|
src/loadingwidget.h
|
2021-06-10 18:54:54 +08:00
|
|
|
|
|
|
|
|
|
SOURCES += src/main.cpp \
|
|
|
|
|
src/mainwindow.cpp \
|
|
|
|
|
src/service/ocrinterface.cpp \
|
|
|
|
|
src/service/dbusocr_adaptor.cpp \
|
|
|
|
|
src/ocrapplication.cpp \
|
|
|
|
|
src/mainwidget.cpp \
|
|
|
|
|
src/textloadwidget.cpp \
|
|
|
|
|
src/resulttextview.cpp \
|
2021-06-11 14:39:51 +08:00
|
|
|
|
src/view/imageview.cpp \
|
2021-06-21 16:06:30 +08:00
|
|
|
|
src/tessocrutils/tessocrutils.cpp \
|
|
|
|
|
src/loadingwidget.cpp
|
2021-06-10 18:54:54 +08:00
|
|
|
|
|
2021-06-28 11:46:54 +08:00
|
|
|
|
LIBS += -llept -ltesseract\
|
2021-06-22 20:13:39 +08:00
|
|
|
|
|
2021-06-28 11:46:54 +08:00
|
|
|
|
#include(3rdparty/tesseract_ocr/tesseract_dependency.pri)
|
2021-06-10 18:54:54 +08:00
|
|
|
|
|
|
|
|
|
QT += dtkgui
|
|
|
|
|
QT += dtkwidget
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#installs
|
|
|
|
|
target.path=/usr/bin
|
|
|
|
|
|
2021-06-28 15:56:17 +08:00
|
|
|
|
##翻译
|
2021-06-28 17:29:04 +08:00
|
|
|
|
isEmpty(TRANSLATIONS) {
|
|
|
|
|
include(./translations.pri)
|
2021-06-28 14:38:32 +08:00
|
|
|
|
}
|
2021-06-28 17:29:04 +08:00
|
|
|
|
#CONFIG(release, debug|release) {
|
|
|
|
|
# TRANSLATIONS = $$files($$PWD/translations/*.ts)
|
|
|
|
|
# #遍历目录中的ts文件,调用lrelease将其生成为qm文件
|
|
|
|
|
# for(tsfile, TRANSLATIONS) {
|
|
|
|
|
# qmfile = $$replace(tsfile, .ts$, .qm)
|
|
|
|
|
# system(lrelease $$tsfile -qm $$qmfile) | error("Failed to lrelease")
|
|
|
|
|
# }
|
|
|
|
|
#}
|
2021-06-10 18:54:54 +08:00
|
|
|
|
TRANSLATIONS_COMPILED = $$TRANSLATIONS
|
|
|
|
|
TRANSLATIONS_COMPILED ~= s/\.ts/.qm/g
|
2021-06-28 17:29:04 +08:00
|
|
|
|
|
2021-06-10 18:54:54 +08:00
|
|
|
|
translations.path=/usr/share/deepin-ocr/translations
|
2021-06-28 17:29:04 +08:00
|
|
|
|
translations.files = $$TRANSLATIONS_COMPILED
|
|
|
|
|
|
|
|
|
|
#translations.files=$$PWD/translations/*qm
|
2021-06-10 18:54:54 +08:00
|
|
|
|
|
|
|
|
|
#Dbus文件
|
|
|
|
|
dbus_service.path=/usr/share/dbus-1/services
|
|
|
|
|
dbus_service.files=./com.deepin.Ocr.service
|
|
|
|
|
|
2021-06-11 14:39:51 +08:00
|
|
|
|
#Tesseract-ocr识别语言包
|
|
|
|
|
tesslangs.path=/usr/share/deepin-ocr/tesslangs
|
2021-06-15 13:22:21 +08:00
|
|
|
|
tesslangs.files=./assets/tesslangs/chi_sim.traineddata ./assets/tesslangs/chi_tra.traineddata ./assets/tesslangs/eng.traineddata ./assets/tesslangs/chi_sim_vert.traineddata ./assets/tesslangs/chi_tra_vert.traineddata
|
2021-06-10 18:54:54 +08:00
|
|
|
|
|
2021-06-30 17:13:19 +08:00
|
|
|
|
desktop.path=/usr/share/applications
|
|
|
|
|
desktop.files=./deepin-ocr.desktop
|
|
|
|
|
|
|
|
|
|
icon.path=/usr/share/icons/hicolor/scalable/apps
|
|
|
|
|
icon.files=./assets/deepin-ocr.svg
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
INSTALLS += target dbus_service translations icon desktop tesslangs
|
2021-06-10 18:54:54 +08:00
|
|
|
|
|
2021-06-28 17:29:04 +08:00
|
|
|
|
CONFIG *= update_translations release_translations
|
|
|
|
|
|
|
|
|
|
CONFIG(update_translations) {
|
|
|
|
|
isEmpty(lupdate):lupdate=lupdate
|
|
|
|
|
system($$lupdate -no-obsolete -locations none $$_PRO_FILE_)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CONFIG(release_translations) {
|
|
|
|
|
isEmpty(lrelease):lrelease=lrelease
|
|
|
|
|
system($$lrelease $$_PRO_FILE_)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DSR_LANG_PATH += $$DSRDIR/translations
|
|
|
|
|
DEFINES += "DSR_LANG_PATH=\\\"$$DSR_LANG_PATH\\\""
|
|
|
|
|
|
2021-06-10 18:54:54 +08:00
|
|
|
|
RESOURCES += \
|
|
|
|
|
resource.qrc
|
2021-06-22 20:13:39 +08:00
|
|
|
|
|
2021-06-28 11:46:54 +08:00
|
|
|
|
#DISTFILES += \
|
|
|
|
|
# 3rdparty/tesseract_ocr/tesseract_dependency.pri
|