-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |