forked from lava/matplotlib-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWinBuild.cmd
54 lines (49 loc) · 1.53 KB
/
WinBuild.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
@echo off
@setlocal EnableDelayedExpansion
if NOT DEFINED MSVC_VERSION set MSVC_VERSION=15
if NOT DEFINED CMAKE_CONFIG set CMAKE_CONFIG=Release
if NOT DEFINED PYTHONHOME set PYTHONHOME=C:/Users/%username%/Anaconda3
if "%MSVC_VERSION%"=="14" (
if "%processor_architecture%" == "AMD64" (
set CMAKE_GENERATOR=Visual Studio 14 2015 Win64
) else (
set CMAKE_GENERATOR=Visual Studio 14 2015
)
) else if "%MSVC_VERSION%"=="12" (
if "%processor_architecture%" == "AMD64" (
set CMAKE_GENERATOR=Visual Studio 12 2013 Win64
) else (
set CMAKE_GENERATOR=Visual Studio 12 2013
)
) else if "%MSVC_VERSION%"=="15" (
if "%processor_architecture%" == "AMD64" (
set CMAKE_GENERATOR=Visual Studio 15 2017 Win64
) else (
set CMAKE_GENERATOR=Visual Studio 15 2017
)
)
if "%MSVC_VERSION%"=="15" (
set batch_file=!VS%MSVC_VERSION%0COMNTOOLS!..\..\VC\Auxiliary\Build\vcvarsall.bat
) else (
set batch_file=!VS%MSVC_VERSION%0COMNTOOLS!..\..\VC\vcvarsall.bat
)
call "%batch_file%" %processor_architecture%
pushd ..
pushd examples
if NOT EXIST build mkdir build
pushd build
cmake -G"!CMAKE_GENERATOR!" ^
-DPYTHONHOME:STRING=%PYTHONHOME%^
-DCMAKE_BUILD_TYPE:STRING=%CMAKE_CONFIG% ^
%~dp0
cmake --build . --config %CMAKE_CONFIG%
pushd %CMAKE_CONFIG%
if not EXIST platforms mkdir platforms
if EXIST %PYTHONHOME%/Library/plugins/platforms/qwindows.dll ^
cp %PYTHONHOME%/Library/plugins/platforms/qwindows.dll ./platforms/
popd
REM move ./%CMAKE_CONFIG% ../
popd
popd
popd
@endlocal