forked from LibrePCB/LibrePCB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.pri
48 lines (39 loc) · 1.47 KB
/
common.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
# include user-defined things in every qmake project
exists(custom.pri):include(custom.pri)
# set prefix for "make install"
isEmpty(PREFIX):PREFIX = /usr/local
# set destination path for generated files
DESTDIR = $$relative_path($$shadowed("$$PWD/output"), $$OUT_PWD)
# determine absolute path to important directories
OUTPUT_DIR_ABS = $$shadowed($$absolute_path($${DESTDIR}, $${_PRO_FILE_PWD_}))
SHARE_DIR_ABS = $$absolute_path("share", $${PWD})
# is qt version sufficient
lessThan(QT_MAJOR_VERSION, 5) {
error("Qt version $$[QT_VERSION] is too old, should be version 5.2 or newer!")
} else {
lessThan(QT_MINOR_VERSION, 2) {
error("Qt version $$[QT_VERSION] is too old, should be version 5.2 or newer!")
}
}
# redirect qInfo to qDebug for Qt < 5.5 because qInfo was not yet available
# https://doc.qt.io/qt-5/qtglobal.html#qInfo
lessThan(QT_MINOR_VERSION, 5) {
DEFINES += qInfo=qDebug
}
# do not allow to use -Werror in release mode on Qt < 5.5 because Q_ASSERT() would lead
# to warnings (resp. errors) if the argument of Q_ASSERT() is not used elsewhere.
# --> see: http://code.qt.io/cgit/qt/qtbase.git/tree/dist/changes-5.5.0
CONFIG(release, debug|release) {
lessThan(QT_MINOR_VERSION, 5) {
QMAKE_CFLAGS -= -Werror
QMAKE_CXXFLAGS -= -Werror
}
}
# c++11 is obligatory!
CONFIG += c++11
# enable compiler warnings
CONFIG += warn_on
QMAKE_CXXFLAGS += -Wextra
QMAKE_CXXFLAGS_DEBUG += -Wextra
# QuaZIP: use as static library
DEFINES += QUAZIP_STATIC