Drop #end and #module. Convert #section to a subsection header. Convert #variable to the cmake domain "variable" directive. Convert #macro to the cmake domain "command" directive. Perform minor formatting fixes in text near these changes.
Run the convert-help.bash script to convert documentation: ./convert-help.bash "/path/to/CMake-build/bin" Then remove it.