image: ubuntu:latest

before_script:
  - apt-get -yqq update
  - apt-get -yqq install cmake
                         git
                         build-essential
                         qt5-default
                         libboost-dev
                         libqt5scintilla2-dev
                         libavcodec-dev
                         libavdevice-dev
                         libavfilter-dev
                         libavformat-dev
                         libavresample-dev
                         libavutil-dev
                         libswscale-dev
                         libnetcdf-dev
                         libfftw3-dev
                         libhdf5-dev
                         libhdf5-serial-dev
                         libbotan1.10-dev
                         libmuparser-dev
                         libqwt-qt5-dev
                         python3-dev
                         python3-sphinx
                         python3-numpy
                         python3-sip
                         python3-pyqt5
                         python3-matplotlib
                         python-dev
                         python-sphinx
                         python-numpy
                         python-sip
                         python-pyqt5
                         python-matplotlib
                         xsltproc
                         docbook-xml
                         povray
                         linkchecker

build_linux_python3:
   stage: build
   tags:
      - linux
   script:
      - mkdir build
      - cd build
      - cmake
           -DCMAKE_BUILD_TYPE=Debug
           -DOVITO_BUILD_DOCUMENTATION=ON
           -DPYTHON_EXECUTABLE=/usr/bin/python3.5
           -DPYTHON_INCLUDE_DIR=/usr/include/python3.5m
           -DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.5m.so
           -DCMAKE_INSTALL_PREFIX=../install
           ..
      - make -j4 install
      - ctest --output-on-failure
      - linkchecker --check-extern ../install/share/ovito/doc/manual/html/index.html
           --ignore-url=https://dx.doi.org/10.1088/0965-0393/24/5/055007
           --ignore-url=http://stacks.iop.org/0965-0393/18/015012
           --ignore-url=http://dx.doi.org/10.1088/0965-0393/20/3/035012
           --ignore-url=http://dx.doi.org/10.1088/0965-0393/20/4/045021
           --ignore-url=http://dx.doi.org/10.1038/nature04421

build_linux_python2:
   stage: build
   tags:
      - linux
   script:
      - mkdir build
      - cd build
      - cmake
           -DCMAKE_BUILD_TYPE=Debug
           -DOVITO_BUILD_DOCUMENTATION=ON
           -DPYTHON_EXECUTABLE=/usr/bin/python2.7
           -DPYTHON_INCLUDE_DIR=/usr/include/python2.7
           -DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython2.7.so
           -DCMAKE_INSTALL_PREFIX=../install
           ..
      - make -j4 install
      - ctest --output-on-failure
