diff options
author | Dominik Holland <dominik.holland@pelagicore.com> | 2017-11-30 14:08:43 +0100 |
---|---|---|
committer | Robert Griebl <robert.griebl@pelagicore.com> | 2017-11-30 13:18:24 +0000 |
commit | fc1d71b43d7acde7b6da0ef0ccf26dad43207767 (patch) | |
tree | 3eef8aaddb01c3e1c68cfe41281d7e72a6e5567c /qmake-features | |
parent | 9a679121f4257ab71a1ebb09a012fa2206f300df (diff) |
Fix the version comparison for enabling the dlt lazy init
With Qt version 5.9 no MAJOR_, MINOR_ and PATCH_VERSION variables are
generated for the modules anymore.
Because of that the lazy initialization of the DLT categories were
never enabled, which caused appman to only register the Categories
which are used for logging instead of all of them.
A generic qmake test function is now used for the version comparison of
the VERSION string.
In newer Qt version (5.10.0) qmake provides a builtin function
Task-number: AUTOSUITE-169
Change-Id: I76b40320167835b10b159ec221a100f3b1276f88
Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
Diffstat (limited to 'qmake-features')
-rw-r--r-- | qmake-features/am-config.prf | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/qmake-features/am-config.prf b/qmake-features/am-config.prf index b0fd235a..d136f91f 100644 --- a/qmake-features/am-config.prf +++ b/qmake-features/am-config.prf @@ -42,6 +42,30 @@ defineTest(CONFIG_VALUE) { return(true) } +!defined(versionAtLeast, test): { + defineTest(versionAtLeast) { + LEFT_VERSION = $$eval($$1) + LEFT_VERSION_MAJOR = $$section(LEFT_VERSION, ., 0, 0) + LEFT_VERSION_MINOR = $$section(LEFT_VERSION, ., 1, 1) + LEFT_VERSION_PATCH = $$section(LEFT_VERSION, ., 2, 2) + + RIGHT_VERSION = $$2 + RIGHT_VERSION_MAJOR = $$section(RIGHT_VERSION, ., 0, 0) + RIGHT_VERSION_MINOR = $$section(RIGHT_VERSION, ., 1, 1) + RIGHT_VERSION_PATCH = $$section(RIGHT_VERSION, ., 2, 2) + + greaterThan(LEFT_VERSION_MAJOR, $$RIGHT_VERSION_MAJOR) { + return(true) + } else:equals(LEFT_VERSION_MAJOR, $$RIGHT_VERSION_MAJOR):greaterThan(LEFT_VERSION_MINOR, $$RIGHT_VERSION_MINOR) { + return(true) + } else:equals(LEFT_VERSION_MAJOR, $$RIGHT_VERSION_MAJOR):equals(LEFT_VERSION_MINOR, $$RIGHT_VERSION_MINOR):!lessThan(LEFT_VERSION_PATCH, $$RIGHT_VERSION_PATCH) { + return(true) + } + + return(false) + } +} + CONFIG_VALUE(install-prefix, INSTALL_PREFIX) CONFIG_VALUE(hardware-id, AM_HARDWARE_ID):DEFINES *= AM_HARDWARE_ID=\\\"$$AM_HARDWARE_ID\\\" |