How to build lighting form C++ or BP?

I have a huge open world setup for which I would like to build the light information for selected levels only in a batch during night time. I want to be able to perform some pre-build operation like setting up the directional and skylight information depending on the level setting.
I was wondering if I can do that from a BP or more likely a C++ program. I did some snooping around but wasn’t able to figure out how to do it.
Can anybody point me in the right direction?

You can build lighting like this from C++:

FEditorBuildUtils::EditorBuild(GWorld, FBuildOptions::BuildLighting, false);

Must probably be called in an Editor Module.