mirror of
https://github.com/mumble-voip/mumble.git
synced 2025-10-26 11:19:16 +00:00
This introduces a new variable, QT_VERSION_INT, which allows
qmake files to more easily do Qt version checks.
Previosly, code would chain greaterThan/equals/lessThan with
logical ands for QT_MAJOR_VERSION and QT_MINOR_VERSION.
That worked OK, but was a little verbose, and is inconvenient
if you want to use a QT_VERSION check alongside other conditions
in a conditional.
The QT_VERSION_INT is a string variable is of the form:
Qt 5.0.0: 50000
Qt 5.6.1: 50601
it is base 10, and can be used with qmake's comparison operators
like so:
greaterThan(QT_VERSION_INT, 50600) {
// Do stuff for Qt > 5.6
}
This commit also removes our own copies of QT_MAJOR_VERSION
and QT_MINOR_VERSION. These are provided by mkspecs/qconfig.pri,
and have been since (at least) Qt 4. So they're already available.
We don't need to provide them. Our method of fetching them was also
buggy due to Qt 4 compatibility - so that's fixed now.
25 lines
788 B
Plaintext
25 lines
788 B
Plaintext
# Copyright 2005-2016 The Mumble Developers. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style license
|
|
# that can be found in the LICENSE file at the root of the
|
|
# Mumble source tree or at <https://www.mumble.info/LICENSE>.
|
|
|
|
QT_VERSION_INT_MAJOR = $$QT_MAJOR_VERSION
|
|
|
|
greaterThan(QT_MINOR_VERSION, 99) {
|
|
error(bad Qt minor version)
|
|
} greaterThan(QT_MINOR_VERSION, 9) {
|
|
QT_VERSION_INT_MINOR = "$$QT_MINOR_VERSION"
|
|
} else {
|
|
QT_VERSION_INT_MINOR = "0$$QT_MINOR_VERSION"
|
|
}
|
|
|
|
greaterThan(QT_PATCH_VERSION, 99) {
|
|
error(bad Qt patch version)
|
|
} greaterThan(QT_PATCH_VERSION, 9) {
|
|
QT_VERSION_INT_PATCH = "$$QT_PATCH_VERSION"
|
|
} else {
|
|
QT_VERSION_INT_PATCH = "0$$QT_PATCH_VERSION"
|
|
}
|
|
|
|
QT_VERSION_INT = "$$QT_VERSION_INT_MAJOR$$QT_VERSION_INT_MINOR$$QT_VERSION_INT_PATCH"
|