From 559c1af4fec0ec4baea2cf6dcd77362611915bc0 Mon Sep 17 00:00:00 2001 From: Ladislav Foldyna Date: Sun, 19 May 2024 20:23:03 +0200 Subject: [PATCH] Fixed #368 - Improved qmake hamlib version parser - removed nondigi chars --- QLog.pro | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/QLog.pro b/QLog.pro index 4360a983..308ba1e8 100644 --- a/QLog.pro +++ b/QLog.pro @@ -376,19 +376,31 @@ defineReplace(findPackage) { return($$eval($$pkg)) } +defineReplace(removeNonDigi) { + output = $$1 + output = $$replace(output, [^0-9], " ") + output = $$split(output, " ") + return($$member(output, 0)) +} + isEmpty(HAMLIBVERSION_MAJOR) { HAMLIBVERSIONSTRING = $$findPackage(hamlib) HAMLIBVERSIONS = $$split(HAMLIBVERSIONSTRING, ".") HAMLIBVERSION_MAJOR = $$member(HAMLIBVERSIONS, 0) HAMLIBVERSION_MINOR = $$member(HAMLIBVERSIONS, 1) HAMLIBVERSION_PATCH = $$member(HAMLIBVERSIONS, 2) +} - isEmpty(HAMLIBVERSION_MINOR){ - HAMLIBVERSION_MINOR=0 - } - isEmpty(HAMLIBVERSION_PATCH){ - HAMLIBVERSION_PATCH=0 - } +HAMLIBVERSION_MINOR = $$removeNonDigi($$HAMLIBVERSION_MINOR) + +isEmpty(HAMLIBVERSION_MINOR){ + HAMLIBVERSION_MINOR=0 +} + +HAMLIBVERSION_PATCH = $$removeNonDigi($$HAMLIBVERSION_PATCH) + +isEmpty(HAMLIBVERSION_PATCH){ + HAMLIBVERSION_PATCH=0 } !isEmpty(HAMLIBINCLUDEPATH) {