-
Notifications
You must be signed in to change notification settings - Fork 5
/
cbird.pri
167 lines (132 loc) · 4.67 KB
/
cbird.pri
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
# general configuration for cbird and unit tests
# too many breaking changes
equals(QT_MAJOR_VERSION, 5) {
error("QT 6 is required")
}
QT *= core sql concurrent xml
CONFIG *= c++17 console
macx {
CONFIG -= app_bundle
}
VERSION=0.7.2
QMAKE_CXXFLAGS += -fdiagnostics-color=always
QMAKE_CXXFLAGS += -Wno-deprecated-declarations
#QMAKE_CXXFLAGS += -Werror
# cimg has openmp support, doesn't do much (qualityscore())
#QMAKE_CXXFLAGS += -fopenmp
#QMAKE_LFLAGS += -fopenmp
# autotools-style compiler override, also needed for appimage
CXX=$$(CXX)
!isEmpty(CXX) {
QMAKE_CXX=$$CXX
QMAKE_LINK=$$CXX
}
CC=$$(CC)
!isEmpty(CC) {
QMAKE_CC=$$CC
}
DESTDIR=$$_PRO_FILE_PWD_
BUILDDIR=_build
macx: BUILDDIR=_mac
win32: BUILDDIR=_win32
MOC_DIR=$$BUILDDIR
OBJECTS_DIR=$$BUILDDIR
RCC_DIR=$$BUILDDIR
UI_DIR=$$BUILDDIR
DEFINES += QT_FORCE_ASSERTS # Q_ASSERT(0) crashes the app
DEFINES += QT_MESSAGELOGCONTEXT # nice for custom logger
DEFINES += ENABLE_CIMG # still needed for qualityscore
DEFINES += QT_STRICT_ITERATORS # find inefficient iterators
# enable debug build/features, NOT CONFIG += debug
# DEFINES += DEBUG
# DEFINES += DEBUG_OPTIMIZED
contains(BUILD, debug) { DEFINES += DEBUG }
contains(BUILD, debugOptimized) { DEFINES += DEBUG_OPTIMIZED }
# private headers for DebugEventFilter
QTCORE_PRIVATE_HEADERS="$$[QT_INSTALL_HEADERS]/QtCore/$$QT_VERSION"
!exists( $$QTCORE_PRIVATE_HEADERS ) {
message("$${QTCORE_PRIVATE_HEADERS}/")
error("Can't find qtcore private headers, maybe you need qt6-base-private-dev")
}
INCLUDEPATH += $$QTCORE_PRIVATE_HEADERS
win32 {
INCLUDEPATH += _libs-win32/build-opencv/install/include
LIBS += -L_libs-win32/build-opencv/install/x64/mingw/lib
OPENCV_VERSION = 2413
OPENCV_LIBS *= ml objdetect stitching superres videostab calib3d
OPENCV_LIBS *= features2d highgui video photo imgproc flann core
for (CVLIB, OPENCV_LIBS) {
LIBS *= -lopencv_$${CVLIB}$${OPENCV_VERSION}
}
INCLUDEPATH += _libs-win32/build-mxe/include
LIBS += -L_libs-win32/build-mxe/lib
INCLUDEPATH += _libs-win32/build-mxe/include/QuaZip-Qt6-1.4
LIBS += -lquazip1-qt6
LIBS *= -lz -lpsapi -ldwmapi
}
macx {
# homebrew configuration
QT *= dbus
INCLUDEPATH *= /usr/local/include
LIBS *= -L/usr/local/lib
LIBS *= -ltermcap
OPENCV_LIBS *= ml objdetect stitching superres videostab calib3d
OPENCV_LIBS *= features2d highgui video photo imgproc flann core
for (CVLIB, OPENCV_LIBS) {
LIBS *= -lopencv_$${CVLIB}
}
LIBS *= -lquazip1-qt6
}
unix:!macx {
QT += dbus
INCLUDEPATH *= /usr/local/include
LIBS *= -L/usr/local/lib
LIBS *= -ltermcap
CV_REQUIRED=2.4.13.7
CV_VERSION=$$system("pkg-config opencv --modversion")
!equals(CV_VERSION,$$CV_REQUIRED) {
error("OpenCV $$CV_REQUIRED is required, found version <$$CV_VERSION>")
}
LIBS *= $$system("pkg-config opencv --libs")
# quazip uses a funky versioned include directory...and now qt6 doesn't seem
# to distribute pkg-config files at all (Ubuntu 22.04) but they're still in the source build
# .. so we need to find quazip ourself
# TODO: qt6 seems to have moved to cmake so throw all of this out..
QUAZIP_MODULE=quazip1-qt6
QUAZIP_VERSION=$$system("pkg-config $$QUAZIP_MODULE --modversion") # 1.4
QUAZIP_HEADERS="/usr/local/include/QuaZip-Qt6-$$QUAZIP_VERSION"
QUAZIP_LIB = "/usr/local/lib/lib$${QUAZIP_MODULE}.so"
!exists($$QUAZIP_HEADERS) {
message(expected QuaZip headers in $$QUAZIP_HEADERS)
error(quazip headers elude me)
}
INCLUDEPATH *= $$QUAZIP_HEADERS
!exists($$QUAZIP_LIB) {
message(expected QuaZip lib at $$QUAZIP_LIB)
error(quazip lib eludes me)
}
LIBS *= -l$${QUAZIP_MODULE} -lz
}
# cross-platform common libs
contains(DEFINES, ENABLE_CIMG) LIBS *= -lpng -ljpeg
LIBS *= -lavcodec -lavformat -lavutil -lswscale
LIBS *= -lexiv2
# testing other search tree implementations
# LIBS *= lib/vptree/lib/libvptree.a
contains(DEFINES, DEBUG) {
warning("******************************")
warning("DEBUG BUILD")
warning("******************************")
contains(DEFINES, DEBUG_OPTIMIZED) {
QMAKE_CXXFLAGS_RELEASE = -g -Ofast -march=native
}
else {
QMAKE_CXXFLAGS_RELEASE = -g -O0
}
}
else {
# westmere is latest that I can run in qemu, and
# it has popcnt (population count) which is nice for hamm64()
win32: QMAKE_CXXFLAGS_RELEASE = -Ofast -march=westmere
unix: QMAKE_CXXFLAGS_RELEASE = -Ofast -march=native
}