Austin Schuh | 6c8ec4c | 2018-01-23 11:18:57 -0800 | [diff] [blame^] | 1 | @echo off |
| 2 | @setlocal EnableDelayedExpansion |
| 3 | |
| 4 | if NOT DEFINED MSVC_VERSION set MSVC_VERSION=14 |
| 5 | if NOT DEFINED CMAKE_CONFIG set CMAKE_CONFIG=Release |
| 6 | if NOT DEFINED PYTHONHOME set PYTHONHOME=C:/Users/%username%/Anaconda3 |
| 7 | |
| 8 | if "%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 | |
| 23 | set batch_file=!VS%MSVC_VERSION%0COMNTOOLS!..\..\VC\vcvarsall.bat |
| 24 | call "%batch_file%" %processor_architecture% |
| 25 | |
| 26 | pushd .. |
| 27 | pushd examples |
| 28 | if NOT EXIST build mkdir build |
| 29 | pushd build |
| 30 | |
| 31 | cmake -G"!CMAKE_GENERATOR!" ^ |
| 32 | -DPYTHONHOME:STRING=%PYTHONHOME%^ |
| 33 | -DCMAKE_BUILD_TYPE:STRING=%CMAKE_CONFIG% ^ |
| 34 | %~dp0 |
| 35 | cmake --build . --config %CMAKE_CONFIG% |
| 36 | |
| 37 | pushd %CMAKE_CONFIG% |
| 38 | if not EXIST platforms mkdir platforms |
| 39 | if EXIST %PYTHONHOME%/Library/plugins/platforms/qwindows.dll ^ |
| 40 | cp %PYTHONHOME%/Library/plugins/platforms/qwindows.dll ./platforms/ |
| 41 | popd |
| 42 | REM move ./%CMAKE_CONFIG% ../ |
| 43 | popd |
| 44 | popd |
| 45 | popd |
| 46 | @endlocal |