blob: 4e3b450ba528121b46539962316e4ca354160d66 [file] [log] [blame]
Austin Schuh6c8ec4c2018-01-23 11:18:57 -08001@echo off
2@setlocal EnableDelayedExpansion
3
4if NOT DEFINED MSVC_VERSION set MSVC_VERSION=14
5if NOT DEFINED CMAKE_CONFIG set CMAKE_CONFIG=Release
6if NOT DEFINED PYTHONHOME set PYTHONHOME=C:/Users/%username%/Anaconda3
7
8if "%MSVC_VERSION%"=="14" (
9 if "%processor_architecture%" == "AMD64" (
10 set CMAKE_GENERATOR=Visual Studio 14 2015 Win64
11 ) else (
12 set CMAKE_GENERATOR=Visual Studio 14 2015
13 )
14) else if "%MSVC_VERSION%"=="12" (
15 if "%processor_architecture%" == "AMD64" (
16 set CMAKE_GENERATOR=Visual Studio 12 2013 Win64
17
18 ) else (
19 set CMAKE_GENERATOR=Visual Studio 12 2013
20 )
21)
22
23set batch_file=!VS%MSVC_VERSION%0COMNTOOLS!..\..\VC\vcvarsall.bat
24call "%batch_file%" %processor_architecture%
25
26pushd ..
27pushd examples
28if NOT EXIST build mkdir build
29pushd build
30
31cmake -G"!CMAKE_GENERATOR!" ^
32 -DPYTHONHOME:STRING=%PYTHONHOME%^
33 -DCMAKE_BUILD_TYPE:STRING=%CMAKE_CONFIG% ^
34 %~dp0
35cmake --build . --config %CMAKE_CONFIG%
36
37pushd %CMAKE_CONFIG%
38if not EXIST platforms mkdir platforms
39if EXIST %PYTHONHOME%/Library/plugins/platforms/qwindows.dll ^
40cp %PYTHONHOME%/Library/plugins/platforms/qwindows.dll ./platforms/
41popd
42REM move ./%CMAKE_CONFIG% ../
43popd
44popd
45popd
46@endlocal