-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #114 from drzraf/ci-travis
get a running CI
- Loading branch information
Showing
1 changed file
with
23 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,41 @@ | ||
sudo: required | ||
dist: trusty | ||
dist: xenial | ||
language: cpp | ||
|
||
os: | ||
- linux | ||
os: linux | ||
compiler: g++ | ||
|
||
addons: | ||
apt: | ||
sources: | ||
- george-edison55-precise-backports | ||
- ubuntu-toolchain-r-test | ||
- timsc | ||
packages: | ||
- cmake-data | ||
- cmake | ||
- g++-6 | ||
- libopencv-core3.4 | ||
- libopencv-imgproc3.4 | ||
- libopencv-highgui3.4 | ||
- libopencv-dev | ||
|
||
before_install: | ||
- if [ $TRAVIS_OS_NAME == osx ]; then brew update && brew install opencv && brew install qt5 && brew link --force qt5; fi | ||
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y | ||
# qt5 | ||
- sudo add-apt-repository ppa:ubuntu-sdk-team/ppa -y | ||
- sudo apt-get update -qq | ||
# g++ 4.8 for std=c++11 | ||
- if [ "$CXX" = "g++" ]; then sudo apt-get install -qq g++-4.8; fi | ||
# additional headerfiles | ||
- sudo apt-get -y install libXxf86vm-dev libXi-dev libudev-dev libXcursor-dev | ||
- sudo apt-get -y install libxxf86vm-dev libxi-dev libudev-dev libxcursor-dev | ||
- sudo apt-get -y install -f qtbase5-dev qt5-default qttools5-dev-tools libqt5opengl5-dev | ||
- sudo apt-get -y install libfreeimage-dev | ||
|
||
install: | ||
|
||
# OpenCV v3.1.0 install code (modified from orignal source: https://gist.github.com/Randommood/478ccd806511d45febc1) | ||
|
||
# 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 contribution module file and extract | ||
- curl -sL https://github.com/opencv/opencv_contrib/archive/3.1.0.zip > opencv_contrib-3.1.0.zip | ||
- unzip opencv_contrib-3.1.0.zip | ||
# Download v3.1.0 .zip file and extract. | ||
- curl -sL https://github.com/opencv/opencv/archive/3.1.0.zip > opencv-3.1.0.zip | ||
- unzip opencv-3.1.0.zip | ||
# Enter opencv directory | ||
- cd opencv-3.1.0 | ||
|
||
# Create a new 'build' folder. | ||
- mkdir build | ||
- cd build | ||
|
||
# Set build instructions for Ubuntu distro. | ||
- cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-3.1.0/modules .. | ||
|
||
# Run 'make' with four threads. | ||
# make -j4 > /dev/null | ||
- make -j4 | ||
|
||
# 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 ../../ | ||
|
||
script: | ||
- qmake -recursive QMAKE_CXX=g++-4.8 QMAKE_CC=gcc-4.8 PREFIX=/app | ||
- qmake -recursive PREFIX=/app | ||
- make | ||
- sudo make install | ||
|
||
after_success: | ||
- find /app | ||
- curl --upload-file /app/bin/imageplay https://transfer.sh/imageplay | ||
- sudo bash -ex appimage.sh | ||
|
||
branches: | ||
only: | ||
- master | ||
- master |