From 8e1a4799acff54ea9e836cdd71f824b4defc5b78 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Fri, 7 Oct 2016 14:02:02 +0200 Subject: [PATCH] Add CMake to Travis-CI --- .travis.yml | 7 ++++ build/tools/travis-ci.sh | 84 +++++++++++++++++++++++++++------------- 2 files changed, 64 insertions(+), 27 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6a50afe28e..295fed8f7c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,13 @@ sudo: required matrix: include: + - dist: trusty + compiler: gcc + env: wxTOOLSET=cmake wxCMAKE_GENERATOR="Unix Makefiles" + - os: osx + osx_image: beta-xcode6.2 + compiler: clang + env: wxTOOLSET=cmake wxCMAKE_GENERATOR=Xcode wxCMAKE_DEFINES="-DCMAKE_CXX_STANDARD=11" - compiler: gcc - compiler: gcc env: wxCONFIGURE_FLAGS="--disable-precomp-headers --enable-monolithic" diff --git a/build/tools/travis-ci.sh b/build/tools/travis-ci.sh index d8638a22d0..c063db13bc 100755 --- a/build/tools/travis-ci.sh +++ b/build/tools/travis-ci.sh @@ -4,30 +4,60 @@ set -e -echo 'travis_fold:start:configure' -echo 'Configuring...' -./configure --disable-optimise $wxCONFIGURE_FLAGS -echo 'travis_fold:end:configure' -echo 'travis_fold:start:building' -echo 'Building...' -make -echo 'travis_fold:end:building' -echo 'travis_fold:start:testing' -echo 'Testing...' -make -C tests -pushd tests -./test -t -popd -echo 'travis_fold:end:testing' -echo 'travis_fold:start:samples' -echo 'Building the samples...' -make samples -echo 'travis_fold:end:samples' -echo 'travis_fold:start:installing' -echo 'Installing...' -sudo make install -echo 'travis_fold:end:installing' -echo 'travis_fold:start:test_install' -echo 'Testing building with the installed version...' -make -C samples/minimal -f makefile.unx $wxMAKEFILE_FLAGS -echo 'travis_fold:end:test_install' +case $wxTOOLSET in + cmake) + if [ `uname -s` = "Linux" ] && [ `lsb_release -cs` = "precise" ]; then + echo Updating CMake... + wget -O - https://cmake.org/files/v3.6/cmake-3.6.2-Linux-x86_64.tar.gz | tar xzf - + export PATH=`pwd`/cmake-3.6.2-Linux-x86_64/bin:$PATH + fi + + if [ -z $wxCMAKE_TESTS ]; then wxCMAKE_TESTS=CONSOLE_ONLY; fi + cmake --version + echo 'travis_fold:start:configure' + echo 'Configuring...' + mkdir build_cmake + pushd build_cmake + cmake -G "$wxCMAKE_GENERATOR" $wxCMAKE_DEFINES -D wxBUILD_SAMPLES=SOME -D wxBUILD_TESTS=$wxCMAKE_TESTS .. + echo 'travis_fold:end:configure' + echo 'travis_fold:start:building' + echo 'Building...' + cmake --build . + echo 'travis_fold:end:building' + if [ "$wxCMAKE_TESTS" != "OFF" ]; then + echo 'travis_fold:start:testing' + echo 'Testing...' + ctest . -C Debug -V --output-on-failure + echo 'travis_fold:end:testing' + fi + ;; + *) + echo 'travis_fold:start:configure' + echo 'Configuring...' + ./configure --disable-optimise $wxCONFIGURE_FLAGS + echo 'travis_fold:end:configure' + echo 'travis_fold:start:building' + echo 'Building...' + make + echo 'travis_fold:end:building' + echo 'travis_fold:start:testing' + echo 'Testing...' + make -C tests + pushd tests + ./test -t + popd + echo 'travis_fold:end:testing' + echo 'travis_fold:start:samples' + echo 'Building the samples...' + make samples + echo 'travis_fold:end:samples' + echo 'travis_fold:start:installing' + echo 'Installing...' + sudo make install + echo 'travis_fold:end:installing' + echo 'travis_fold:start:test_install' + echo 'Testing building with the installed version...' + make -C samples/minimal -f makefile.unx $wxMAKEFILE_FLAGS + echo 'travis_fold:end:test_install' + ;; +esac