Fine for me whatever is considered better.
For the records, I saw that there could be target events, like POST_BUILD, but I am not sure if it can be useful here:
- https://cmake.org/cmake/help/latest/command/add_custom_command.html#build-ev...
The readme generation has to be standalone, it must not generate the other doc formats. It is used on server to generate the readme (then push to git) after a developer pushes changes to module's xml doc files.