Skip to content

Commit

Permalink
Upgrade appveyor ci to last msvc
Browse files Browse the repository at this point in the history
  • Loading branch information
fspindle committed Apr 12, 2024
1 parent 2cfc3e9 commit 2a1df42
Showing 1 changed file with 68 additions and 95 deletions.
163 changes: 68 additions & 95 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,24 @@
version: "3.6.1-{build}"

image:
- Visual Studio 2017

# to add several platforms to build matrix
platform:
- x64

configuration:
- Release

environment:
VISP_OPENCV_MINGW_FILE: opencv-4.1.0-MinGW-build-package.7z
VISP_OPENCV_MINGW_DIR: opencv-4.1.0-MinGW-build-package
VISP_OPENCV_MINGW_PKG: https://github.com/lagadic/visp-dependencies/blob/master/opencv-4.1.0-MinGW-x86_64-7.3.0-release-posix-seh-rt_v5-rev0-build-package.7z?raw=true
VISP_OPENCV_VS2015_2017_FILE: opencv-4.1.0-vc14_vc15.exe
VISP_OPENCV_VS2015_2017_DIR: opencv-4.1.0-vc14_vc15
VISP_OPENCV_VS2015_2017_PKG: https://github.com/opencv/opencv/releases/download/4.1.0/opencv-4.1.0-vc14_vc15.exe
- Visual Studio 2022

matrix:
- TARGET: mingw
# - TARGET: msvc
GENERATOR: "MinGW Makefiles"
CONFIGURATION: "Release"
- TARGET: vc17
GENERATOR: "Visual Studio 17 2022"
PLATFORM: "x64"
CONFIGURATION: "Release"
- TARGET: uwp
GENERATOR: "Visual Studio 17 2022"
PLATFORM: "x64"
CONFIGURATION: "Release"
- TARGET: visp_sample
GENERATOR: "Visual Studio 17 2022"
PLATFORM: "x64"
CONFIGURATION: "Release"

# Scripts that are called at very beginning, before repo cloning
init:
Expand All @@ -45,66 +41,38 @@ install:
# visp_sample
- git clone --depth 1 https://github.com/lagadic/visp_sample

# opencv
- ps: >-
if ((${env:TARGET} -imatch "msvc" -or ${env:TARGET} -imatch "visp_sample") -and !(Test-Path ${env:VISP_OPENCV_VS2015_2017_FILE})) {
echo "Downloading OpenCV Visual Studio from ${env:VISP_OPENCV_VS2015_2017_PKG} ..."
appveyor DownloadFile "${env:VISP_OPENCV_VS2015_2017_PKG}" -FileName ${env:VISP_OPENCV_VS2015_2017_FILE} -Timeout 1200000
}
- ps: >-
if (${env:TARGET} -imatch "msvc" -or ${env:TARGET} -imatch "visp_sample") {
echo "Extracting OpenCV Visual Studio to C:\projects\deps ..."
7z x ${env:VISP_OPENCV_VS2015_2017_FILE} -y "-o${env:VISP_OPENCV_VS2015_2017_DIR}"
}
- ps: >-
if (${env:TARGET} -imatch "mingw" -and !(Test-Path ${env:VISP_OPENCV_MINGW_FILE})) {
echo "Downloading OpenCV MinGW from ${env:VISP_OPENCV_MINGW_PKG} ..."
appveyor DownloadFile "${env:VISP_OPENCV_MINGW_PKG}" -FileName ${env:VISP_OPENCV_MINGW_FILE} -Timeout 1200000
}
- ps: >-
if (${env:TARGET} -imatch "mingw") {
echo "Extracting OpenCV MinGW to C:\projects\deps ..."
7z x ${env:VISP_OPENCV_MINGW_FILE} -y "-o${env:VISP_OPENCV_MINGW_DIR}"
}
cache:
- opencv-4.1.0-MinGW-build-package.7z -> appveyor.yml
- opencv-4.1.0-vc14_vc15.exe -> appveyor.yml

# visp clone directory
clone_folder: C:\projects\visp\visp

