forked from Rain92/qt5-kobo-platform-plugin
-
Notifications
You must be signed in to change notification settings - Fork 2
/
koboplatformplugin.pro
121 lines (97 loc) · 3.3 KB
/
koboplatformplugin.pro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
TARGET = kobo
QTDIR = /mnt/onboard/.adds/qt-linux-5.15-kobo
CROSS_TC = arm-kobo-linux-gnueabihf
TEMPLATE = lib
CONFIG += plugin
DEFINES += QT_NO_FOREACH
QMAKE_CXXFLAGS += -Wno-missing-field-initializers
QMAKE_RPATHDIR += ../../lib
QT += widgets \
core-private gui-private \
service_support-private eventdispatcher_support-private input_support-private \
fb_support-private fontdatabase_support-private
INCLUDEPATH += $$PWD/src
# FBINK
DEFINES += FBINK_FOR_KOBO
FBInkBuildEvent.input = $$PWD/FBink/*.c $$PWD/FBink/*.h
PHONY_DEPS = .
FBInkBuildEvent.input = PHONY_DEPS
FBInkBuildEvent.output = FBInk
FBInkBuildEvent.clean_commands = make -C $$PWD/FBInk clean
FBInkBuildEvent.name = building FBInk
FBInkBuildEvent.CONFIG += no_link target_predeps
QMAKE_EXTRA_COMPILERS += FBInkBuildEvent
# Old:
# INCLUDEPATH += $$PWD/FBInk $$PWD/FBInk/libi2c-staged/include
# LIBS += -L$$PWD/FBInk/libi2c-staged/lib/ -l:libi2c.a
# New 2024 FBInk:
INCLUDEPATH += $$PWD/FBInk
# We always want release.
# CONFIG(debug, debug|release) {
# FBInkBuildEvent.commands = CROSS_TC=$$CROSS_TC MINIMAL=1 DRAW=1 DEBUG=1 KOBO=true make -C $$PWD/FBInk pic
# LIBS += -L$$PWD/FBInk/Debug -l:libfbink.a
# }
CONFIG(release, debug|release) {
FBInkBuildEvent.commands = CROSS_TC=$$CROSS_TC MINIMAL=1 DRAW=1 KOBO=true make -C $$PWD/FBInk pic
LIBS += -L$$PWD/FBInk/Release -l:libfbink.a
}
SOURCES = src/main.cpp \
src/dither.cpp \
src/kobodevicedescriptor.cpp \
src/kobofbscreen.cpp \
src/koboplatformintegration.cpp \
src/qevdevtouchdata.cpp \
src/qevdevtouchdata2.cpp \
src/qevdevtouchhandlerthread.cpp \
src/qevdevtouchmanager.cpp \
src/qevdevtouchhandler.cpp
HEADERS = \
src/dither.h \
src/einkenums.h \
src/kobodevicedescriptor.h \
src/kobofbscreen.h \
src/koboplatformfunctions.h \
src/koboplatformintegration.h \
src/qevdevtouchdata.h \
src/qevdevtouchdata2.h \
src/qevdevtouchfilter_p.h \
src/qevdevtouchhandler.h \
src/qevdevtouchhandlerthread.h \
src/qevdevtouchmanager_p.h
OTHER_FILES += \
target.path =$$QTDIR/plugins/platforms
INSTALLS += target
DISTFILES += \
koboplatformplugin.json
RESOURCES += \
resources.qrc
DESTDIR = build/ereader
OBJECTS_DIR = build/ereader/obj
MOC_DIR = build/ereader/moc
RCC_DIR = build/ereader/rcc
UI_DIR = build/ereader/ui
# https://forum.qt.io/topic/150792/how-to-get-git-commit-id-during-build-and-display-it-as-version-information/8
GIT_PATH=$$system(which git)
!isEmpty(GIT_PATH) {
BUILD_VERSION=$$system($$GIT_PATH rev-parse HEAD)
BUILD_USER=$$system($$GIT_PATH config user.name)
}
isEmpty(BUILD_VERSION) {
message("Error: Compilation stopped. Git not found")
CONFIG += invalid_configuration
}
isEmpty(BUILD_USER) {
message("Error: Compilation stopped. Git user not found")
CONFIG += invalid_configuration
}
DEFINES += "GIT_COMMIT_HASH=\"\\\"$$BUILD_VERSION\\\"\""
DEFINES += "GIT_USER=\"\\\"$$BUILD_USER\\\"\""
DATE_PATH=$$system(which date)
!isEmpty(DATE_PATH) {
COMPILATION_DATE=$$system($$DATE_PATH)
}
isEmpty(COMPILATION_DATE) {
message("Error: Compilation stopped. date not found")
CONFIG += invalid_configuration
}
DEFINES += "COMP_TIME=\"\\\"$$COMPILATION_DATE\\\"\""