Skip to content

Commit

Permalink
Fixed #368 - Improved qmake hamlib version parser - removed nondigi c…
Browse files Browse the repository at this point in the history
…hars
  • Loading branch information
foldynl committed May 19, 2024
1 parent 4281dbc commit 559c1af
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions QLog.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 559c1af

Please sign in to comment.