// Copyright Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
using System.IO;
//方法为创建第三方库插件,CoustemOpenCV为插件名称
public class CoustemOpenCV : ModuleRules
{
public CoustemOpenCV(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
//ModuleDirectory = 创建插件生成的.Build.cs同级目录)
//添加include
PublicIncludePaths.AddRange(
new string[] {
Path.Combine(ModuleDirectory,"../ThirdParty/OpenCV_T/opencv/include")
}
);
//添加Lib路径及*.lib文件名
PublicAdditionalLibraries.AddRange(
new string[] {
Path.Combine(ModuleDirectory,"../ThirdParty/OpenCV_T/opencv/x64/vc15/lib","opencv_world3410.lib"),
}
);
//手动拷贝dll到项目Plugins\插件名称\Binaries\Win64内
//可选是否添加if内容,添加后可省略手动拷贝dll的步骤
if (Target.Platform == UnrealTargetPlatform.Win64)
{
string DLLPath = Path.Combine(ModuleDirectory, "ThirdParty/OpenCV_T/opencv/x64/vc15/bin", "opencv_world3410.dll");
RuntimeDependencies.Add(DLLPath);
// 确保在运行时复制 DLL 文件
string ProjectBinariesDir = Path.Combine(Target.RelativeEnginePath, "Binaries", Target.Platform.ToString());
RuntimeDependencies.Add(Path.Combine(ProjectBinariesDir, "opencv_world3410.dll"), StagedFileType.NonUFS);
}
PrivateIncludePaths.AddRange(
new string[] {
// ... add other private include paths required here ...
}
);
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
"CoustemOpenCVLibrary",
"Projects"
// ... add other public dependencies that you statically link with here ...
}
);
PrivateDependencyModuleNames.AddRange(
new string[]
{
// ... add private dependencies that you statically link with here ...
}
);