How can I add a ThirdParty library so that it compiles when I compile my game?

I want to implement an existing library in my game. However, the tricky part is I also want to compile it when I compile my game. This way I can modify the source from a single instance of Visual Studio.

I tried the module approach, but I just have to modify too much of the core library files before it even compiles. I’ve been snooping inside the ThirdParty library of the engine and found batch files for (for example) libPNG ((UE4_BuildThirdPartyLib), which will compile the library as the engine gets compiled (AutomationScripts are run during Visual Studio compile. right?)

Is there something similar, or a different approach, for me to add my existing library to the build-process of my game, without having to first compile .lib files, make them into a plugin?

Did you see this ? UE3 Wiki - Linking Static Libraries Using The Build System ?

I followed that, digged a bit into my Build.cs and found it worked really well.

If afterwards you still have issues , please specify which part and I’ll try to help.
There is also already a ton of similar questions in this AnswerHub , i.e. here

I ended up creating a separate project which compiles and places the libs in the appropriate places, then defined a Build.cs file with Type set to External.

I then modified my includepaths of my game project and pointed it at the source directory of the library. You can now debug the library and step through the code. Only recompilation has to be done using the other project.

Is it possible to share what project settings were for your external library ? I can’t seem to link a debug library with my UE4 code even when I compile it in DebugGame mode. It only seems to accept a Release version of my external library for linking. This prevents me from stepping through the code of the external library…

This person isn’t asking about linking static libraries but including the source code so they can be built.

Was this to get unreal to cross compile to all platforms?