A question about unreal build system: how to add new header search path? (Mac ver)

Hi friends:
I’m trying to use opencv in unreal xcode project, before that I’ve successfully installed opencv and make it operational under a simple xcode c++ console project
But in unreal xcode project, it always said:


my xcode project is generated by Unreal Editor, so the config panel looks like this:

As you can see I’ve fill the HEADER_SEARCH_PATHS with value: /usr/local/include, with is the position of opencv’s headers. However, the build system still cannot find my opencv headers, I even add /usr/local/include into the USER_HEADER_SEARCH_PATHS and turn on ALWAYS_SEARCH_USER_PATHS, the same problem still occurs.
I think the way to config a xcode project generated by unreal editor is quite different from configuring a typicall C++ xcode project since it uses its own build script, so can someone tell how to let the unreal build system know I’ve added a new header_search_path and recognize my new added headers?

Thanks

.

1 Like

Unreal projects are built with UnrealBuildTool, which manages all the dependencies. Each module has an xxx.build.cs file which lives in the Source folder. These are written in C# so be careful modifying them. To add an include path you need to modify the PrivateIncludePaths collection like this:



PrivateIncludePaths.Add(Path.Combine("ScriptPlugin", "lua-5.2.3", "src"));


Look in Programs > UnrealBuildTool > System > RulesCompiler.cs for the complete list of settings you can modify.

Is this still true? I added “/usr/local/include” to my Build.cs file:

PrivateIncludePaths.AddRange(

new string] {

“MyPlugin/Private”,

            "/usr/local/include",

// … add other private include paths required here …

}

);

But still, it didnt help.

Any idea?