CMake code for building gzipped & ungzipped manuals

Colleagues, tell me, please, are there ready-made modules for building gzipped and non-gzipped manual pages from source codes?

I have this situation - I write manual pages on markdown and compile them using the lowdown utility. In other words, my source files look like, and the results look like prog1.3 or prog1.3.gz. There are several such directories, for manual pages in different languages - man_EN, man_DE, man_FR. There is also a GZIPPED_MANS variable located in the root CMakeLists.txt file, which, if set to ON, indicates that the manual pages need to be archived with gzip.

How do I modify the list of files to be deleted in case of a clean target? Maybe there is ready-made code for such a task as building manual pages?

Thanks in advance for your reply,

I’m not aware of any, but I’m sure someone has written them. Though ISTR that gzip was something that rpm (and the like) did, but maybe I’m misremembering.