Files
UnrealEngineUWP/Engine/Source/Programs/Enterprise/Datasmith/DatasmithMaxExporter/DatasmithMax2017.Build.cs
Marc Audy 0c3be2b6ad Merge Release-Engine-Staging to Test @ CL# 18240298
[CL 18241953 by Marc Audy in ue5-release-engine-test branch]
2021-11-18 14:37:34 -05:00

92 lines
2.7 KiB
C#

// Copyright Epic Games, Inc. All Rights Reserved.
using System.IO;
namespace UnrealBuildTool.Rules
{
public abstract class DatasmithMaxBase : ModuleRules
{
public DatasmithMaxBase(ReadOnlyTargetRules Target)
: base(Target)
{
bUseRTTI = true;
PublicDefinitions.Add("NEW_DIRECTLINK_PLUGIN=1");
PrivateDependencyModuleNames.AddRange(
new string[]
{
"DatasmithExporter",
"DatasmithExporterUI",
"UdpMessaging", // required for DirectLink networking
"UEOpenExr",
}
);
PrivateIncludePaths.AddRange( new string[] { "Runtime/Launch/Public", "Runtime/Launch/Private", ModuleDirectory } );
// Max SDK setup
{
string MaxVersionString = GetMaxVersion();
string MaxSDKLocation = "";
// Try with build machine setup
string SDKRootEnvVar = System.Environment.GetEnvironmentVariable("UE_SDKS_ROOT");
if (SDKRootEnvVar != null && SDKRootEnvVar != "")
{
MaxSDKLocation = Path.Combine(SDKRootEnvVar, "HostWin64", "Win64", "3dsMax", MaxVersionString);
}
if (!Directory.Exists(MaxSDKLocation))
{
// Try with custom setup
string MaxSDKEnvVar = System.Environment.GetEnvironmentVariable("ADSK_3DSMAX_SDK_" + MaxVersionString);
if (MaxSDKEnvVar != null && MaxSDKEnvVar != "")
{
MaxSDKLocation = MaxSDKEnvVar;
}
}
// Make sure this version of Max is actually installed
if (Directory.Exists(MaxSDKLocation))
{
PrivateIncludePaths.Add(Path.Combine(MaxSDKLocation, "include"));
string LibraryPaths = Path.Combine(MaxSDKLocation, "lib", "x64", "Release");
PublicAdditionalLibraries.Add(Path.Combine(LibraryPaths, "assetmanagement.lib"));
PublicAdditionalLibraries.Add(Path.Combine(LibraryPaths, "bmm.lib"));
PublicAdditionalLibraries.Add(Path.Combine(LibraryPaths, "core.lib"));
PublicAdditionalLibraries.Add(Path.Combine(LibraryPaths, "geom.lib"));
PublicAdditionalLibraries.Add(Path.Combine(LibraryPaths, "maxutil.lib"));
PublicAdditionalLibraries.Add(Path.Combine(LibraryPaths, "Maxscrpt.lib"));
PublicAdditionalLibraries.Add(Path.Combine(LibraryPaths, "mesh.lib"));
}
}
// Itoo ForestPack/RailClone API
string ItooInterfaceLocation = Path.Combine(ModuleDirectory, "ThirdParty", "Itoo");
bool bWithItooInterface = Directory.Exists(ItooInterfaceLocation);
PublicDefinitions.Add("WITH_ITOO_INTERFACE=" + (bWithItooInterface ? "1" : "0"));
if (bWithItooInterface)
{
PrivateIncludePaths.Add(ItooInterfaceLocation);
}
}
public abstract string GetMaxVersion();
}
[SupportedPlatforms("Win64")]
public class DatasmithMax2017 : DatasmithMaxBase
{
public DatasmithMax2017(ReadOnlyTargetRules Target)
: base(Target)
{
}
public override string GetMaxVersion() { return "2017"; }
}
}