I’d like to use a couple of third-party libraries in my C++ code. I would prefer to not have to add the code into my Source\Private folder because, well, that just seems… hacky.
The problem, of course, is that the .sln is generated and so I can’t specify an include directory inside it. Is there something I can specify that, when the .sln is being generated, it adds include directories that I specify?
Of course, you can put the files wherever you want, so you’ll need to customize the relative path above.
The more complicated (but cleaner) way is to create a new ThirdPartyLib.Build.cs file in the /Engine/Source/ThirdParty/ThirdPartyLib/ folder, and to set that module type to “External”. After configuring it similar to other engine third party libraries, you can simply change your module to depend upon that module using the normal syntax:
AddThirdPartyPrivateStaticDependencies( new string[] { "ThirdPartyLib" } );
I don’t think I have a choice in the matter though about how to do this - I have to go with the YourModule.Build.cs option. As I understand it, the “Engine” folder lives inside %PROGRAMFILES%\Rocket and I’m not the only person working on this project. Editing files there just isn’t a good solution for me - even if it’s cleaner. Or is there a way to generate/use a subfolder of my project named “Engine” that I can keep under source control?
Sorry, I should have prefaced with that – yes, you don’t want to modify the engine folder. However, you should be able to put the headers in a path relative to your game project.
It is also possible to use your project’s Source folder, right? I mean, instead of /Engine/Source/ThirdParty, use /YourProject/Source/ThirdParty, and add a folder with a [modulename].build.cs, headers, libs etc.