x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How to include private header files of other Modules into my Module?

Hi,

I try to create a Plugin with an editor module for a component Visualizer. I have trouble in understanding and setting up the MyToolEditor.Build.cs I want to extent an already existing Component Visualizer but this Visualizer is declared in the private Folder of the ComponentVisualizers Module.

My Question is, how could I access this?
How can I include private header files of other Modules?

I tried something like this, but with no luck

 PrivateIncludePaths.AddRange(
     new string[] {
         "MyToolEditor/Private", 
         "Editor/ComponentVisualizers/Private"
     }
 );
Product Version: UE 4.7
Tags:
more ▼

asked Jul 16 '15 at 05:26 AM in C++ Programming

avatar image

Stane
58 3 8 7

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

I've tried to do that in many ways without success, but finally nailed it!

This works for engine modules:

 using System.IO; // Note this import, it's needed below
 
 namespace UnrealBuildTool.Rules
 {
     public class Foo : ModuleRules
     {
         public Foo(TargetInfo Target)
         {
             // ...
             // Get the engine path. Ends with "Engine/"
             string engine_path = Path.GetFullPath(BuildConfiguration.RelativeEnginePath);
             // Now get the base of UE4's modules dir (could also be Developer, Editor, ThirdParty)
             string srcrt_path = engine_path + "Source/Runtime/";
     
             // now you can include the module's private paths!
             // as an example, you can expose UE4's abstraction of D3D11, located in Source/Runtime/Windows/D3D11RHI
             PublicIncludePaths.Add(srcrt_path + "Windows/D3D11RHI/Private");
             PublicIncludePaths.Add(srcrt_path + "Windows/D3D11RHI/Private/Windows");
         }
     }
 }
 

more ▼

answered Oct 08 '15 at 06:21 PM

avatar image

jppm
120 8 93 21

avatar image ndeakin Nov 11 '15 at 03:02 AM

Thanks for posting your solution! Helped me solve the same issue today!

avatar image grisevg Mar 24 '16 at 05:48 PM

You rock! Thanks!

avatar image StealthOne Aug 09 '16 at 11:53 PM

This was helpful! Thanks!

avatar image Antonio41508 Feb 18 '17 at 09:55 AM

Where I have to write this?

avatar image rjohannessen Jun 15 '18 at 04:54 PM

Your *.Build.cs file for the project.

avatar image Phyronnaz Sep 24 '17 at 12:47 AM

Thanks! :)

avatar image hausfrau87 Mar 13 '18 at 02:06 PM

since 4.18:

string engine_path = Path.GetFullPath(Target.RelativeEnginePath);

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question