language: cpp
sudo: false 

addons:
   apt:
      packages:
         - cmake
         - ninja-build

compiler:
   - clang
   - gcc

env:
   - BUILD_TYPE=Debug
   - BUILD_TYPE=Release

script:
   - mkdir build && cd build
   - cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -GNinja ..
   - cmake --build  . -j 1
   - ctest --output-on-failure

language: cpp
sudo: false 
os:
  - linux

#
# Add extra sources and common packages
#
addons:
  sources:
    # The Travis apt source whitelist can be found here:
    # https://github.com/travis-ci/apt-source-whitelist/blob/master/ubuntu.json
    - ubuntu-toolchain-r-test     # for gcc, glibc, libstdc++ at various versions
    - llvm-toolchain-precise-3.5  # for clang-3.5
    - llvm-toolchain-precise-3.8  # for clang-3.8
    - kalakris-cmake              # for cmake-2.8.11.2
  apt:
    packages:
      - cmake
      - ninja-build

#
# Define common vars for all builds
#
env:
  global:
    - CORES=1

  matrix:
    - BUILD_TYPE=Debug
    - BUILD_TYPE=Release

#
# Matrix of compilers:
#
matrix:
  include:
    - addons:
        packages:
          - clang-3.5
        compiler:
          - clang
        env: COMPILER_VERSION=3.5
    - addons:
        packages:
          - clang-3.8
        compiler:
          - clang
        env: COMPILER_VERSION=3.8
    - addons:
        packages:
          - gcc-4.9
        compiler:
          - gcc
        env: COMPILER_VERSION=4.9
    - addons:
        packages:
          - gcc-5
        compiler:
          - clang
        env: COMPILER_VERSION=5


script:
  - mkdir build && cd build
  - export CC="${CC}-${COMPILER_VERSION}"
  - export CXX="${CXX}-${COMPILER_VERSION}"
  - cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -GNinja ..
  - cmake --build  . -j ${CORES}
  - ctest --output-on-failure

Test with more compilers and use more recent sources
Test with more compilers and use more recent sources
