Guest User

Untitled

a guest
May 28th, 2016
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. // Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
  2.  
  3. using UnrealBuildTool;
  4. using System.IO;
  5.  
  6. public class TestPLC : ModuleRules
  7. {
  8. private string ModulePath
  9. {
  10. get { return Path.GetDirectoryName(RulesCompiler.GetModuleFilename(this.GetType().Name)); }
  11. }
  12.  
  13. private string ThirdPartyPath
  14. {
  15. get { return Path.GetFullPath(Path.Combine(ModulePath, "../../ThirdParty/")); }
  16. }
  17.  
  18. public bool LoadSnap7(TargetInfo Target)
  19. {
  20. bool isLibrarySupported = false;
  21.  
  22. if ((Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Win32))
  23. {
  24. isLibrarySupported = true;
  25.  
  26. string PlatformString = (Target.Platform == UnrealTargetPlatform.Win64) ? "x64" : "x86";
  27. string LibrariesPath = Path.Combine(ThirdPartyPath, "Snap7", "Libraries");
  28.  
  29. //PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "Snap7." + PlatformString + ".lib"));
  30. PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "Snap7.lib"));
  31. }
  32.  
  33. if (isLibrarySupported)
  34. {
  35. // Include path
  36. PublicIncludePaths.Add(Path.Combine(ThirdPartyPath, "Snap7", "Includes"));
  37. }
  38.  
  39. Definitions.Add(string.Format("WITH_SNAP7_BINDING={0}", isLibrarySupported ? 1 : 0));
  40.  
  41. return isLibrarySupported;
  42. }
  43.  
  44. public TestPLC(TargetInfo Target)
  45. {
  46.  
  47. PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });
  48.  
  49. LoadSnap7(Target);
  50. }
  51. }
Add Comment
Please, Sign In to add comment