I have met this problem too. That’s my solution.
-
Open CMakefileGenerator.cs
-
Goto function WriteCMakeLists(). Just search the key words “foreach (FileReference CurModuleFile in AllModuleFiles)”
-
Add these code before the end of this code block
if (CurModuleFile.IsUnderDirectory(DirectoryReference.Combine(OnlyGameProject.Directory, “Source”)))
{
var FileName = CurModuleFile.GetFileName();
var ModuleName = FileName.Substring(0, FileName.LastIndexOf(“.Build.cs”));
var IncPath = DirectoryReference.Combine(OnlyGameProject.Directory, “Intermediate”, “Build”, “Win64”, “UE4Editor”, “Inc”, ModuleName);
IncludeDirectories.Add(IncPath.FullName);
}
These code will write directories which include *.generate.h into cmake-includes.cmake file. And my platform is Win64. You can modify the path codes on Linux.