Travis CI, update CMake using package cache

I actually use this snippet to preinstall the desired compiler version inside the 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 starting assembly inside the machine without using sudo , which leads to faster assembly.

How to use this to install cmake 2.8.12 (or later) on both 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

+5
source share
1 answer

To install cmake from kalakris, use:

 addons: apt: packages: - cmake sources: - kalakris-cmake 

For a later 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 

Full snippet in your case:

  - 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 
+8
source

Source: https://habr.com/ru/post/1233955/


All Articles