aboutsummaryrefslogtreecommitdiff
path: root/vrayPlug/mkwin.bat
blob: dd5bc72a2c92a6654f7bfb7fb1c0391c621dc046 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
@echo off

rem  Shave and a Haircut
rem  (c) 2019 Epic Games
rem  US Patent 6720962

rem  Build all of the V-Ray plugins and shaders for a given version of Maya
rem
if "%~2"=="" (
    echo Usage: %0 mayaVersion compactMayaVersion
    exit /b 1
)

if not defined SHAVE_VRAY_SDKS (
    echo SHAVE_VRAY_SDKS not defined. Shave will be built without V-Ray support.
    exit /b 2
)

setlocal
set mayaVersion=%1
set compactMayaVersion=%2

rem  The libraries in V-Ray's 'vc14' directories are actually for Visual C++
rem  14.1, which is Visual Studio 2017. That means that for Maya 2018 we need
rem  to build the V-Ray plugins, shaders and exporters using a different
rem  version of Visual Studio from the rest of Shave.
rem
rem  To support this, we have a 'getVrayVSVersion' script which sets the
rem  'vrayVSVersion' envariable to the version of Visual Studio used by V-Ray
rem  for the given version of Maya.
rem
call ..\utils\getVrayVSVersion %mayaVersion%

rem  Clean out old builds.
rem
del /q bin\win64\*.*

rem  Build V-Ray plugins for all the ranges of V-Ray versions supported by this
rem  version of Maya.
rem
set hasSupport=n
for /f "tokens=1,2 delims=: " %%i in ('findstr /r "^%mayaVersion%:" supportedVrayVersions.txt') do call :buildOneVersion %%j
if errorlevel 1 exit /b %errorlevel%

if %hasSupport%==n (
    echo No supported versions of V-Ray found for Maya %mayaVersion%.
    exit /b 1
)

exit /b


rem -------------------------------------------------------------------------

rem  The argument is the V-Ray version string for the start of the range of
rem  range of versions of V-Ray which can all work with the same
rem  Maya plugin and V-Ray shader.
rem
rem  This subroutine builds the corresponding plugin and shader.
rem
:buildOneVersion
set vrayVersion=%1

if "%vrayVersion:~0,3%"=="3.6" (
    set versionTag=36
) else if "%vrayVersion:~0,2%"=="4." (
    set versionTag=40
) else (
    echo V-Ray version %vrayVersion% not supported. 'mkwin.bat' and 'supportedVrayVersions.txt' are out of synch.
    exit /b 1
)

set hasSupport=y

call ..\utils\vcbuild . plugin\shaveVray ReleaseVRay%versionTag% %vrayVSVersion% plugin\shaveVray 64
if errorlevel 1 exit /b 3

call ..\utils\vcbuild . plugin\shaveVraySh ReleaseVray%versionTag% %vrayVSVersion% plugin\shaveVraySh 64
if errorlevel 1 exit /b %errorlevel%

rem  The exporter is located in the mayaPlug directory, but it's vray-version
rem  specific so we build it here.
rem
pushd ..\mayaPlug\shaveVrayExporter
call ..\..\utils\vcbuild . shaveVrayExporter RelM%compactMayaVersion%V%versionTag% %vrayVSVersion% shaveVrayExporter 64
set savedErr=%errorlevel%
popd

exit /b %savedErr%