language: cpp
compiler:
  #- gcc # Avoid gcc because it exhausts travis VM memory
  - clang

before_install:
   # Add PPA for recent boost libraries
 - sudo add-apt-repository --yes ppa:boost-latest/ppa
 - sudo add-apt-repository --yes ppa:dcthomp/smtk
   # Make sure package index is up to date:
 - sudo apt-get -qq update

install:
   # Remove cmake-data package as it interferes with SMTK PPA cmake package:
 - sudo dpkg -r cmake cmake-data
   # Install build tools:
 - sudo apt-get install -yqq git cmake ninja-build ccache python-dev texlive-extra-utils doxygen graphviz
 - sudo apt-get install -yqq libboost1.54-dev libboost-filesystem1.54-dev libboost-system1.54-dev
   # Install Qt devel stuff:
 - sudo apt-get install -yqq libqt4-dev libqt4-opengl-dev libqtwebkit-dev qt4-dev-tools
   # Install mesa OpenGL driver
 - sudo apt-get install libgl1-mesa-dri
   # Install opencascade
 - sudo apt-get install -yqq oce-dev cgm-dev
   # Install python packages via pip
 - sudo pip install -r ${TRAVIS_BUILD_DIR}/doc/requirements/dev.txt
   # Set user/email so any tests we might have for developers pass
 - git config --global user.email "travis@travis-ci.org"
 - git config --global user.name "Travis CI"
   # Now build and/or install deps for which there is no package
 - mkdir -p ~/smtk-deps/shiboken
 - cd ~/smtk-deps/shiboken
 - git clone https://github.com/OpenGeoscience/shiboken.git src
 - cd src
 - git checkout smtk-head
 - cd ..
 - mkdir build
 - cd build
 - cmake -G Ninja -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo "-DCMAKE_CXX_FLAGS:STRING=-fPIC" "-DCMAKE_INSTALL_PREFIX=${HOME}/smtk-deps/shiboken/install" ../src
 - ninja -j2 install

script:
 - xvfb-run -s "-screen 0 1024x768x16" ${TRAVIS_BUILD_DIR}/.travis.build.sh
