1@echo off
2Setlocal EnableDelayedExpansion
3
4REM This file will build the python source dist 32 bit
5REM
6REM 2011/02/26 Frank Bergmann
7REM
8
9REM ensure visual studio is in the path
10if "%VS_VERSION%"=="" SET VS_VERSION=14
11if "%INCLUDE%"=="" call "%ProgramFiles(x86)%\Microsoft Visual Studio %VS_VERSION%.0\VC\vcvarsall.bat" x86
12
13REM set up directory variables
14SET BASE_DIR=%~dp0
15
16REM check argument
17SET PYTHON_INTERP=%1
18if "%PYTHON_INTERP%" == "" goto MISSING_INTERP
19
20SET DEP_DIR=%2
21if "%DEP_DIR%" == "" SET DEP_DIR=../../../win32/
22
23SET MAJOR=%3
24SET MINOR=%4
25
26SET BUILD_DIR=b32_%MAJOR%%MINOR%
27
28REM goto path
29pushd %BASE_DIR%
30
31REM create build dir
32if not exist %BUILD_DIR% mkdir %BUILD_DIR%
33cd %BUILD_DIR%
34cmake -G "NMake Makefiles"  -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE="%PYTHON_INTERP%" -DDEP_DIR="%DEP_DIR%" ..
35nmake
36
37goto ALL_DONE
38
39:MISSING_INTERP
40echo.
41echo Please provide the python interpreter to use as first argument.
42echo.
43goto ALL_DONE
44
45:ALL_DONE
46popd
47