// 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同级目录)//添加includePublicIncludePaths.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(n