This repository has been archived by the owner on Dec 30, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
127 lines (109 loc) · 3.74 KB
/
.travis.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
sudo: required
compiler:
- gcc
language: cpp
matrix:
include:
# works on Precise and Trusty
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.7
packages:
- clang-3.7
env:
- MATRIX_EVAL="CC=clang-3.7 && CXX=clang++-3.7"
# works on Precise and Trusty
# - os: linux
# addons:
# apt:
# sources:
# - ubuntu-toolchain-r-test
# - llvm-toolchain-precise-3.8
# packages:
# - clang-3.8
# env:
# - MATRIX_EVAL="CC=clang-3.8 && CXX=clang++-3.8"
# - CXXFLAGS="-stdlib=libc++"
#
# # works on Trusty
# - os: linux
# addons:
# apt:
# sources:
# - ubuntu-toolchain-r-test
# - llvm-toolchain-trusty-3.9
# packages:
# - clang-3.9
# env:
# - MATRIX_EVAL="CC=clang-3.9 && CXX=clang++-3.9"
# - CXXFLAGS="-stdlib=libc++"
#
# works on Trusty
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-4.0
packages:
- clang-4.0
env:
- MATRIX_EVAL="CC=clang-4.0 && CXX=clang++-4.0"
# works on Trusty
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-5.0
packages:
- clang-5.0
env:
- MATRIX_EVAL="CC=clang-5.0 && CXX=clang++-5.0"
cache:
apt: true
ccache: true
directories:
- opencv-3.4
- opencv_contrib-3.4
install:
# OpenCV install code (modified from orignal source: https://github.com/jayrambhia/Install-OpenCV)
# OpenCV dependencies - Details available at: http://docs.opencv.org/trunk/doc/tutorials/introduction/linux_install/linux_install.html
- sudo apt-get install -y build-essential
- sudo apt-get install -y cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
- sudo apt-get install -y python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
# Download .zip file and extract.
- curl -sL https://github.com/Itseez/opencv/archive/3.4.zip > opencv.zip
- unzip -n opencv.zip > log1
# Download EXTRA MODULES and extract.
# Currently not required for builds: -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-3.4/modules
#- curl -sL https://github.com/Itseez/opencv_contrib/archive/3.4.zip > opencv_contrib.zip
#- unzip -n opencv_contrib.zip > log2
# Create a new 'build' folder.
- cd opencv-3.4
- mkdir -p build
- cd build
# if Makefile is cached, then skip cmake opencv
# Set build instructions for Ubuntu distro.
- cat Makefile > l1 || cmake -D BUILD_opencv_apps=OFF -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_DOCS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_TESTS=OFF -D WITH_CSTRIPES=ON -D WITH_TBB=ON -D BUILD_opencv_java=OFF -D BUILD_opencv_python=OFF -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=OFF -D INSTALL_PYTHON_EXAMPLES=OFF -D BUILD_EXAMPLES=OFF -D WITH_QT=ON -D WITH_OPENCL=ON -D WITH_OPENGL=OFF ..
# if Makefile is cached, then skip make opencv
# Run 'make' with multiple threads.
- cat Makefile > l2 ||make -j2 > make_log
# Install to OS.
- sudo make install
# Add configuration to OpenCV to tell it where the library files are located on the file system (/usr/local/lib)
- sudo sh -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
- sudo ldconfig
- echo "OpenCV installed."
# We need to return to the repo "root" folder, so we can then 'cd' into the C++ project folder.
- cd ../../
- ls -al
script:
- cmake -H. -Bbuild
- cd build
- cmake --build .
- mv test/unit_tests .
- ctest