프로젝트를 만들다보면 외부 라이브러리를 사용할 때가 있다.
원하는 모듈의 .build.cs 파일을 다음과 같이 수정한다.
using System;
using System.IO;
using UnrealBuildTool;
public class MyThirdPartyLibrary : ModuleRules
{
public MyThirdPartyLibrary(ReadOnlyTargetRules Target) : base(Target)
{
Type = ModuleType.External;
// 해당 모듈에서 외부 라이브러리를 사용한다고 설정.
PublicDefinitions.Add("WITH_MYTHIRDPARTYLIBRARY=1");
// 사용할 외부 라이브러리의 .h .lib을 모아놓은 디렉터리 경로
string thirdPartyPath = Path.Combine(ModuleDirectory, "../../ThirdParty");
// Include 할 해더 경로 추가.
PublicIncludePaths.AddRange(
new string[]
{
Path.Combine(thirdPartyPath, "include"),
});
// Static 라이브러리 경로 추가.
PublicAdditionalLibraries.AddRange(
new string[]
{
Path.Combine(thirdPartyPath, "amd64", "release", "lib", "thirdParty.lib"),
});
// Dynamic 라이브러리 경로 추가. dll 경로는 위의 thirdPartyPath에 넣어도 인식되지 않음.
// 아래와 같이 모듈 바이너리 폴더에 넣어야 한다.
RuntimeDependencies.Add("$(PluginDir)/Binaries/Win64/thirdParty.dll");
}
}
끝.
'UnrealEngine' 카테고리의 다른 글
[UE] 파일 관리 시스템 (0) | 2023.08.14 |
---|---|
[UE] 포커스가 없을 때, 소리 재생 (0) | 2023.08.05 |
UnrealEngine FSocket 통신 (0) | 2023.07.28 |
UnrealEngine Thread 만들기 (0) | 2023.07.15 |
[UE4] 픽셀 스트리밍 ver_4.27(with. Android Build) (0) | 2023.07.08 |
댓글