language: cpp
compiler:
  - clang
  - gcc
addons:
 apt:
   packages:
   - ninja
script: cmake --version && cmake -G Ninja && ninja
sudo: false
language: generic
cache:
  apt: true
  directories:
    - /tmp/tools

env:
  global:
    - PATH="$HOME/bin:$PATH"
    - CMAKE_VERSION_PREFIX=3.5
    - CMAKE_VERSION_FULL=3.5.2
    - NINJA_VERSION=1.7.1

matrix:
  include:
    - env: CXX=g++-5 CC=gcc-5
      addons:
        apt:
          packages:
            - g++-5
            - unzip
          sources: &sources
            - r-packages-precise
            - llvm-toolchain-precise-3.8
            - ubuntu-toolchain-r-test
    - env: CXX=clang++-3.8 CC=clang-3.8
      addons:
        apt:
          packages:
            - clang-3.8
            - unzip
          sources: *sources

install:
  - mkdir -p /tmp/tools
  - pushd /tmp/tools
  - if [[ ! -f "cmake-$CMAKE_VERSION_FULL-Linux-x86_64.sh" ]]; then
      curl -SOL "https://cmake.org/files/v$CMAKE_VERSION_PREFIX/cmake-$CMAKE_VERSION_FULL-Linux-x86_64.sh";
      chmod +x "cmake-$CMAKE_VERSION_FULL-Linux-x86_64.sh";
    fi
  - ./"cmake-$CMAKE_VERSION_FULL-Linux-x86_64.sh" --prefix="$HOME" --exclude-subdir --skip-license
  -
  - if [[ ! -f "ninja-$NINJA_VERSION.zip" ]]; then
      curl -SLO "https://github.com/ninja-build/ninja/releases/download/v$NINJA_VERSION/ninja-linux.zip";
      mv "ninja-linux.zip" "ninja-$NINJA_VERSION.zip";
    fi
  - unzip "ninja-$NINJA_VERSION.zip" -d "$HOME/bin"
  - popd

script:
  - cd build
  - cmake -GNinja ..
  - ninja

Install CMake, ninja and whatnot
Install CMake, ninja and whatnot

Make it actually build as well
