Skip to content

Utilities/Sphinx: Add role and directive for 'envvar' in CMake domain

Brad King requested to merge brad.king/cmake:doc-xref-envvar into master

This enables cross-reference syntax for CMake environment variables:

:envvar:`SOMEVAR`

and definition of CMake environment variables via a directive:

.. envvar:: SOMEVAR

It also adds environment variables defined by the directive and by Help/envvar/SOMEVAR.rst documents to the index.

This envvar role and directive is defined in our cmake domain and overrides the equivalent envvar role and directive provided by Sphinx in its default domain. This is okay because we build CMake documents in the cmakd domain.

This follows up the work from !1235 (merged) that originally added envvar documentation.

Merge request reports