Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
- using System.IO;
- using UnrealBuildTool;
- public class Kinect2 : ModuleRules
- {
- public Kinect2(TargetInfo Target)
- {
- Type = ModuleType.External;
- PublicIncludePaths.AddRange(
- new string[] {
- "Kinect2/Public",
- "Kinect2/Classes"
- // ... add public include paths required here ...
- }
- );
- PrivateIncludePaths.AddRange(
- new string[] {
- "Kinect2/Private",
- "Kinect2/Public"
- // ... add other private include paths required here ...
- }
- );
- PublicDependencyModuleNames.AddRange(
- new string[]
- {
- "Core",
- "CoreUObject",
- "Engine",
- "Slate",
- "InputDevice",
- "InputCore",
- "Kinect2"
- // ... add other public dependencies that you statically link with here ...
- }
- );
- PrivateDependencyModuleNames.AddRange(
- new string[]
- {
- "Core",
- "CoreUObject",
- "Engine"
- // ... add private dependencies that you statically link with here ...
- }
- );
- DynamicallyLoadedModuleNames.AddRange(
- new string[]
- {
- "Kinect2"
- // ... add any modules that your module loads dynamically here ...
- }
- );
- LoadLibrary(Target);
- }
- public bool LoadLibrary(TargetInfo Target)
- {
- Type = ModuleType.External;
- bool isLibrarySupported = false;
- string ModulePath = Path.GetDirectoryName(RulesCompiler.GetModuleFilename(this.GetType().Name));
- string LibraryPath = Path.Combine(ModulePath, "ThirdParty", "KinectLib");
- string ArchitecturePath = "";
- if (Target.Platform == UnrealTargetPlatform.Win64 &&
- WindowsPlatform.Compiler == WindowsCompiler.VisualStudio2013)
- {
- ArchitecturePath = "amd64";
- isLibrarySupported = true;
- }
- else if (Target.Platform == UnrealTargetPlatform.Win32 &&
- WindowsPlatform.Compiler == WindowsCompiler.VisualStudio2013)
- {
- ArchitecturePath = "x86";
- isLibrarySupported = true;
- }
- if (isLibrarySupported==true)
- {
- // Add the architecture spacific path to the library files
- PublicAdditionalLibraries.Add(Path.Combine(LibraryPath, "lib", ArchitecturePath, "Kinect10.lib"));
- // Add a more generic path to the include header files
- PublicIncludePaths.Add(Path.Combine(LibraryPath, "inc"));
- PublicDelayLoadDLLs.AddRange(new string[] { LibraryPath + "lib" + ArchitecturePath +"Microsoft.Kinect.dll" });
- }
- Definitions.Add(string.Format("WITH_KINECT10_LIB_BINDING={0}", isLibrarySupported ? 1 : 0));
- return isLibrarySupported;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement