From 4a059e7dcbb4f8b270c18996dd5ca62408bc2fcf Mon Sep 17 00:00:00 2001 From: benjaminwan Date: Wed, 23 Nov 2022 16:24:31 +0800 Subject: [PATCH] env: add path to ant --- .github/workflows/builder.yml | 9 +++++++++ build-opencv4-vs2019.bat | 16 ++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/workflows/builder.yml b/.github/workflows/builder.yml index 807c2886..c29cb74d 100644 --- a/.github/workflows/builder.yml +++ b/.github/workflows/builder.yml @@ -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: | @@ -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 diff --git a/build-opencv4-vs2019.bat b/build-opencv4-vs2019.bat index f8321e48..fcdc36c2 100644 --- a/build-opencv4-vs2019.bat +++ b/build-opencv4-vs2019.bat @@ -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% ^ ..