From a32ac2b2645af2e37e7eeb32e66857c3a2a4f276 Mon Sep 17 00:00:00 2001 From: Erwin Janssen Date: Tue, 27 Sep 2016 18:45:29 +0200 Subject: [PATCH] Add CMake build to Travis - Add CMake installation to Centos 7 dockerfile - New build script for CMake - Add `BUILD_SYSTEM` variable to Travis: perform Autotools and CMake build, both on native Travis and Docker. --- .travis.yml | 16 +++++++++++--- ...nd_test.sh => autotools-build_and_test.sh} | 0 ci/centos7/Dockerfile | 4 ++-- ci/cmake-build_and_test.sh | 21 +++++++++++++++++++ 4 files changed, 36 insertions(+), 5 deletions(-) rename ci/{build_and_test.sh => autotools-build_and_test.sh} (100%) create mode 100755 ci/cmake-build_and_test.sh diff --git a/.travis.yml b/.travis.yml index 039ae0bf7..5cf077ec8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,17 @@ services: env: - DOCKER_BUILD=FALSE + BUILD_SYSTEM=autotools + +- DOCKER_BUILD=FALSE + BUILD_SYSTEM=cmake + - DOCKER_BUILD=TRUE + BUILD_SYSTEM=autotools + +- DOCKER_BUILD=TRUE + BUILD_SYSTEM=cmake + install: # Enable colored gcc output @@ -35,8 +45,8 @@ install: script: - cd ${TRAVIS_BUILD_DIR} -- if [ ${DOCKER_BUILD} == "FALSE" ] ; then sudo ./ci/build_and_test.sh ; fi -- if [ ${DOCKER_BUILD} == "TRUE" ] ; then docker run --rm -v `pwd`:/graphviz -w /graphviz -i -t centos7-build-env bash "ci/build_and_test.sh" ; fi +- if [ ${DOCKER_BUILD} == "FALSE" ] ; then sudo ./ci/${BUILD_SYSTEM}-build_and_test.sh ; fi +- if [ ${DOCKER_BUILD} == "TRUE" ] ; then docker run --rm -v `pwd`:/graphviz -w /graphviz -i -t centos7-build-env bash "ci/${BUILD_SYSTEM}-build_and_test.sh" ; fi before_deploy: - export DEPLOYED_FILE=$(ls *.tar.gz) @@ -54,7 +64,7 @@ deploy: file: "${DEPLOYED_FILE}" on: repo: ellson/graphviz - condition: ${DOCKER_BUILD} == "FALSE" + condition: ${DOCKER_BUILD} == "FALSE" && ${BUILD_SYSTEM} == "autotools" notifications: email: diff --git a/ci/build_and_test.sh b/ci/autotools-build_and_test.sh similarity index 100% rename from ci/build_and_test.sh rename to ci/autotools-build_and_test.sh diff --git a/ci/centos7/Dockerfile b/ci/centos7/Dockerfile index 0e3ddbed0..54b76060b 100644 --- a/ci/centos7/Dockerfile +++ b/ci/centos7/Dockerfile @@ -3,8 +3,8 @@ FROM centos:7 # Install Development tools RUN yum -y groupinstall 'Development Tools' -# Instal autotools utilities -RUN yum -y install libtool-ltdl-devel ghostscript swig ksh tcl +# Instal build utilities +RUN yum -y install libtool-ltdl-devel ghostscript swig ksh tcl cmake # Install dependencies RUN yum -y install gd gd-devel qt-devel diff --git a/ci/cmake-build_and_test.sh b/ci/cmake-build_and_test.sh new file mode 100755 index 000000000..0e8a18620 --- /dev/null +++ b/ci/cmake-build_and_test.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +# Run this script from the root source directory + +mkdir build || true + +cd build + +if cmake .. ; then + echo "'cmake ..' succesfull." +else + echo "Error: 'cmake ..' failed." >&2 + exit 1 +fi + +if cmake --build . ; then + echo "'cmake --build .' succesfull." +else + echo "Error: 'cmake --build .' failed." >&2 + exit 1 +fi -- 2.40.0