Show application version on my "AboutPage"

I think it’s available only to the OP.

Ah, right :grinning:

I do it very similar but extract the from the rpm spec file that is update with the latest tag during build.

They way I do is but using QMake to substitute some variables in my data class that is then compiled in:

To pass those values to qmake I call rpmspec during build to parse the specfile with this small qmake function:

When all this assembled the class is build from where it is available on the C++ and QML side:

I use a similar mechanism for many of my apps; I set the version manually in the .pro file, and expose it as a C define, pass it to QML side in “main.cpp” and then use it. It works beautifully, but whenever I change the value in the .pro file, I have to touch main.cpp in order to make the new value take effect. Clean build makes the same thing. Just something to keep in mind if you don’t use any external files with this which would get timestamped and properly included every time they change.

If you use a header that is generated the timestamp will change with.

Is there a way to configure this in yaml for cmake?

Passing options to cmake on YAML side is not supported yet. The corresponding source is spectacle/spec.tmpl at master · sailfishos/spectacle · GitHub in case you wish to contribute.