env:
  global:
   # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
   #   via the "travis encrypt" command using the project repo's public key
   - secure: " "

matrix:
  fast_finish: true
  include:
    #Linux build
    - os: linux
      dist: trusty
      language: cpp
      env:
         #- LLVM_VERSION=3.8
      sudo: false
      cache:
        apt: true
        directories:
          - $HOME/.ccache
      compiler:
          #- clang
          - gcc
      addons:
        coverity_scan:
          project:
            name: "openscenegraph/OpenSceneGraph"
            description: "OpenSceneGraph build"
          notification_email: robert@openscenegraph.com
          build_command_prepend: "cmake -DCMAKE_BUILD_TYPE=Release ."
          build_command:   "make -j 3"
          branch_pattern: coverity_scan
        apt:
          sources:
            #- llvm-toolchain-precise-3.8
            - ubuntu-toolchain-r-test
          packages:
            #- clang-3.8
            - g++
            - cmake

    # OSX build
    - os: osx
      language: cpp

# script:
#    - mkdir build
#    - cd build
#    - travis_wait 60 cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../product -DBUILD_OSG_EXAMPLES=ON ..
#    - make install -j 3

script:
    - if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then mkdir build && cd build && travis_wait 60 cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../product -DBUILD_OSG_EXAMPLES=ON ../ && make -j3 ; fi
