Master versiontag

Same as #6007 but for master, I guess it should go in first and cherry pick the merge commit to Helix?
Can this be simplified to
```
APP_VERSION=${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}
if test "$APP_VERSION_TAG" != ""; then
  APP_VERSION=${APP_VERSION}-${APP_VERSION_TAG}
fi
```
similar to the OSX and WIN32 code?