branches:
  only:
    - devel

# Build worker image (VM template)
image: Visual Studio 2015

# clone directory
clone_folder: c:\projects\vcglib
# Build Configuration, i.e. Debug, Release, etc.
configuration:
  - release
#  - debug
  
environment:
  matrix:
    # MinGW 32bit
    - QTDIR: C:\Qt\5.6\mingw49_32
      SPEC: win32-g++
      COMPILER: mingw32-make
      #ARTIFACT: $(APPVEYOR_PROJECT_NAME)-%APPVEYOR_REPO_TAG_NAME%.%APPVEYOR_BUILD_NUMBER%-win32.zip
      #ARTIFACT: $(APPVEYOR_PROJECT_NAME)-%APPVEYOR_REPO_TAG_NAME%-win32.zip
    # Microsoft Visual Studio 64bit
    - QTDIR: C:\Qt\5.6\msvc2015_64
      VSVER: 14.0
      SPEC: win32-msvc2015
      COMPILER: nmake
      #ARTIFACT: $(APPVEYOR_PROJECT_NAME)-%APPVEYOR_REPO_TAG_NAME%.%APPVEYOR_BUILD_NUMBER%-win64.zip
      #ARTIFACT: $(APPVEYOR_PROJECT_NAME)-%APPVEYOR_REPO_TAG_NAME%-win64.zip



# Set paths, etc.
before_build:
  # Set paths
  #- '%QTDIR%\bin\qtenv2.bat'
  - call "%QTDIR%\bin\qtenv2.bat"
  # Show qmake and make version
  - qmake -v
  - if %COMPILER%==mingw32-make call %COMPILER% -v
  # Detect architecture (32bit or 64bit)
  - if %QTDIR:_64=%==%QTDIR% (set ARCH=x86) else (set ARCH=x64)
  # Set more... if Microsoft Visual Studio
  - if %COMPILER%==nmake call "%ProgramFiles(x86)%\Microsoft Visual Studio %VSVER%\VC\vcvarsall.bat" %ARCH%
  # Show build folder
  #- echo %APPVEYOR_BUILD_FOLDER%
  #- echo %CONFIGURATION%

# To run your custom scripts instead of automatic MSBuild
build_script:
  # Go to clone directory
  - cd %APPVEYOR_BUILD_FOLDER%
  - cd apps
  - cd sample
  # Run qmake
  - qmake sample.pro -r -spec %SPEC% "CONFIG+=%CONFIGURATION%"
  # Run compiler
  #- '%COMPILER%'
  - call %COMPILER%
