Batch file adaptations

This commit is contained in:
Christoph Niederberger 2023-02-15 10:36:28 +01:00
parent c63a1dcc73
commit 417bea0a81
2 changed files with 27 additions and 22 deletions

View File

@ -73,20 +73,21 @@ Otherwise, please also read the guidelines on the official Mediapipe website: ht
)
```
- Edit the `MEDIAPIPEDIR\mediapipe\pose_tracking_dll\build.bat` file
- Must change:
- Must change
- `BAZEL_PATH` -> path to bazel.exe (No default)
- Build configuration
- Build configuration selection
- `MEDIAPIPE_CONFIGURATION` -> Release (Default, `opt`) or Debug (`dbg`)
- Verify:
- Verify these settings
- `MYSYS_PATH` -> path to `MSYS2DIR\usr\bin` (Default: `C:\msys64\usr\bin`)
- `BAZEL_SH` -> path to bash.exe (Default: `%MYSYS_PATH%\bash.exe`)
- `BAZEL_VS_VERSION` -> Visual Studio version (Default: `2019`)
- `BAZEL_VC_FULL_VERSION` -> Visual Studio Build Tools full version. Depends on the version installed. See `See C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC`
- `BAZEL_WINSDK_FULL_VERSION` -> WinSDK version (Default: `10.0.19041.0`)
- `BAZEL_PYTHON_PATH` -> Path to python.exe (Default: `%LOCALAPPDATA_FORWARDSLASH%/Programs/Python/Python311/python.exe`)
- Optional
- Optional settings
- `BAZEL_TMP_BUILD_DIR` -> A temporary build folder
- `TARGET_PATH` -> A target folder to copy the relevant files to, i.e. the mediapipe/version folder of the external repo
- `EXTERNAL_PATH` -> The path to the "external repository" to copy the output files
- `MEDIAPIPE_VERSION` -> The current Mediapipe version (to create/use the according subfolder in `EXTERNAL_PATH`)
# Build

View File

@ -20,6 +20,9 @@ set "LOCALAPPDATA_FORWARDSLASH=%LOCALAPPDATA:\=/%"
:: path to bazel.exe
SET BAZEL_PATH=E:\repos\bazel\5.4.0
:: Release [opt] or Debug [dbg]
SET MEDIAPIPE_CONFIGURATION=dbg
:: path to msys
SET MYSYS_PATH=C:\msys64\usr\bin
@ -44,11 +47,10 @@ SET BAZEL_PYTHON_PATH=%LOCALAPPDATA_FORWARDSLASH%/Programs/Python/Python311/pyth
:: Optional: temporary build path
SET BAZEL_TMP_BUILD_DIR=E:\repos\mp_output
:: Release [opt] or Debug [dbg]
SET MEDIAPIPE_CONFIGURATION=opt
:: Optional: A target path to copy the relevant files after build, i.e. the version folder of the external repo
SET TARGET_PATH=C:\Users\ChristophNiederberge\source\repos\CodeReviews\external\mediapipe\0.8.10.2_x64
:: Optional: The path to the external repository to copy the output files
SET EXTERNAL_PATH=C:\Users\ChristophNiederberge\source\repos\CodeReviews\external
:: The current Mediapipe version to set the correct external subfolder name
SET MEDIAPIPE_VERSION=0.9.1
:: ----------------------------------------------------------
:: Build posetracking DLL
@ -64,20 +66,22 @@ IF NOT [%BAZEL_TMP_BUILD_DIR%]==[] (
:: ----------------------------------------------------------
:: Copy files to target folder (optional)
:: ----------------------------------------------------------
IF NOT [%TARGET_PATH%]==[] (
IF NOT [%EXTERNAL_PATH%]==[] (
IF [%MEDIAPIPE_CONFIGURATION%]==[opt] (
ECHO Copy files to %TARGET_PATH%\x64\Release ...
mkdir %TARGET_PATH%\x64\Release
copy bazel-bin\mediapipe\pose_tracking_dll\pose_tracking_lib.dll %TARGET_PATH%\x64\Release
copy bazel-bin\mediapipe\pose_tracking_dll\pose_tracking_lib.dll.if.lib %TARGET_PATH%\x64\Release
copy bazel-bin\mediapipe\pose_tracking_dll\opencv_world3410.dll %TARGET_PATH%\x64\Release
SET TARGET_PATH = %EXTERNAL_PATH%\mediapipe\%MEDIAPIPE_VERSION%_x64\x64\Release
ECHO Copy files to %TARGET_PATH% ...
mkdir %TARGET_PATH%
copy bazel-bin\mediapipe\pose_tracking_dll\pose_tracking_lib.dll %TARGET_PATH%
copy bazel-bin\mediapipe\pose_tracking_dll\pose_tracking_lib.dll.if.lib %TARGET_PATH%
copy bazel-bin\mediapipe\pose_tracking_dll\opencv_world3410.dll %TARGET_PATH%
)
IF [%MEDIAPIPE_CONFIGURATION%]==[dbg] (
ECHO Copy files to %TARGET_PATH%\x64\Debug ...
mkdir %TARGET_PATH%\x64\Debug
copy bazel-bin\mediapipe\pose_tracking_dll\pose_tracking_lib.dll %TARGET_PATH%\x64\Debug
copy bazel-bin\mediapipe\pose_tracking_dll\pose_tracking_lib.dll.if.lib %TARGET_PATH%\x64\Debug
copy bazel-bin\mediapipe\pose_tracking_dll\pose_tracking_lib.pdb %TARGET_PATH%\x64\Debug
copy bazel-bin\mediapipe\pose_tracking_dll\opencv_world3410d.dll %TARGET_PATH%\x64\Debug
SET TARGET_PATH = %EXTERNAL_PATH%\mediapipe\%MEDIAPIPE_VERSION%_x64\x64\Debug
ECHO Copy files to %TARGET_PATH% ...
mkdir %TARGET_PATH%
copy bazel-bin\mediapipe\pose_tracking_dll\pose_tracking_lib.dll %TARGET_PATH%
copy bazel-bin\mediapipe\pose_tracking_dll\pose_tracking_lib.dll.if.lib %TARGET_PATH%
copy bazel-bin\mediapipe\pose_tracking_dll\pose_tracking_lib.pdb %TARGET_PATH%
copy bazel-bin\mediapipe\pose_tracking_dll\opencv_world3410d.dll %TARGET_PATH%
)
)