os:
  - Visual Studio 2015

platform: x64
  - x64

branches:
  only:
    - master

install:
  - git submodule update --init --recursive
  - set PATH=C:\Program Files\CMake\bin;%PATH%

build:
  verbosity: detailed
  
configuration:
  - Release
  - Debug
  
environment:
  artifactName: $(APPVEYOR_PROJECT_NAME)-$(APPVEYOR_REPO_COMMIT)-$(CONFIGURATION)
  matrix:
    - env_arch: "x64"
    - env_arch: "x86"
    
before_build:
  - mkdir build
  - cd build
  - if [%env_arch%]==[x64] (
      cmake .. -A x64 -DPE2SHC_BUILD_TESTING=ON )
  - if [%env_arch%]==[x86] (
      cmake .. -DPE2SHC_BUILD_TESTING=ON )
  - cmake -DCMAKE_INSTALL_PREFIX:PATH=%APPVEYOR_BUILD_FOLDER%/%APPVEYOR_REPO_COMMIT% ..
  
build_script:
  - cmake --build . --config %CONFIGURATION% --target install 
  - ctest -V

after_build:
  - mkdir %artifactName%
  - cp %APPVEYOR_BUILD_FOLDER%/%APPVEYOR_REPO_COMMIT%/* %artifactName%

artifacts:
  - path: build\%artifactName%
