Skip to content

Commit

Permalink
Create windows_sam_build.bat
Browse files Browse the repository at this point in the history
  • Loading branch information
k0T0z committed Aug 12, 2024
1 parent 8620da9 commit fe81413
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions CI/windows_sam_build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
@echo off

REM Check if the Qt path argument is provided
if "%~1"=="" (
echo Please provide the Qt installation path as an argument.
echo Usage: build_sam.bat "C:\Path\To\Qt"
exit /b 1
)

set Qt_DIR=%~1

REM Download ONNX Runtime
echo Downloading ONNX Runtime...
powershell -Command "Invoke-WebRequest -Uri 'https://github.com/microsoft/onnxruntime/releases/download/v1.17.1/onnxruntime-win-x64-1.17.1.zip' -OutFile 'onnxruntime.zip'"

REM Unzip ONNX Runtime
echo Unzipping ONNX Runtime...
powershell -Command "Expand-Archive -Path 'onnxruntime.zip' -DestinationPath 'onnxruntime'"

REM Get Root Directory
for /d %%D in (onnxruntime\*) do set rootDir=%%D
echo Root directory of the unzipped file is: %rootDir%

REM Run CMake
echo Running CMake...
cmake -S . -B .build/ -G "Visual Studio 17 2022" ^
-DSAM_STATIC_ANN_ONNX_MODELPATH="dummy.onnx" ^
-DSAM_STATIC_ANN_STANDARDIZE_PARAMS="dummy.pkl" ^
-DSAM_STATIC_CNN_COLORMAP="dummy.npy" ^
-DSAM_ONNXRUNTIME_ROOTDIR="%rootDir%" ^
-DSAM_STATIC_CNN_ONNX_MODELPATH="dummy.onnx" ^
-DSAM_DYNAMIC_CNN_BIGRU_ONNX_MODELPATH="dummy.onnx" ^
-DSAM_BUILD_TESTS=ON ^
-DSAM_BUILD_CLI_TOOLS=ON ^
-DSAM_LINK_CONSOLE=ON ^
-DCMAKE_PREFIX_PATH="%Qt_DIR%"

REM Build the Engine
echo Building the Engine...
cmake --build .build/ --config Debug

echo Done.
pause

0 comments on commit fe81413

Please sign in to comment.