With this patch, python modules made in C can be built together with Blender.
For this, the addon author should follow some small steps:
- Add a file with the source code and a CMakeLists.txt containing the macro: blender_add_python_module(name local_dir sources includes includes_sys)
- Add a line with add_subdirectory(source_dir) to the CMakeLists.txt which is located in script/addons or script/addons_contrib directory.
It is important to note that the file with the CMakeLists.txt from the addon will be ignored in the installation. Then you should not mix the codes in *.c | *.cpp | *.h with other addon codes in same file.
The final module will be located in the parent directory of the CMakeLists.txt plus the local_dir of macro.
Example: