-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expand file tree
/
Copy pathsetupCommandLine.cmd
More file actions
executable file
·159 lines (146 loc) · 3.61 KB
/
Copy pathsetupCommandLine.cmd
File metadata and controls
executable file
·159 lines (146 loc) · 3.61 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
@echo off
setlocal enabledelayedexpansion
rem setupCommandLine.cmd
rem
rem openFrameworks C++ Libraries command-line build script
rem for Microsoft Visual Studio
rem
rem Usage
rem -----
rem setupCommandLine VS_VERSION [ACTION] [CONFIGURATION] [PLATFORM] [TOOL]
rem VS_VERSION: 100|110|120|140
rem ACTION: build|rebuild|clean
rem CONFIGURATION: release|debug|both
rem PLATFORM: Win32|x64
rem TOOL: devenv|vcexpress|wdexpress|msbuild
echo ///////////////////////////////
echo / openFrameworks build script /
echo ///////////////////////////////
echo.
echo Loading variables
rem VS_VERSION {100 | 110 | 120 | 140}
if "%1"=="" (
echo VS_VERSION is required argument.
)
set VS_VERSION=vs%1
set VS_64_BIT_ENV=VC\bin\x86_amd64\vcvarsx86_amd64.bat
rem PLATFORM [Win32|x64|WinCE|WEC2013]
set PLATFORM=%4
if "%PLATFORM%"=="" (
set PLATFORM=Win32
)
if not %PLATFORM%==Win32 (
if not %PLATFORM%==x64 (
echo Invalid plateform.
goto :EOF
)
)
rem Load Visual C++ Environment
if not defined VCINSTALLDIR (
if %VS_VERSION%==vs100 (
if %PLATFORM%==x64 (
call "%VS100COMNTOOLS%..\..\%VS_64_BIT_ENV%"
) else (
call "%VS100COMNTOOLS%vsvars32.bat"
)
) else (
if %VS_VERSION%==vs110 (
if %PLATFORM%==x64 (
call "%VS110COMNTOOLS%..\..\%VS_64_BIT_ENV%"
) else (
call "%VS110COMNTOOLS%vsvars32.bat"
)
) else (
if %VS_VERSION%==vs120 (
if %PLATFORM%==x64 (
call "%VS120COMNTOOLS%..\..\%VS_64_BIT_ENV%"
) else (
call "%VS120COMNTOOLS%vsvars32.bat
)
) else (
if %VS_VERSION%==vs140 (
if %PLATFORM%==x64 (
call "%VS140COMNTOOLS%..\..\%VS_64_BIT_ENV%"
) else (
call "%VS140COMNTOOLS%vsvars32.bat
)
)
)
)
)
)
if not defined VSINSTALLDIR (
echo Error: No Visual C++ environment found.
echo Please run this script from a Visual Studio Command Prompt
echo or run "%%VSnnCOMNTOOLS%%\vsvars32.bat" first.
goto :EOF
) else (echo Variables loaded)
rem TOOL [devenv|vcexpress|wdexpress|msbuild]
if "%5"=="" (
set BUILD_TOOL=msbuild
) else (
set BUILD_TOOL=%5
)
if %BUILD_TOOL%==msbuild (
if not %VS_VERSION%==vs140 (
if not %VS_VERSION%==vs120 (
if not %VS_VERSION%==vs110 (
if not %VS_VERSION%==vs100 (
echo "Cannot use msbuild with Visual Studio 2008 or earlier."
goto :EOF
)
)
)
)
)
rem ACTION [build|rebuild|clean]
set ACTION=%2
if not %ACTION%==build (
if not %ACTION%==rebuild (
if not "%ACTION%"=="" (
if not %ACTION%==clean (
echo Invalid action.
goto :EOF
)
)
)
)
if "%ACTION%"=="" (set ACTION="build")
rem CONFIGURATION [release|debug|both]
set CONFIGURATION=%3
if not %CONFIGURATION%==release (
if not %CONFIGURATION%==debug (
if not "%CONFIGURATION%"=="" (
if not %CONFIGURATION%==both (
echo Invalid configuration.
goto :EOF
)
)
)
)
echo Environment ready
rem ///////////////
rem / Builder C++ /
rem ///////////////
:builder
for /d %%X in (..\..\examples\*) do (
cd %%X
for /d %%Y in (*) do (
cd %%Y
for %%Z in (*.sln) do (
echo.
echo ++++++++++++++++++++++++++++++++++++
echo ++ Building [%%Z]
echo ++++++++++++++++++++++++++++++++++++
echo.
if "%BUILD_TOOL%"=="msbuild" (
if not "%CONFIGURATION%"=="release" (msbuild %%Z /t:%ACTION% /nologo /noautoresponse /maxcpucount /p:Configuration=Debug)
if not "%CONFIGURATION%"=="debug" (msbuild %%Z /t:%ACTION% /nologo /noautoresponse /maxcpucount /p:Configuration=Release)
) else (
if not "%CONFIGURATION%"=="release" (%BUILD_TOOL% "%CD%\%%X\%%Z" /%ACTION% "Debug|%PLATFORM%" /nologo)
if not "%CONFIGURATION%"=="debug" (%BUILD_TOOL% "%CD%\%%X\%%Z" /%ACTION% "Release|%PLATFORM%" /nologo)
)
)
cd ../
)
)