You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#jira UE-151885 #rb none #fyi matt.johnson #preflight 627ea9a71748fbc85bc32411 [CL 20190397 by JeanLuc Corenthin in ue5-main branch]
107 lines
3.0 KiB
C#
107 lines
3.0 KiB
C#
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
using System.IO;
|
|
using UnrealBuildTool;
|
|
|
|
public class MaterialX : ModuleRules
|
|
{
|
|
public MaterialX(ReadOnlyTargetRules Target) : base(Target)
|
|
{
|
|
Type = ModuleType.External;
|
|
|
|
bool bDebug = (Target.Configuration == UnrealTargetConfiguration.Debug && Target.bDebugBuildsActuallyUseDebugCRT);
|
|
|
|
string DeploymentDirectory = Path.Combine(ModuleDirectory, "Deploy", "MaterialX-1.38.1");
|
|
|
|
PublicIncludePaths.Add(Path.Combine(DeploymentDirectory, "include"));
|
|
|
|
string[] MaterialXLibraries = {
|
|
"MaterialXCore",
|
|
"MaterialXFormat",
|
|
"MaterialXGenGlsl",
|
|
"MaterialXGenMdl",
|
|
"MaterialXGenOsl",
|
|
"MaterialXGenShader",
|
|
"MaterialXRender",
|
|
"MaterialXRenderGlsl",
|
|
"MaterialXRenderHw",
|
|
"MaterialXRenderOsl"
|
|
};
|
|
|
|
string LibPostfix = bDebug ? "_d" : "";
|
|
|
|
if (Target.IsInPlatformGroup(UnrealPlatformGroup.Windows))
|
|
{
|
|
string LibDirectory = Path.Combine(
|
|
DeploymentDirectory,
|
|
"VS" + Target.WindowsPlatform.GetVisualStudioCompilerVersionName(),
|
|
Target.WindowsPlatform.GetArchitectureSubpath(),
|
|
"lib");
|
|
|
|
foreach (string MaterialXLibrary in MaterialXLibraries)
|
|
{
|
|
string StaticLibName = MaterialXLibrary + LibPostfix + ".lib";
|
|
PublicAdditionalLibraries.Add(
|
|
Path.Combine(LibDirectory, StaticLibName));
|
|
}
|
|
}
|
|
else if (Target.Platform == UnrealTargetPlatform.Mac)
|
|
{
|
|
string LibDirectory = Path.Combine(
|
|
DeploymentDirectory,
|
|
"Mac",
|
|
"lib");
|
|
|
|
foreach (string MaterialXLibrary in MaterialXLibraries)
|
|
{
|
|
string StaticLibName = "lib" + MaterialXLibrary + LibPostfix + ".a";
|
|
PublicAdditionalLibraries.Add(
|
|
Path.Combine(LibDirectory, StaticLibName));
|
|
}
|
|
}
|
|
else if (Target.IsInPlatformGroup(UnrealPlatformGroup.Unix))
|
|
{
|
|
// TODO: MaterialX needs to be built specifically for arm64 before
|
|
// we can support it here.
|
|
if (Target.Platform == UnrealTargetPlatform.LinuxArm64)
|
|
{
|
|
return;
|
|
}
|
|
|
|
// Note that since we no longer support OpenGL on
|
|
// Linux, we do not build the MaterialXRender
|
|
// libraries, since MaterialX does not offer a way to
|
|
// disable only MaterialXRenderGlsl, which requires
|
|
// linking against OpenGL.
|
|
MaterialXLibraries = new string[] {
|
|
"MaterialXCore",
|
|
"MaterialXFormat",
|
|
"MaterialXGenGlsl",
|
|
"MaterialXGenMdl",
|
|
"MaterialXGenOsl",
|
|
"MaterialXGenShader"
|
|
};
|
|
|
|
string LibDirectory = Path.Combine(
|
|
DeploymentDirectory,
|
|
"Unix",
|
|
Target.Architecture,
|
|
"lib");
|
|
|
|
foreach (string MaterialXLibrary in MaterialXLibraries)
|
|
{
|
|
string StaticLibName = "lib" + MaterialXLibrary + LibPostfix + ".a";
|
|
PublicAdditionalLibraries.Add(
|
|
Path.Combine(LibDirectory, StaticLibName));
|
|
}
|
|
}
|
|
|
|
// Install the MaterialX standard data libraries.
|
|
// TODO: Verify content of libraries folder is actually needed at runtime.
|
|
//RuntimeDependencies.Add(
|
|
// Path.Combine(Target.UEThirdPartyBinariesDirectory, "MaterialX", "libraries"),
|
|
// Path.Combine(DeploymentDirectory, "libraries", "...")
|
|
//);
|
|
}
|
|
}
|