]> granicus.if.org Git - graphviz/commitdiff
Add CMake build to Travis
authorErwin Janssen <erwinjanssen@outlook.com>
Tue, 27 Sep 2016 16:45:29 +0000 (18:45 +0200)
committerErwin Janssen <erwinjanssen@outlook.com>
Thu, 19 Jan 2017 11:53:48 +0000 (12:53 +0100)
- 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
ci/autotools-build_and_test.sh [moved from ci/build_and_test.sh with 100% similarity]
ci/centos7/Dockerfile
ci/cmake-build_and_test.sh [new file with mode: 0755]

index 039ae0bf7aad25a5192a3c641dd932f55f378a8c..5cf077ec8f7b510f47c10468c57d970194208d58 100644 (file)
@@ -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:
index 0e3ddbed09f69f856a1db41160db76f456e4095a..54b76060bae16dbe48795273f9e37106fa08978c 100644 (file)
@@ -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 (executable)
index 0000000..0e8a186
--- /dev/null
@@ -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