diff --git a/CI/windows_sam_build.bat b/CI/windows_sam_build.bat new file mode 100644 index 0000000..1321d93 --- /dev/null +++ b/CI/windows_sam_build.bat @@ -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