Our C-core SDK can be used together with Unreal Engine. It's not a fully functional plugin yet, but can easily be integrated into your project as a Unreal Engine Module.
-
Clone this repository to the
<UnrealProject>/Source/
directory. We recommend that you place it inside theThirdParty
folder (create it, if necessary). -
Compile the desired option of the SDK. You can do it in the SDK directory like so:
cmake . && make
C-core offers some customization flags (e.g. shared library or using openssl). You can configure that as follow:
cmake . -DSHARED=ON -DOPENSSL=ON -DOPENSSL_ROOT_DIR={unreal engine location}/Engine/Source/ThirdParty/openssl/1.1.1x/ -DCUSTOM_OPENSSL_LIB_DIR=lib/XXX/ -DCUSTOM_OPENSSL_INCLUDE_DIR=include/XXX/
where x is UE's version and XXX is your desired architecture.
- Adjust
PubNubModule/PubNubModule.Build.cs
with selected options by changingOpenSsl
,StaticLink
andBuildLocation
with the same values you used for compilation.
For example:
private bool OpenSsl = true;
private bool StaticLink = false;
private string BuildLocation = "build/";
- Finally, import the module into your project as follows:
-
<UnrealProject>.Target.cs
and<UnrealProject>Editor.Target.cs
public class <UnrealProject>[Editor]Target : TargetRules { public <UnrealProject>[Editor]Target (TargetInfo Target) : base(Target) { //... ExtraModuleNames.Add("PubNubModule"); } }
-
<UnrealProject>.uproject
{ //... "Modules": [ //... { "Name": "PubNubModule", "Type": "Runtime", "LoadingPhase": "Default" } ], //... }
Generate the project files using your IDE of choice and you are ready to go!
- Make PubNub discoverable in the module you want to use PubNub in by modifying the
<Module>.Build.cs
file:
public class <Module> : ModuleRules
{
public <Module>(ReadOnlyTargetRules Target) : base(Target)
{
//...
PrivateDependencyModuleNames.Add("PubNubModule");
}
}
- Import the
PubNub.h
header into your files as follows:
#include "PubNub.h"
Note that you don't have to wrap it with
THIRD_PARTY_INCLUDES_START
andTHIRD_PARTY_INCLUDES_END
because we've done that for you.
Good luck with your project!