Expose generator version to C++


Both as a full string using the existing {{generatorVersion}} key,
but also as individual major, minor, and patch versions.

For the individual versions, split the string on the Java side and
provide three new additional properties. We have to do it on the
Java side, because we want these versions to be preprocessor
definitions in C++.

The usecase for that is to write version-specific code for tests,
because the generator generates different APIs depending on the
version. The ability to generate version-specific code may also
be helpful for the users.

Put the definitions into a new mustache file and generate a new
C++ header from this file.

Add a unit-test that checks that the individual major, minor, and
patch version definitions match the full version string.

One problem that I have found is that the default generator sets
the generatorVersion additional property *after* processOpts() is
called (see [0]), so we do not have access to this property in our
custom implementation of codegen.
For now, request the version on our own, using the same call as
the default generator does. Ideally we'd need to create a patch
upstream to fix it.

[0]: https://github.com/OpenAPITools/openapi-generator/blob/ae8352d9f9f4d904a00412d9e9c31d34c4fdab1c/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java#L288

Fixes: QTBUG-143288
Pick-to: 6.11
Change-Id: I0e533d979e576a26948cf29a5377faf03f25822d
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
commit53d6c27ab6f23121f6ff72473959850d01e95f66
parentfdabaf9591d17ea773e3c2b481b443e90135254e
authorIvan Solovev <ivan.solovev@qt.io>
committerIvan Solovev <ivan.solovev@qt.io>
commit timeTue, 13 Jan 2026 09:09:56 +0100