1environment:
2  ARMADILLO_DOWNLOAD: "http://ftp.fau.de/macports/distfiles/armadillo/armadillo-8.400.0.tar.xz"
3  BLAS_LIBRARY: "%APPVEYOR_BUILD_FOLDER%/OpenBLAS.0.2.14.1/lib/native/lib/x64/libopenblas.dll.a"
4  BLAS_LIBRARY_DLL: "%APPVEYOR_BUILD_FOLDER%/OpenBLAS.0.2.14.1/lib/native/lib/x64/libopenblas.dll"
5
6  matrix:
7    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
8      VSVER: Visual Studio 14 2015 Win64
9      MSBUILD: C:\Program Files (x86)\MSBuild\14.0\bin\MSBuild.exe
10
11    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
12      VSVER: Visual Studio 15 2017 Win64
13      MSBUILD: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe
14
15    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
16      VSVER: Visual Studio 16 2019
17      MSBUILD: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe
18
19configuration: Release
20
21install:
22  - ps: nuget install OpenBLAS -o "${env:APPVEYOR_BUILD_FOLDER}"
23
24build_script:
25  # First, download and build Armadillo.
26  - cd ..
27  - appveyor DownloadFile %ARMADILLO_DOWNLOAD% -FileName armadillo.tar.xz
28  - 7z x armadillo.tar.xz -so -txz | 7z x -si -ttar > nul
29  - cd armadillo-8.400.0 && mkdir build && cd build
30  - >
31    cmake -G "%VSVER%"
32    -DBLAS_LIBRARY:FILEPATH=%BLAS_LIBRARY%
33    -DLAPACK_LIBRARY:FILEPATH=%BLAS_LIBRARY%
34    -DCMAKE_PREFIX:FILEPATH="%APPVEYOR_BUILD_FOLDER%/armadillo"
35    -DBUILD_SHARED_LIBS=OFF
36    -DCMAKE_BUILD_TYPE=Release ..
37  - >
38    "%MSBUILD%" "armadillo.sln"
39    /m /verbosity:quiet /p:Configuration=Release;Platform=x64
40  - cd ../..
41
42  # Now build ensmallen.
43  - cd ensmallen && mkdir build && cd build
44  - >
45    cmake -G "%VSVER%"
46    -DARMADILLO_INCLUDE_DIR=%APPVEYOR_BUILD_FOLDER%/../armadillo-8.400.0/include/
47    -DARMADILLO_LIBRARIES=%BLAS_LIBRARY%
48    -DLAPACK_LIBRARY=%BLAS_LIBRARY%
49    -DBLAS_LIBRARY=%BLAS_LIBRARY%
50    -DCMAKE_BUILD_TYPE=Release ..
51  - >
52    "%MSBUILD%" "ensmallen.sln"
53    /m /verbosity:minimal /nologo /p:BuildInParallel=true
54
55  # Run tests after copying libraries.
56  - ps: cp C:\projects\ensmallen\OpenBLAS.0.2.14.1\lib\native\bin\x64\*.* C:\projects\ensmallen\build\
57  - ctest -C Release -V --output-on-failure .
58