diff options
Diffstat (limited to 'Utilities/Sphinx/cmake.py')
-rw-r--r-- | Utilities/Sphinx/cmake.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Utilities/Sphinx/cmake.py b/Utilities/Sphinx/cmake.py index 1955e42..336c74a 100644 --- a/Utilities/Sphinx/cmake.py +++ b/Utilities/Sphinx/cmake.py @@ -12,6 +12,16 @@ import os import re +# Monkey patch for pygments reporting an error when generator expressions are +# used. +# https://bitbucket.org/birkenfeld/pygments-main/issue/942/cmake-generator-expressions-not-handled +from pygments.lexers import CMakeLexer +from pygments.token import Name, Operator +from pygments.lexer import bygroups +CMakeLexer.tokens["args"].append(('(\\$<)(.+?)(>)', + bygroups(Operator, Name.Variable, Operator))) + + from docutils.parsers.rst import Directive, directives from docutils.transforms import Transform try: |