1@echo on 2setlocal enabledelayedexpansion 3pushd %~dp0 4 5where /q cmake.exe 6if %errorlevel% neq 0 ( 7 echo "CMake not found. Please install it from https://cmake.org/" 8 exit /b 1 9) 10 11where /q dot.exe 12if %errorlevel% neq 0 ( 13 echo "GraphViz (dot.exe) not found. Please install it from https://graphviz.gitlab.io/" 14 exit /b 1 15) 16 17set cmake_binary_dir=%1 18 19if "%cmake_binary_dir%" == "" ( 20 set cmake_binary_dir=..\..\build 21) 22 23rem Copy options to binary dir 24copy /y CMakeGraphVizOptions.cmake "%cmake_binary_dir%\" 25if %errorlevel% neq 0 exit /b %errorlevel% 26 27rem Run cmake commands from the binary dir 28pushd %cmake_binary_dir% 29 30cmake --graphviz=SwiftShader.dot .. 31if %errorlevel% neq 0 exit /b %errorlevel% 32 33dot -Tpng -o SwiftShader.png SwiftShader.dot 34if %errorlevel% neq 0 exit /b %errorlevel% 35 36rem Open the file 37start SwiftShader.png 38 39popd 40popd 41