language: cpp

sudo: false

compiler:
  - clang
  - gcc

addons:
  apt:
    sources:
    - boost-latest
    - ubuntu-toolchain-r-test
    packages:
    - cmake
    - libboost-all-dev
    - g++-4.8

before_install:
  - mkdir ~/cmake_tmp
  - cd ~/cmake_tmp
  - wget --no-check-certificate http://www.cmake.org/files/v3.3/cmake-3.3.2-Linux-x86_64.tar.gz -O cmake3.tar.gz
  - tar xf cmake3.tar.gz -C . --strip-components=1
  - export PATH=~/cmake_tmp/bin:$PATH
  - cd -

before_script:
  - if "$CC" == "gcc"; then export CC='gcc-4.8' && export CXX='g++-4.8'; fi;
  - cmake -G"Unix Makefiles"
  - touch configure
  - chmod +x configure

notifications:
email: false

language: cpp

sudo: false

compiler:
  - clang
  - gcc

addons:
  apt:
    sources:
    - boost-latest
    - ubuntu-toolchain-r-test
    packages:
    - cmake
    - libboost-all-dev
    - g++-4.8

before_install:
  - mkdir ~/cmake_tmp
  - cd ~/cmake_tmp
  - wget --no-check-certificate http://www.cmake.org/files/v3.3/cmake-3.3.2-Linux-x86_64.tar.gz -O cmake3.tar.gz
  - tar xf cmake3.tar.gz -C . --strip-components=1
  - export PATH=~/cmake_tmp/bin:$PATH
  - cd -

before_script:
  - if "$CC" == "clang"; then cmake -G"Unix Makefiles"; fi
  - if "$CC" == "gcc"; then CC='gcc-4.8' CXX='g++-4.8' cmake -G"Unix Makefiles"; fi
  - touch configure
  - chmod +x configure

notifications:
email: false

Define CC and CXX while invoking CMake
Define CC and CXX while invoking CMake