branches:
  only:
  - master
  - feature/pybind
  
os:
   - linux
     addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - g++-6
     env:
        - MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"	
   - osx

compiler:
   - gcc

language: cpp

sudo: required

dist: trusty

env:
  global:
    - CTEST_EXT_COLOR_OUTPUT=TRUE
    - CTEST_BUILD_FLAGS=-j4

matrix:
   exclude:
     - os: osx
       compiler: gcc
script:
   - cmake --build .
   - ctest -VV .

before_script:
   - mkdir build
   - cd build
   - cmake ..

before_install:
   - if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then openssl aes-256-cbc -K $encrypted_0c0fd3a7dbd0_key -iv $encrypted_0c0fd3a7dbd0_iv -in config/travisci_rsa.enc -out config/travisci_rsa -d; fi
   - if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then chmod 0600 config/travisci_rsa; cp config/travisci_rsa ~/.ssh/id_rsa; fi
   - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get -qq update; fi
   - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y cmake python3-dev
     g++ libpcre3 libpcre3-dev libgmp3-dev uuid-dev python3-pip; fi
   - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y libgtkmm-3.0-dev
     libjsoncpp-dev libboost-regex-dev libboost-system-dev libboost-program-options-dev libboost-date-time-dev libboost-filesystem-dev libgmp-dev libsqlite3-dev; fi
   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; brew unlink json-c; fi
   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew outdated cmake || brew upgrade cmake; fi
   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew outdated boost || travis_wait brew upgrade boost; fi
   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew outdated gmp || brew upgrade gmp; fi
   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew outdated pkgconfig || brew upgrade pkgconfig; fi
   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install jsoncpp python3 gtkmm3 gnome-icon-theme; fi
   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo pip3 install matplotlib sympy; fi
   - if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then if [[ "`${CC} --version |grep gcc`" != "" ]]; then sudo apt-get install --yes doxygen graphviz texlive-font-utils; ./config/publish-doxygen; fi; fi; fi

install:
   - pip3 install --user sympy


notifications:
  email:
    recipients:
      - kasper.peeters@phi-sci.com
    on_success: always
    on_failure: always
