Is there a way to customize the generate step trigger?

Is there a way to customize the generate step trigger?

Hi folks,

my cmake code reads version tags from the underlying git repository,
derives a new version with the help of the existing tags and then sets
that new version to the project() call. However, the cmake generate step
is not triggered when the version tags in the repository change, so the
version that is compiled into the project is not always up-to-date. So I
was wondering if CMake offers the possibility to customize the
up-to-date check of the generate step, to make it automatically re-run
when the tags in the repository are changed?