Compiling RenderMan Plugins on Windows

26 Dec 2020

This is how I compile them on Windows 10. Information relevent for RenderMan 23.

REM where to install the plugins once compiled
set CUSTOM_PLUGIN_PATH="D:\scenes\rman\custom\plugins"

REM specify which version of RenderMan to use
set RMAN_VERSION="23.2"
set RMANTREE=C:\\Program Files\Pixar\RenderManProServer-%RMAN_VERSION%\

REM set path to version builds
set BUILD_PLUGIN_PATH="D:\tools\Earlyworm-Pxr\plugin\r%RMAN_VERSION%\windows\"
set PLUGIN_NAME="WillActionCam"

mkdir %BUILD_PLUGIN_PATH%\args

REM set this to the your MSVC install
call "D:\programs\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"

REM WillActionCam
cl -MD /EHsc /D "WIN32" /D "_WINDLL" /I"%RMANTREE%\include" -c %PLUGIN_NAME%.cpp
link  /DLL /out:%PLUGIN_NAME%.dll %PLUGIN_NAME%.obj "%RMANTREE%\lib\libprman.lib" "%RMANTREE%\lib\libpxrcore.lib"

REM cleanup and install
del %PLUGIN_NAME%.exp %PLUGIN_NAME%.lib %PLUGIN_NAME%.obj
copy %PLUGIN_NAME%.dll "%BUILD_PLUGIN_PATH%\%PLUGIN_NAME%.dll"
move %PLUGIN_NAME%.dll "%CUSTOM_PLUGIN_PATH%\%PLUGIN_NAME%.dll"
copy ".\args\%PLUGIN_NAME%.args" %CUSTOM_PLUGIN_PATH%\args\%PLUGIN_NAME%.args
copy ".\args\%PLUGIN_NAME%.args" %BUILD_PLUGIN_PATH%\args\%PLUGIN_NAME%.args