-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
44 lines (36 loc) · 1.65 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Source: https://github.com/boostorg/hana/blob/master/.travis.yml
# Use C++ build environment
language: cpp
# Protobuf requires g++ (see https://github.com/google/protobuf/blob/master/src/README.md)
compiler:
- gcc
# Cache dependencies to speed up the build.
cache:
directories:
- ${TRAVIS_BUILD_DIR}/deps/cmake
- ${TRAVIS_BUILD_DIR}/deps/protobuf
# Handle dependencies in separate directory
before_install:
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
- mkdir -p "${DEPS_DIR}"
- cd "${DEPS_DIR}"
install:
# Install a recent version of CMake
- |
CMAKE_URL="https://cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.tar.gz"
if [ ! -f ${DEPS_DIR}/cmake/bin/cmake ] ; then mkdir -p cmake ; travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake ; fi
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
# Install a recent version of the Protobuf
- |
PROTOBUF_URL="https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz"
if [ ! -f ${DEPS_DIR}/protobuf/install/bin/protoc ] ; then mkdir -p protobuf ; travis_retry wget --no-check-certificate --quiet -O - ${PROTOBUF_URL} | tar --strip-components=1 -xz -C protobuf ; cd protobuf ; ./configure --prefix=${DEPS_DIR}/protobuf/install ; make ; make install ; fi
export PATH=${DEPS_DIR}/protobuf/install/bin:${PATH}
# Change directory back to default build directory
before_script:
- cd "${TRAVIS_BUILD_DIR}/examples"
# Run the build script
script:
- mkdir -p build
- cd build
- cmake -D CMAKE_PREFIX_PATH:PATH=${DEPS_DIR}/protobuf/install ..
- cmake --build .