forked from kyamagu/mexopencv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
123 lines (107 loc) · 4.34 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
#
# AppVeyor CI build script.
# https://ci.appveyor.com/project/kyamagu/mexopencv
#
# Note:
# We use prepared opencv binaries built using the same MinGW/Octave config,
# see: https://github.com/amroamroamro/opencv/blob/tag_3.3.0/appveyor.yml
#
# version format
version: 3.3.0.{build}
# clone directory
clone_folder: c:\projects\mexopencv
# whitelisted branches to build
branches:
only:
- master
# disable automatic build/test/deploy phases
build: off
test: off
deploy: off
# build artifacts to keep
artifacts:
- path: mexopencv.7z
- path: test\UnitTest_*.log
- path: test\tests.xml
# global environment variables
environment:
# OpenCV options
# (Note: the makefile calls pkg-config which needs to locate opencv.pc)
OPENCV_DIR: c:\dev\build\install
PKG_CONFIG_PATH: /c/dev/build/install
# Octave options
OCTAVE_HOME: c:\dev\octave-4.2.1
OCTAVE: octave-cli --no-gui --no-window-system
# mexopencv options
# (build choices: mexopencv.make() in Octave, or Makefile in shell)
# (Note: Make 3.81 included has poor jobs support, we use Make 4.2 instead)
MCV_ROOT: c:\projects\mexopencv
WITH_MAKE: yes
MAKE_OPTS: MATLABDIR='/c/dev/octave-4.2.1' WITH_OCTAVE=true WITH_CONTRIB=true NO_CV_PKGCONFIG_HACK=true
MAKE_EXTRA: -j2
DOXY: yes
install:
# install dependencies (Doxygen, Make, OpenCV, Octave)
- mkdir "c:\dev" && cd "c:\dev"
- if "%DOXY%" == "yes" ( choco install doxygen.portable -y > nul )
- ps: Start-FileDownload "https://github.com/amroamroamro/opencv/releases/download/3.2.0/mingw32-make.exe" -FileName mingw32-make.exe
- ps: Start-FileDownload "https://github.com/amroamroamro/opencv/releases/download/3.3.0/cv330_x86_mingw.7z" -FileName cv330_x86_mingw.7z
- ps: Start-FileDownload "https://ftp.gnu.org/gnu/octave/windows/octave-4.2.1-w32.zip" -FileName octave-4.2.1-w32.zip
- 7z x "c:\dev\cv330_x86_mingw.7z" -o"c:\dev\build" -y > nul
- 7z x "c:\dev\octave-4.2.1-w32.zip" -o"c:\dev" -y > nul
- copy /y "%OCTAVE_HOME%\bin\libopenblas.dll" "%OCTAVE_HOME%\bin\libblas.dll" > nul
- set "PATH=%OCTAVE_HOME%\bin;%OPENCV_DIR%\x86\mingw\bin;c:\dev;%PATH%"
before_build:
# create .octaverc file (to setup path and load required packages on start)
# (one for SHELL=sh.exe and one for SHELL=cmd.exe)
#HACK: we also add private directories on path, http://savannah.gnu.org/bugs/?45444
- ps: |
$OctaveRC = @"
crash_dumps_octave_core(false);
more off
try, pkg load statistics, end
try, pkg load image, end
warning('off', 'Octave:GraphicsMagic-Quantum-Depth');
warning('off', 'Octave:shadowed-function');
cd(getenv('MCV_ROOT'));
addpath(getenv('MCV_ROOT'));
addpath(fullfile(getenv('MCV_ROOT'),'+cv','private'));
addpath(fullfile(getenv('MCV_ROOT'),'opencv_contrib'));
addpath(fullfile(getenv('MCV_ROOT'),'opencv_contrib','+cv','private'));
"@
$HomeDirs = @(
(Join-Path (Join-Path $env:OCTAVE_HOME 'home') $env:USERNAME),
$env:USERPROFILE
)
$HomeDirs | ForEach-Object {
$OctaveRCFile = (Join-Path $_ '.octaverc')
New-Item -ItemType File -Path "$OctaveRCFile" -Force | Out-Null
$OctaveRC | Out-File -FilePath "$OctaveRCFile" -Encoding ASCII
}
build_script:
# compile mexopencv
- cd "%MCV_ROOT%"
- if "%WITH_MAKE%" == "yes" (
sh --login -c "cd \"$MCV_ROOT\" && mingw32-make $MAKE_OPTS $MAKE_EXTRA all contrib"
) else (
%OCTAVE% --eval "mexopencv.make('opencv_path',getenv('OPENCV_DIR'), 'opencv_contrib',true, 'progress',false, 'verbose',1);"
)
# build docs
- if "%DOXY%" == "yes" ( doxygen Doxyfile )
after_build:
# package MEX-files
- cd "%MCV_ROOT%" && 7z a -t7z "%APPVEYOR_BUILD_FOLDER%\mexopencv.7z" *.mex -r -y > nul
before_test:
# print cv build info
- call %OCTAVE% --eval "disp(cv.getBuildInformation())"
test_script:
# run test suite
#HACK: we reset %ERRORLEVEL% because we can't rely on Octave exit code
- if "%WITH_MAKE%" == "yes" (
sh --login -c "cd \"$MCV_ROOT\" && mingw32-make $MAKE_OPTS test"
) else (
%OCTAVE% --eval "cd test;try,UnitTest('ContribModules',true,'Verbosity',2);catch e,disp(e);exit(1);end;exit(0);" || ver > nul
)
after_test:
# upload xUnit test results
- ps: (New-Object System.Net.WebClient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\test\tests.xml))