-
Notifications
You must be signed in to change notification settings - Fork 288
/
Copy pathappveyor.yml
144 lines (120 loc) · 6.32 KB
/
appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# Specify version format
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
matrix:
- TARGET: mingw
# - TARGET: msvc
- TARGET: uwp
- TARGET: visp_sample
# Scripts that are called at very beginning, before repo cloning
init:
- cmake --version
- msbuild /version
install:
# Create temp dir to collect test outputs
- md C:\temp
# All external dependencies are installed in C:\projects\deps
- mkdir C:\projects\deps
- cd C:\projects\deps
# visp-images
- git clone --depth 1 https://github.com/lagadic/visp-images
- set VISP_INPUT_IMAGE_PATH=C:\projects\deps\visp-images
# 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:
# 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%
build_script:
- echo %PATH%
- dir C:\projects\deps
- dir C:\tools
- md C:\projects\visp\build
- 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
# 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
# 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
# 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