How to check in *.Build.cs if a module exists?

Hi all,

Is there a way to check in a Build.cs file if a module exists?

Basically I want to add a module and set a preprocessor flag if the module exists.

The pseudo-code would be something like this:

if(ModuleExists("ModuleName")) // <-- is there a function similar to "ModuleExists" ?
{
        PublicDependencyModuleNames.AddRange(new string[]{"ModuleName"});
        Definitions.Add("WITH_MODULENAME=1");
}

Thanks!

I want it too…Have you figured it out?

I need this too. Were you able to figure out?

I need this too. Were you able to figure out?

There is the method GetModuleDirectory which will return you the module directory path as a string if it exists, or an empty string if it does not exists.