I'm using this snippet to pre-install a desired compiler version inside a travis Virtual Machine
- os: linux
compiler: clang
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.5']
packages: ['clang-3.5']
env: COMPILER=clang++-3.5
This has the advantage of running the build inside a machine without using sudo
which results in a faster build.
How do I use that to install cmake 2.8.12 (or more recent) both on linux and osx when using travis? I tried
- os: linux
compiler: clang
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.5', 'add-apt-repository']
packages: ['clang-3.5', 'ppa:kalakris/cmake']
env: COMPILER=clang++-3.5
without success
To install cmake from kalakris, use:
addons:
apt:
packages:
- cmake
sources:
- kalakris-cmake
For a more recent CMake (from https://github.com/ldionne/hana/blob/master/.travis.yml)
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
CMAKE_URL="http://www.cmake.org/files/v3.3/cmake-3.3.1-Linux-x86_64.tar.gz"
mkdir cmake && travis_retry wget --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
else
brew install cmake
fi
A full snippet in your case is:
- os: linux
compiler: clang
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.7', 'kalakris-cmake']
packages: ['clang-3.7', 'cmake']
env: COMPILER=clang++-3.7
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With