C++ class documentation via gdextension using cmake

Godot Version

4.4.1

Question

I have failed to find a proper way to register a class documentation via gdextension using cmake. I saw that documentation here but it refers scons. I use cmake so that’s not ideal.
My solution was actually to create a utility class that will call

internal::gdextension_interface_editor_help_load_xml_from_utf8_chars_and_len

Initially I thought just placing the call for the class inside module entry point, which worked. However, I had to hard code my path to the library folder, so if someone change the library name, the doc xml will not be found within. I was not able to find a proper way that will provide me library path.
So instead I added a plugin as part of my gdextension that will run a script on editor mode. the script is located in the library folder, the retrieving the script resource path will be correct everytime. Now I was able to call my utility class that will register the documentaion.

This is big workaround for something that I would expect be basic in gdextension, I I’m pretty sure I am missing something.

Anyone encountered something similar?

have a read of the godot-cpp-template cmake file
Here is the beginning of the section for adding documentation

1 Like

Thanks! I totally missed that!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.