-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmk-cmake.bat
269 lines (252 loc) · 7.56 KB
/
mk-cmake.bat
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
@echo off
rem #
rem # Adam Young, 2021 - 2022.
rem #
rem # This file is part of the aspell-win32.
rem #
rem # Permission is hereby granted, free of charge, to any person obtaining a copy
rem # of this software and associated documentation files (the "Software"), to deal
rem # in the Software without restriction, including without limitation the rights
rem # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
rem # copies of the Software, and to permit persons to whom the Software is
rem # furnished to do so, subject to the following conditions:
rem # The above copyright notice and this permission notice shall be included in all
rem # copies or substantial portions of the Software.
rem #
rem # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
rem # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
rem # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
rem # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
rem # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
rem # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
rem # SOFTWARE.
rem #
set CMAKE="C:/Program Files/cmake/bin/cmake"
set CONFIG=release
set TOOLCHAIN="Visual Studio 14 2015"
set MSVC=vs140
set PRIME=yes
set BUILD=yes
set PACKAGE=no
set DICTIONARY=
set INTERACTIVE=OFF
set X86=yes
set X64=yes
:Arguments
if "%1"=="" goto Continue
if "%1"=="--release" (
set CONFIG=release
shift
goto Arguments
)
if "%1"=="--debug" (
set CONFIG=debug
shift
goto Arguments
)
if "%1"=="--prime" (
set PRIME=yes
set BUILD=no
set PACKAGE=no
shift
goto Arguments
)
if "%1"=="--build" (
set PRIME=no
set BUILD=yes
set PACKAGE=no
shift
goto Arguments
)
if "%1"=="--package" (
set PRIME=no
set BUILD=no
set PACKAGE=yes
shift
goto Arguments
)
if "%1"=="--lang_list" (
set DICTIONARY=dictionary_list
set PRIME=no
set BUILD=no
set PACKAGE=no
shift
goto Arguments
)
if "%1"=="--lang" (
if "%2"=="" goto Help
if "%2"=="ALL" (
set DICTIONARY=dictionaries
) else (
set DICTIONARY=dictionary_%2
)
set PRIME=no
set BUILD=no
set PACKAGE=no
shift
shift
goto Arguments
)
if "%1"=="--also-package" (
set PACKAGE=yes
shift
goto Arguments
)
if "%1"=="--interactive" (
set INTERACTIVE=ON
shift
goto Arguments
)
if "%1"=="-i" (
set INTERACTIVE=ON
shift
goto Arguments
)
if "%1"=="--cmake" (
set CONFIG=Debug
shift
if "%1"=="" goto Help
set CMAKE=%1
shift
goto Arguments
)
if "%1"=="--vs90" (
set TOOLCHAIN="Visual Studio 9 2008"
set MSVC=vs90
set X64=no
shift
goto Arguments
)
if "%1"=="--vs100" (
set TOOLCHAIN="Visual Studio 10 2010"
set MSVC=vs100
set X64=no
shift
goto Arguments
)
if "%1"=="--vs110" (
set TOOLCHAIN="Visual Studio 11 2012"
set MSVC=vs110
shift
goto Arguments
)
if "%1"=="--vs120" (
set TOOLCHAIN="Visual Studio 12 2013"
set MSVC=vs120
shift
goto Arguments
)
if "%1"=="--vs140" (
set TOOLCHAIN="Visual Studio 14 2015"
set MSVC=vs140
shift
goto Arguments
)
if "%1"=="--vs141" (
set TOOLCHAIN="Visual Studio 15 2017"
set MSVC=vs141
shift
goto Arguments
)
if "%1"=="--vs142" (
set TOOLCHAIN="Visual Studio 16 2019"
set MSVC=vs142
shift
goto Arguments
)
if "%1"=="--vs143" (
set TOOLCHAIN="Visual Studio 17 2022"
set MSVC=vs143
shift
goto Arguments
)
if "%1"=="--Win32" (
:Win32
set X86=yes
set X64=no
shift
goto Arguments
)
if "%1"=="--x86" goto Win32
if "%1"=="--x64" (
set X86=no
set X64=yes
shift
goto Arguments
)
if "%1"=="--help" goto Help
if "%1"=="-h" goto Help
if "%1"=="-?" goto Help
echo mk-cmake: invalid argument, %1
:Help
echo #
echo # mk-cmake [--release or --debug] [targets] [--cmake {path}] [--vsxxx]
echo #
echo # Prime Options:
echo # -i, --interactive enable interactive package creation.
echo #
echo # Targets:
echo # --prime prime only.
echo # --build build only.
echo # --also-package also package, with prime or build.
echo # --package package only.
echo # --lang LANG build dictionary for language.
echo # --lang_list list dictionaries.
echo #
echo # Architecture:
echo # --Win32,x86 32-bit only.
echo # --x64 64-bit only.
echo #
echo # Toolchains:
echo # --vs90 Visual Studio 9 2008
echo # --vs100 Visual Studio 10 2010
echo # --vs110 Visual Studio 11 2012
echo # --vs120 Visual Studio 12 2013
echo # --vs140 Visual Studio 14 2015 (default)
echo # --vs141 Visual Studio 15 2017
echo # --vs142 Visual Studio 16 2019
echo # --vs143 Visual Studio 17 2022
echo #
goto exit
:Continue
if "%PRIME%"=="yes" (
if not exist "win32port\gen" (
@pushd win32port
call ./mk-src
call ./mk-static-src
@popd
)
)
if "%X86%"=="yes" (
if "%PRIME%"=="yes" (
%CMAKE% -G %TOOLCHAIN% -A Win32 -S CMakefiles -B "build_win32_%CONFIG%.%MSVC%" -DPACKAGE_INTERACTIVE=%INTERACTIVE%
)
if "%BUILD%"=="yes" (
%CMAKE% --build build_win32_%CONFIG%.%MSVC% --config %CONFIG%
)
if "%PACKAGE%"=="yes" (
%CMAKE% --build build_win32_%CONFIG%.%MSVC% --config %CONFIG% --target package
)
)
if "%X64%"=="yes" (
if "%PRIME%"=="yes" (
%CMAKE% -G %TOOLCHAIN% -A x64 -S CMakefiles -B "build_x64_%CONFIG%.%MSVC%" -DPACKAGE_INTERACTIVE=%INTERACTIVE%
)
if "%BUILD%"=="yes" (
%CMAKE% --build build_x64_%CONFIG%.%MSVC% --config %CONFIG%
)
if "%PACKAGE%"=="yes" (
%CMAKE% --build build_x64_%CONFIG%.%MSVC% --config %CONFIG% --target package
)
)
if NOT "%DICTIONARY%"=="" (
if "%DICTIONARY%"=="dictionary_list" (
%CMAKE% --build build_win32_%CONFIG%.%MSVC% --config %CONFIG% --target %DICTIONARY%
) else (
echo %CMAKE% --build build_win32_%CONFIG%.%MSVC% --config %CONFIG% --target aspell prezip-bin word-list-compress %DICTIONARY%
%CMAKE% --build build_win32_%CONFIG%.%MSVC% --config %CONFIG% --target aspell prezip-bin word-list-compress %DICTIONARY%
)
)
taskkill /IM vctip.exe /f >nul 2>&1
goto Exit
:Exit