Commit 607b39dc authored by Brad King's avatar Brad King
Browse files

Utilities/Sphinx: Fix link targets for mixed-case command names

When a CMake domain 'command' object is defined by CMakeTransform or the
'cmake:command' directive, generate the link target with a lower-case
name even if the command name is not all lower-case.  This is needed to
make cross-references to the command definition work since the
'cmake:command' role is marked with the 'lowercase' property.
parent 5cda2205
......@@ -201,7 +201,11 @@ class CMakeTransform(Transform):
if make_index_entry:
title = self.parse_title(env.docname)
# Insert the object link target.
targetid = '%s:%s' % (objtype, title)
if objtype == 'command':
targetname = title.lower()
targetname = title
targetid = '%s:%s' % (objtype, targetname)
targetnode ='', '', ids=[targetid])
self.document.insert(0, targetnode)
......@@ -220,7 +224,11 @@ class CMakeObject(ObjectDescription):
return sig
def add_target_and_index(self, name, sig, signode):
targetid = '%s:%s' % (self.objtype, name)
if self.objtype == 'command':
targetname = name.lower()
targetname = name
targetid = '%s:%s' % (self.objtype, targetname)
if targetid not in self.state.document.ids:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment