-
Notifications
You must be signed in to change notification settings - Fork 5
/
cbird.pro
191 lines (150 loc) · 5.31 KB
/
cbird.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
TEMPLATE = app
#TARGET =
DEPENDPATH *= .
INCLUDEPATH *= .
QT *= widgets
# disable default debug/release behavior
# use DEFINES += DEBUG for debugging
#DEFINES += DEBUG
CONFIG -= debug_and_release
CONFIG -= debug_and_release_target
CONFIG += release
CONFIG += silent
contains(BUILD, verbose) { CONFIG -= silent }
include(cbird.pri)
CONFIG += precompile_header
PRECOMPILED_HEADER=src/prefix.h
precompile_header {
win32-deprecated {
# pch only works on windows if .h is in the same dir as .gch,
# since we change OBJECTS_DIR, gch is in the wrong dir
message("win32 precompiled header hack")
PRECOMPILED_HEADER_COPY=$$OBJECTS_DIR/$$PRECOMPILED_HEADER
copy_pch.target = $$PRECOMPILED_HEADER_COPY
copy_pch.commands = $(COPY_FILE) $$PRECOMPILED_HEADER $$PRECOMPILED_HEADER_COPY
copy_pch.depends= $$PRECOMPILED_HEADER
QMAKE_EXTRA_TARGETS += copy_pch
PRE_TARGETDEPS += $$PRECOMPILED_HEADER_COPY
}
} else {
warning("no precompiled headers... run 'make prefix.h.gch' first")
QMAKE_PRE_TARGETDEPS += src/prefix.h.gch
QMAKE_CXX = $$COMPILER -include src/prefix.h
precompiled_header.target = prefix.h.gch
precompiled_header.commands = $$COMPILER $(CXXFLAGS) $(INCPATH) -x c++-header $$PRECOMPILED_HEADER
precompiled_header.depends = $$PRECOMPILED_HEADER index.pro
QMAKE_EXTRA_TARGETS += precompiled_header
}
# automatic version script
QMAKE_PRE_TARGETDEPS += $$OBJECTS_DIR/git.h
git.target = $$OBJECTS_DIR/git.h
git.commands = ./tools/gitversion.sh "$$OBJECTS_DIR" "$$VERSION"
git.depends = .git
QMAKE_EXTRA_TARGETS += git
# input
RESOURCES += src/cbird.qrc src/qdarkstyle/dark/darkstyle.qrc src/qdarkstyle/light/lightstyle.qrc
HEADERS += $$files(src/*.h)
HEADERS += $$files(src/gui/*.h)
HEADERS += $$files(src/lib/*.h)
HEADERS += $$files(src/tree/*.h)
SOURCES += $$files(src/*.cpp)
SOURCES += $$files(src/gui/*.cpp)
SOURCES += $$files(src/lib/*.cpp)
!contains(DEFINES, ENABLE_CIMG): SOURCES -= src/cimgops.cpp
win32: {
RC_ICONS = windows/cbird.ico
INSTALLS += target
target.path = $$BUILDDIR/cbird
warn.path = $$BUILDDIR/cbird
warn.extra = ./windows/mxe-pkg.sh $$VERSION x86_64
INSTALLS += warn
}
unix: {
# qt bug: only strip if binary
QMAKE_STRIP = tools/strip.sh
# installation location override
PREFIX=/usr/local
!equals('',$$(PREFIX)) {
PREFIX=$$(PREFIX)
message("Installing in $$PREFIX")
}
!equals('',$$(PORTABLE)) {
DEFINES *= CBIRD_PORTABLE_BINARY=1
message("Configured for portable deployment")
}
INSTALLS += target
target.path = $$PREFIX/bin
scripts.files = tools/ffplay-sbs tools/ff-compare-audio
scripts.path = $$PREFIX/bin/
INSTALLS += scripts
}
macx: {
TARGET = cbird-mac # don't step on Linux build
DEFINES += CBIRD_PORTABLE_BINARY # look for runtime deps in applicationDirPath
RESOURCES += mac/mac.qrc
portable.$$OBJECTS_DIR/cbird
portable.commands = ./mac/mac-pkg.sh $$[QT_INSTALL_PLUGINS]
QMAKE_EXTRA_TARGETS += portable
}
unix:!macx: {
desktop.files = unix/cbird.desktop
desktop.path = $$PREFIX/share/applications
icon.files = src/res/cbird.svg
icon.path = $$PREFIX/share/icons/hicolor/scalable/apps
#scripts.extra = echo extra
INSTALLS += desktop icon
# appimage target "make appimage"
# linuxdeployqt doesn't bring over qt6 plugins so add them manually
# wayland plugins needed for some distros
# ffmpeg/ffplay/ffprobe are required by extra tool scripts
PLUGINS=egldeviceintegrations generic imageformats platforms platformthemes \
platforminputcontexts sqldrivers xcbglintegrations
EXTRA_PLUGINS_ABS=$$system("ls $$[QT_INSTALL_PLUGINS]/wayland-*/*.so")
for (DIR, PLUGINS) {
EXTRA_PLUGINS_ABS+=$$files($$[QT_INSTALL_PLUGINS]/$${DIR}/*.so)
}
EXTRA_PLUGINS_REL=
for (ABS, EXTRA_PLUGINS_ABS) {
EXTRA_PLUGINS_REL+=$$relative_path($$ABS, $$[QT_INSTALL_PLUGINS])
}
EXTRA_PLUGINS=$$join(EXTRA_PLUGINS_REL,',')
#message("EXTRA_PLUGINS=" $$EXTRA_PLUGINS)
#message($$QMAKE_QMAKE)
#message($$[QT_INSTALL_LIBS]);
APPDIR=$$OBJECTS_DIR/appimage
LINUXDEPLOYQT=~/Downloads/linuxdeployqt-continuous-x86_64.AppImage
appimage.commands = (rm -rf $$APPDIR && \
PREFIX="$$APPDIR/cbird" $$QMAKE_QMAKE && \
make install && \
cp -auv /usr/local/bin/ff* $$APPDIR/cbird/bin/ && \
LD_LIBRARY_PATH=$$[QT_INSTALL_LIBS]:/usr/local/lib VERSION=$$VERSION $$LINUXDEPLOYQT \
$$APPDIR/cbird/share/applications/cbird.desktop \
-extra-plugins=$$EXTRA_PLUGINS \
-executable=/usr/local/bin/ffplay \
-executable=/usr/local/bin/ffprobe \
-executable=/usr/local/bin/ffmpeg \
-qmake=$$QMAKE_QMAKE \
-appimage)
QMAKE_EXTRA_TARGETS += appimage
}
contains(BUILD, verbose) {
message("QT=" $$QT)
message("CONFIG=" $$CONFIG)
message("COMPILERS= $$QMAKE_CC $$QMAKE_CXX $$QMAKE_LINK")
message("CXXFLAGS=" $$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE)
message("INCLUDEPATH=" $$INCLUDEPATH)
message("DEFINES=" $$DEFINES)
message("LIBS=" $$LIBS)
}
DISTFILES += \
readme.md \
doc/cbird-devel.md \
doc/cbird-compile.md \
mac/mac-pkg.sh \
mac/make-icons.sh \
tools/copystylesheet.sh \
tools/gitversion.sh \
tools/strip.sh \
windows/make-ico.sh \
windows/mxe-pkg.sh \
windows/mxe.env