
# Enable C++ support.
language: cpp

# Compiler selection.
compiler:
  - gcc
  - clang

install:
  - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
  - mkdir ${DEPS_DIR} && cd ${DEPS_DIR}

  - |
    if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
      CMAKE_URL="http://www.cmake.org/files/v3.5/cmake-3.5.1-Linux-x86_64.tar.gz"
      mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
      export PATH=${DEPS_DIR}/cmake/bin:${PATH}
    fi

  # Go to the Root directory.
  - cd ..

# Build and test steps.
script:
  - mkdir build
  - cd build
  - ${DEPS_DIR}/cmake/bin/cmake .. && make && make test


matrix:
  include:
    language: cpp
    compiler:
      - gcc
      - clang

    install:
      - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
      - mkdir ${DEPS_DIR} && cd ${DEPS_DIR}
      - |
        if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
          CMAKE_URL="http://www.cmake.org/files/v3.5/cmake-3.5.1-Linux-x86_64.tar.gz"
          mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
          export PATH=${DEPS_DIR}/cmake/bin:${PATH}
        fi
      - cd ..

    script:
      - mkdir build
      - cd build
      - ${DEPS_DIR}/cmake/bin/cmake .. && make && make test

Use matrix builds with Travis CI.
Use matrix builds with Travis CI.
