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 do I get the UE4 source path in my plugin build config?

How do I get the source path in the build config? I'm trying to add some private paths to the include paths as per some of the samples, but without using relative paths ("../../this/kinda/nonsense").

It's similar to this question: https://answers.unrealengine.com/questions/237166/how-can-i-get-the-current-project-path-within-the.html

Product Version: UE 4.8
more ▼

asked Jul 14 '15 at 01:49 AM in C++ Programming

avatar image

190 11 16 31

avatar image Antidamage Jul 30 '15 at 10:44 PM

Keen on knowing this as well. I see a method called "UEBuildConfiguration.UEThirdPartySourceDirectory", what's the equivalent for the project directory?

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

1 answer: sort voted first

I think you may be looking for


or possibly

more ▼

answered Feb 27 '16 at 01:10 PM

avatar image

6 1 3

avatar image EthanCS Jul 05 '17 at 06:54 AM

Good answer, and by the way, if you want get the string, use string EnginePath = UnrealBuildTool.UnrealBuildTool.EngineSourceDirectory.FullName;

avatar image joey.pla Jul 12 '17 at 07:20 PM

This no longer works in 4.16. Is there a new solution to getting the EngineDirectory?

avatar image FilAl Oct 18 '17 at 08:07 PM

I would so much like to know this too. Also working in 4.16

avatar image Quiqueck Oct 19 '17 at 09:47 AM

I think this should work:

 using System;
 using System.IO;
 using UnrealBuildTool;
 namespace UnrealBuildTool.Rules
     public class NativeLibPlugin : ModuleRules
         private string ModulePath {
             get { return ModuleDirectory; }
         private string EnginePath {
             get { return Path.GetFullPath(BuildConfiguration.RelativeEnginePath); }
         private string ThirdPartyPath {
             get { return Path.GetFullPath( Path.Combine( ModulePath, "..", "..", "ThirdParty" ) ); }
         public NativeLibPlugin(TargetInfo Target) {
 /* ... */
(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