before_build:
install:
- ECHO Installing %TARGET% with %GENERATOR%
- SET PATH_ORIGINAL=%PATH%
# Setup path for mingw
# Use MinGW-w64 in C:\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev0\mingw64\bin
- if "%TARGET%"=="mingw" set MINGW_DIR=C:\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev0\mingw64
# Workaround for CMake not wanting sh.exe on PATH for MinGW
- if "%TARGET%"=="mingw" set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
- if "%TARGET%"=="mingw" set PATH=C:\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev0\mingw64\bin;%PATH%
- if "%TARGET%"=="mingw" dir C:\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev0\mingw64\bin
- if "%TARGET%"=="mingw" mingw32-make --version

# Setup path for ViSP
- if "%TARGET%"=="msvc" set VISP_DLL_DIR=C:\projects\visp\build\install\%platform%\vc15\bin
- if "%TARGET%"=="msvc" set PATH=%VISP_DLL_DIR%;%PATH%
- if "%TARGET%"=="mingw" set VISP_DLL_DIR=C:\projects\visp\build\install\%platform%\mingw\bin
- if "%TARGET%"=="mingw" set PATH=%VISP_DLL_DIR%;%PATH%
- if "%TARGET%"=="visp_sample" set VISP_DLL_DIR=C:\projects\visp\build\install\%platform%\vc15\bin
- if "%TARGET%"=="visp_sample" set PATH=%VISP_DLL_DIR%;%PATH%

# Setup path for OpenCV
- if "%TARGET%"=="msvc" set OpenCV_DIR=C:\projects\deps\%VISP_OPENCV_VS2015_2017_DIR%\opencv\build
- if "%TARGET%"=="msvc" set OpenCV_DLL_DIR=%OpenCV_DIR%\%platform%\vc15\bin
- if "%TARGET%"=="msvc" set PATH=%OPENCV_DLL_DIR%;%PATH%
- if "%TARGET%"=="mingw" set OpenCV_DIR=C:\projects\deps\%VISP_OPENCV_MINGW_DIR%\install
- if "%TARGET%"=="mingw" set OpenCV_DLL_DIR=%OpenCV_DIR%\x64\mingw\bin
- if "%TARGET%"=="mingw" set PATH=%OPENCV_DLL_DIR%;%PATH%
- if "%TARGET%"=="visp_sample" set OpenCV_DIR=C:\projects\deps\%VISP_OPENCV_VS2015_2017_DIR%\opencv\build
- if "%TARGET%"=="visp_sample" set OpenCV_DLL_DIR=%OpenCV_DIR%\%platform%\vc15\bin
- if "%TARGET%"=="visp_sample" set PATH=%OPENCV_DLL_DIR%;%PATH%
- if [%TARGET%]==[mingw] (
SET "PATH_MINGW64=C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin" &&
SET "PATH_VISPDLL=C:\projects\visp\build\install\%PLATFORM%\%TARGET%\bin" &&
SET "PATH=%PATH_MINGW64%:%PATH_VISPDLL%:%PATH_ORIGINAL%" &&
dir %PATH_MINGW64% &&
mingw32-make --version
)

# Setup path for msvc
- if [%TARGET%]==[msvc] (
SET PATH_VISPDLL=C:\projects\visp\build\install\%PLATFORM%\%TARGET%\bin &&
SET "PATH=%PATH_VISPDLL%:%PATH_ORIGINAL%" &&
)

# Setup path for visp_sample
- if [%TARGET%]==[visp_sample] (
SET PATH_VISPDLL=C:\projects\visp\build\install\%PLATFORM%\%TARGET%\bin &&
SET "PATH=%PATH_VISPDLL%:%PATH_ORIGINAL%" &&
)

# Setup path for uwp
- if [%TARGET%]==[visp_sample] (
SET PATH_VISPDLL=C:\projects\visp\build\install\%PLATFORM%\%TARGET%\bin &&
SET "PATH=%PATH_VISPDLL%:%PATH_ORIGINAL%" &&
)

