auto increment project versions

how can project versions be incremented automatically? project() must be called directly so i cannot generate and include it later. What i can do is set the project version seperately.

Do i have to set all variants of

CMAKE_PROJECT_VERSION
PROJECT_VERSION
MyProj_VERSION

for major, minor, etc or is there a more direct way to do it?

You can still do stuff before a call to project() if memory serves, it should be possible to, for example, load the version from file to a variable and use that in a call to project().

Someone please correct me if I’m wrong.

You can definitely do this. In fact, Qt6 does exactly this.