Skip to content

Commit

Permalink
env: add path to ant
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminwan committed Nov 24, 2022
1 parent 6132a6c commit 4a059e7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,13 @@ jobs:
ref: ${{ env.OPENCV_VERSION }}
submodules: recursive

# 下载ant
- name: dl apache ant
run: |
Invoke-WebRequest -Uri https://downloads.apache.org/ant/binaries/apache-ant-1.10.12-bin.zip -OutFile apache-ant-1.10.12-bin.zip
7z x apache-ant-1.10.12-bin.zip -aoa
mv apache-ant-1.10.12 C:\
# 复制编译脚本
- name: copy build script
run: |
Expand All @@ -154,6 +161,8 @@ jobs:
#- uses: ilammy/msvc-dev-cmd@v1
- name: build opencv
run: |
$env:ANT_HOME="C:/apache-ant-1.10.12"
$env:Path+=";C:/apache-ant-1.10.12/bin"
cd opencv-${{ env.OPENCV_VERSION }}
./build-opencv4-vs2019.bat
Expand Down
16 changes: 8 additions & 8 deletions build-opencv4-vs2019.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ SETLOCAL EnableDelayedExpansion

for /f "Delims=" %%x in (opencv4_cmake_options.txt) do set OPTIONS=!OPTIONS!%%x

call :cmakeParams "Visual Studio 16 2019" "v142" "x64" "md"
call :cmakeParams "Visual Studio 16 2019" "v142" "Win32" "md"
call :cmakeParams "Visual Studio 16 2019" "v142" "x64" "mt"
call :cmakeParams "Visual Studio 16 2019" "v142" "Win32" "mt"
call :cmakeParams "v142" "x64" "md"
call :cmakeParams "v142" "Win32" "md"
call :cmakeParams "v142" "x64" "mt"
call :cmakeParams "v142" "Win32" "mt"
GOTO:EOF

:cmakeParams
mkdir "build-%~2-%~3-%~4"
pushd "build-%~2-%~3-%~4"
if "%~4" == "md" (
mkdir "build-%~1-%~2-%~3"
pushd "build-%~1-%~2-%~3"
if "%~3" == "md" (
set STATIC_CRT_ENABLED="OFF"
)^
else (
set STATIC_CRT_ENABLED="ON"
)
cmake -G "%~1" -T "%~2,host=x64" -A "%~3" -DCMAKE_INSTALL_PREFIX=install ^
cmake -T "%~1,host=x64" -A "%~2" -DCMAKE_INSTALL_PREFIX=install ^
-DCMAKE_BUILD_TYPE=Release -DCMAKE_CONFIGURATION_TYPES=Release ^
-DBUILD_WITH_STATIC_CRT=%STATIC_CRT_ENABLED% %OPTIONS% ^
..
Expand Down

0 comments on commit 4a059e7

Please sign in to comment.