build_script:
- echo %PATH%
Expand All @@ -114,31 +82,36 @@ build_script:
- cd C:\projects\visp\build

# mingw case
- if "%TARGET%"=="mingw" dir %OpenCV_DLL_DIR%
- if "%TARGET%"=="mingw" cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=%configuration% ..\visp
- if "%TARGET%"=="mingw" cmake --build . --config %configuration% --target install -- -j2
- if "%TARGET%"=="mingw" dir C:\projects\visp\build\install
- if "%TARGET%"=="mingw" dir %VISP_DLL_DIR%
- if "%TARGET%"=="mingw" ctest --output-on-failure -V
- if [%TARGET%]==[mingw] (
cmake -G %GENERATOR% -DCMAKE_BUILD_TYPE=%CONFIGURATION% ..\visp &&
cmake --build . --config %CONFIGURATION% --target install -- -j2 &&
dir C:\projects\visp\build\install &&
dir %PATH_VISPDLL% &&
ctest -j2 --output-on-failure -V
)

# msvc case
- if "%TARGET%"=="msvc" dir %OpenCV_DLL_DIR%
- if "%TARGET%"=="msvc" cmake -G "Visual Studio 15 2017" -A %platform% ..\visp
- if "%TARGET%"=="msvc" cmake --build . --config %configuration% --target install -- /m:2
- if "%TARGET%"=="msvc" dir C:\projects\visp\build\install
- if "%TARGET%"=="msvc" dir %VISP_DLL_DIR%
- if "%TARGET%"=="msvc" ctest --output-on-failure -V
- if [%TARGET%]==[msvc] (
cmake -G %GENERATOR% -A %PLATFORM% ..\visp &&
cmake --build . --config %CONFIGURATION% --target install -- /m:2 &&
dir C:\projects\visp\build\install &&
dir %PATH_VISPDLL% &&
ctest -j2 --output-on-failure -V
)

# uwp case
- if "%TARGET%"=="uwp" cmake -G "Visual Studio 15 2017" -A %platform% -DCMAKE_SYSTEM_NAME="WindowsStore" -DCMAKE_SYSTEM_VERSION="10.0" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF ..\visp
- if "%TARGET%"=="uwp" cmake --build . --config %configuration% -- /m:2
- if [%TARGET%]==[uwp] (
cmake -G %GENERATOR% -A %PLATFORM% -DCMAKE_SYSTEM_NAME="WindowsStore" -DCMAKE_SYSTEM_VERSION="10.0" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DBUILD_APPS=OFF ..\visp &&
cmake --build . --config %CONFIGURATION% -- /m:2
)

# visp_sample case: ViSP as 3rdparty with cmake
- if "%TARGET%"=="visp_sample" dir %OpenCV_DLL_DIR%
- if "%TARGET%"=="visp_sample" cmake -G "Visual Studio 15 2017" -A %platform% -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF ..\visp
- if "%TARGET%"=="visp_sample" cmake --build . --config %configuration% --target install -- /m:2
- if "%TARGET%"=="visp_sample" cd C:\projects\deps\visp_sample
- if "%TARGET%"=="visp_sample" mkdir build
- if "%TARGET%"=="visp_sample" cd build
- if "%TARGET%"=="visp_sample" cmake -G "Visual Studio 15 2017" -A %platform% .. -DVISP_DIR=C:\projects\visp\build\install
- if "%TARGET%"=="visp_sample" cmake --build . --config %configuration% -- /m:2
- if [%TARGET%]==[visp_sample] (
cmake -G %GENERATOR% -A %PLATFORM% -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DBUILD_APPS=OFF ..\visp &&
cmake --build . --config %CONFIGURATION% --target install -- /m:2 &&
cd C:\projects\deps\visp_sample &&
mkdir build &&
cd build &&
cmake -G %GENERATOR% -A %PLATFORM% .. -DVISP_DIR=C:\projects\visp\build\install &&
cmake --build . --config %configuration% -- /m:2
)

0 comments on commit 2a1df42

Please sign in to comment.