language: cpp

addons:
 apt:
  packages:
   - libqt5core5a
   - qt5-qmake
   - qt5-default
   - libprotobuf-dev
   - libprotoc-dev
   - protobuf-compiler
   - docbook-xsl
   - fop
   - libservlet2.4-java

matrix:
 include:
  - os: linux
    dist: trusty
    sudo: required
    compiler: gcc
  - os: linux
    dist: trusty
    sudo: required
    compiler: clang

before_script:
 - export DOCBOOK_XSL=/usr/share/xml/docbook/stylesheet/docbook-xsl/fo/docbook.xsl
 - export QMAKESPEC=linux-$([[ $CXX = "g++" ]] && echo "g++" || echo "clang")

script:
 - qmake
 - make
 - cd examples
 - make clean
 - make
 - test -s doc/example.html
 - test -s doc/example.md
 - test -s doc/example.docbook
 - test -s doc/example.pdf

language: cpp

addons:
 apt:
  packages:
   - libqt5core5a
   - qt5-qmake
   - qt5-default
   - libprotobuf-dev
   - libprotoc-dev
   - protobuf-compiler
   - docbook-xsl
   - fop
   - libservlet2.4-java

matrix:
 include:
  - os: linux
    dist: trusty
    sudo: required
    compiler: gcc
  - os: linux
    dist: trusty
    sudo: required
    compiler: clang
  - os: osx
    compiler: clang

before_install:
  - '[[ "$TRAVIS_OS_NAME" != "osx" ]] || brew update'
  - '[[ "$TRAVIS_OS_NAME" != "osx" ]] || brew install qt5 protobuf fop docbook-xsl'
  - '[[ "$TRAVIS_OS_NAME" != "osx" ]] || export PROTOBUF_PREFIX=$(brew --prefix protobuf)'

before_script:
 - '[[ "$TRAVIS_OS_NAME" != "linux" ]] || export DOCBOOK_XSL=/usr/share/xml/docbook/stylesheet/docbook-xsl/fo/docbook.xsl'
 - '[[ "$TRAVIS_OS_NAME" != "linux" ]] || export QMAKESPEC=linux'
 - '[[ "$TRAVIS_OS_NAME" != "osx" ]] || export DOCBOOK_XSL=$(brew --prefix docbook-xsl)/fo/docbook.xsl'
 - '[[ "$TRAVIS_OS_NAME" != "osx" ]] || export QMAKESPEC=macx'
 - 'export QMAKESPEC=$(QMAKESPEC)-$([[ $CXX = "g++" ]] && echo "g++" || echo "clang")'

script:
 - qmake
 - make
 - cd examples
 - make clean
 - make
 - test -s doc/example.html
 - test -s doc/example.md
 - test -s doc/example.docbook
 - test -s doc/example.pdf

Add building on OS X
Add building on OS X
