And these comments eventually end up in the CMake Documentation (ex. FindPython). This is similar to how Doxygen parses C/C++ comments. Since I didn’t see that Sphinx Documentation has built-in support for this kind of parsing, I’m guessing that CMake has implemented its own mechanism to parse these types of comments? If so, how?
We implement a Sphinx extension module that adds a cmake-module directive. The directive is used by each Help/module/*.rst file to parse documentation blocks out of a .cmake file.
That’s a pretty handy Sphinx extension. Should admirers just borrow the script in accordance with its BSD 3-Clause License, or is it available in some packaged form (with associated package update semantics)?
#[[[
# This function has very basic documentation.
#
# This function's description stays close to idealized formatting and does not
# do anything fancy.
#
# :param person: The person this function says hi to
# :type person: string
#]]
function(say_hi_to person)
message("Hi ${person}")
endfunction()