sudo: required
dist: xenial
cache: ccache
language: cpp
compiler:
- clang
- gcc
install:
- sudo apt-get update -qq
- sudo apt-get install -qy cmake
  libgdal-dev libfreenect-dev
  libeigen3-dev libqt5svg5-dev libtbb-dev
  libavcodec-dev libavformat-dev libavutil-dev libboost-thread-dev
  libboost-program-options-dev libcgal-dev libcgal-qt5-dev
  libdlib-dev libswscale-dev libtbb-dev
  libqt5opengl5-dev qt5-default qttools5-dev qttools5-dev-tools 
  libproj-dev libdlib-dev
- sudo apt-get install -qy xvfb
- git submodule init && git submodule update

before_script:
- mkdir build
- cd build
- cmake -DCMAKE_BUILD_TYPE=Release
  -DEIGEN_ROOT_DIR=/usr/include/eigen3
  -DCOMPILE_CC_CORE_LIB_WITH_TBB=ON
  -DOPTION_USE_DXF_LIB=ON
  -DOPTION_USE_SHAPE_LIB=ON
  -DINSTALL_EXAMPLE_PLUGIN=ON
  -DINSTALL_EXAMPLE_GL_PLUGIN=ON
  -DINSTALL_EXAMPLE_IO_PLUGIN=ON
  -DINSTALL_QADDITIONAL_IO_PLUGIN=ON
  -DINSTALL_QANIMATION_PLUGIN=ON
  -DINSTALL_QBROOM_PLUGIN=ON
  -DINSTALL_QCOMPASS_PLUGIN=ON
  -DINSTALL_QCANUPO_PLUGIN=ON
  -DDLIB_ROOT=/usr/include
  -DINSTALL_QCSF_PLUGIN=ON
  -DINSTALL_QEDL_PLUGIN=ON
  -DINSTALL_QFACETS_PLUGIN=ON
  -DINSTALL_QHOUGH_NORMALS_PLUGIN=ON
  -DINSTALL_QHPR_PLUGIN=ON
  -DINSTALL_QM3C2_PLUGIN=ON
  -DINSTALL_QPCV_PLUGIN=ON
  -DINSTALL_QPHOTOSCAN_IO_PLUGIN=ON
  -DINSTALL_QPOISSON_RECON_PLUGIN=ON
  -DINSTALL_QSRA_PLUGIN=ON
  -DINSTALL_QSSAO_PLUGIN=ON
  -DBUILD_TESTING=ON
  ..
script:
- if [[ $TRAVIS_BRANCH != "beta_builds" ]]; then make -j2; fi
- if [[ $CXX == "clang++" ]]; then export LD_LIBRARY_PATH=/usr/local/clang/lib:$LD_LIBRARY_PATH; fi
- xvfb-run ctest
- cd ..
after_success:
- openssl aes-256-cbc -K $encrypted_d04fcf964026_key -iv $encrypted_d04fcf964026_iv
  -in .snapcraft/travis_snapcraft.cfg -out .snapcraft/snapcraft.cfg -d
services:
- docker
deploy:
  on:
    branch: beta_builds
    condition: "$CC = gcc"
  provider: script
  script: scripts/linux/snap_deploy.sh $(pwd)
  skip_cleanup: true
