Advertisement
Guest User

Cubiquity.Build.cs

a guest
Aug 8th, 2015
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.99 KB | None | 0 0
  1. // Copyright 2014 Volumes of Fun. All Rights Reserved.
  2.  
  3. using UnrealBuildTool;
  4. using System.IO;
  5.  
  6. public class Cubiquity : 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("C:/Users/HeadClot/Documents/Unreal Projects/Cubiquity/Plugin"); } //Edit this line to match where Cubiquity is installed
  16. }
  17.  
  18. private string ThirdPartyLibraryPath
  19. {
  20. get { return Path.Combine(ThirdPartyPath, "C:/Users/HeadClot/Documents/Unreal Projects/Cubiquity/Plugin/bin/CubiquityC.dll"); }
  21. }
  22.  
  23. private string ThirdPartyIncludePath
  24. {
  25. get { return Path.Combine(ThirdPartyPath, "C:/Users/HeadClot/Documents/Unreal Projects/Cubiquity/Plugin/include"); }
  26. }
  27.  
  28. public Cubiquity(TargetInfo Target)
  29. {
  30. MinFilesUsingPrecompiledHeaderOverride = 1;
  31. bFasterWithoutUnity = true;
  32. PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "RHI", "RenderCore", "ShaderCore" });
  33.  
  34. LoadCubiquity(Target);
  35. }
  36.  
  37. public bool LoadCubiquity(TargetInfo Target)
  38. {
  39. bool isLibrarySupported = false;
  40.  
  41. if((Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Win32))
  42. {
  43. isLibrarySupported = true;
  44.  
  45. string PlatformString = (Target.Platform == UnrealTargetPlatform.Win64) ? "Win64" : "Win32";
  46.  
  47. //string remotePath = @"http://www.volumesoffun.com/downloads/Cubiquity/Cubiquity-2015-06-14.zip";
  48. //System.IO.Compression.ZipFile.ExtractToDirectory(remotePath, extractPath);
  49.  
  50. //Copy the Cubiquity DLL into the binaries directory locally
  51. FileInfo file = new FileInfo(Path.Combine(ThirdPartyLibraryPath, "C:/Users/HeadClot/Documents/Unreal Projects/Cubiquity/Plugin/binaries/CubiquityC.dll")); // Remove if throws errors
  52. DirectoryInfo destDir = new DirectoryInfo(Path.Combine(ModulePath, "..", "..", "Binaries", PlatformString));
  53. destDir.Create();
  54. FileInfo destFile = new FileInfo(Path.Combine(destDir.ToString(), "CubiquityC.dll"));
  55. if (destFile.Exists)
  56. {
  57. if (file.LastWriteTime > destFile.LastWriteTime)
  58. {
  59. file.CopyTo(destFile.FullName, true);
  60. }
  61. }
  62. else
  63. {
  64. file.CopyTo(destFile.FullName, true);
  65. }
  66.  
  67. //Make sure we can link against the .lib file
  68. PublicAdditionalLibraries.Add(Path.Combine(ThirdPartyLibraryPath, "C:/Users/HeadClot/Documents/Unreal Projects/Cubiquity/Plugin/bin/CubiquityC.lib"));
  69. }
  70.  
  71. if(isLibrarySupported)
  72. {
  73. // Include path
  74. PublicIncludePaths.Add(ThirdPartyIncludePath);
  75. }
  76.  
  77. return isLibrarySupported;
  78. }
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement