-
Notifications
You must be signed in to change notification settings - Fork 12
/
BuildAll.bat
488 lines (406 loc) · 33.8 KB
/
BuildAll.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
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
@echo off
REM
REM This source file is part of appleseed.
REM Visit https://appleseedhq.net/ for additional information and resources.
REM
REM This software is released under the MIT license.
REM
REM Copyright (c) 2014-2019 Francois Beaune, The appleseedhq Organization
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
REM The above copyright notice and this permission notice shall be included in
REM all 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
REM THE SOFTWARE.
REM
setlocal
if not defined VCINSTALLDIR (
echo Please run this batch file from a Visual Studio Native Tools Command Prompt.
goto end
)
set root=%~dp0
set root_fwd_slashes=%root:\=/%
set generator=%1
set boost_root=%2
set qt_root_path=%3
set python_include_dir=%4
set python_library=%5
if [%generator%] == [] goto syntax
if [%boost_root%] == [] goto syntax
if [%qt_root_path%] == [] goto syntax
if [%python_include_dir%] == [] goto syntax
if [%python_library%] == [] goto syntax
if [%generator%] == ["Visual Studio 14 2015 Win64"] (
set platform=vc140
goto start
)
if [%generator%] == ["Visual Studio 15 2017 Win64"] (
set platform=vc141
goto start
)
:syntax
echo Syntax:
echo %~n0%~x0 ^<cmake-generator^> ^<boost-root^> ^<qt-root-path^> ^<python-include-dir^> ^<python-library^>
echo.
echo Supported values for ^<cmake-generator^>:
echo "Visual Studio 14 2015 Win64"
echo "Visual Studio 15 2017 Win64"
echo.
echo Example:
echo %~n0%~x0 "Visual Studio 15 2017 Win64" C:\dev\boost_1_69_0 C:\dev\qt\5.12.2\msvc2017_64 C:\Python27\include C:\Python27\libs\python27.lib
goto end
:start
echo Build configuration:
echo.
echo generator ............ %generator%
echo platform ............. %platform%
echo root ................. %root% (%root_fwd_slashes%)
echo boost_root ........... %boost_root%
echo qt_root_path ......... %qt_root_path%
echo python_include_dir ... %python_include_dir%
echo python_library ....... %python_library%
echo.
set src=%root%src
set devenv=call %root%tools\devenv-wrapper.bat
set redirect=^>^> BUILDLOG.txt 2^>^&1
mkdir %root%build\%platform% 2>nul
type nul > %root%build\%platform%\BUILDLOG.txt
REM ===============================================================================
:xercesc
echo %time% ^| [ 1/14] Building Xerces-C...
mkdir %root%build\%platform%\xerces-c-debug 2>nul
pushd %root%build\%platform%\xerces-c-debug
echo === Xerces-C (Debug) ========================================================== > BUILDLOG.txt
cmake -Wno-dev -G %generator% -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=%root%stage\%platform%\xerces-c-debug %src%\xerces-c %redirect%
%devenv% xerces-c.sln /build Debug /project INSTALL %redirect%
copy src\xerces-c.dir\Debug\*.pdb %root%stage\%platform%\xerces-c-debug\lib %redirect%
type BUILDLOG.txt >> %root%build\%platform%\BUILDLOG.txt
popd
mkdir %root%build\%platform%\xerces-c-release 2>nul
pushd %root%build\%platform%\xerces-c-release
echo === Xerces-C (Release) ======================================================== > BUILDLOG.txt
cmake -Wno-dev -G %generator% -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=%root%stage\%platform%\xerces-c-release %src%\xerces-c %redirect%
%devenv% xerces-c.sln /build Release /project INSTALL %redirect%
type BUILDLOG.txt >> %root%build\%platform%\BUILDLOG.txt
popd
REM ===============================================================================
:llvm
echo %time% ^| [ 2/14] Building LLVM...
mkdir %root%build\%platform%\llvm-debug 2>nul
pushd %root%build\%platform%\llvm-debug
echo === LLVM (Debug) ============================================================== > BUILDLOG.txt
cmake -Wno-dev -G %generator% -Thost=x64 -DCMAKE_BUILD_TYPE=Debug -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON -DLLVM_ENABLE_EH=ON -DLLVM_ENABLE_RTTI=ON -DCMAKE_INSTALL_PREFIX=%root%stage\%platform%\llvm-debug %src%\llvm %redirect%
%devenv% llvm.sln /build Debug /project INSTALL %redirect%
for /R lib\ %%f in (*.pdb) do @copy /Y "%%f" %root%stage\%platform%\llvm-debug\lib %redirect%
type BUILDLOG.txt >> %root%build\%platform%\BUILDLOG.txt
popd
mkdir %root%build\%platform%\llvm-release 2>nul
pushd %root%build\%platform%\llvm-release
echo === LLVM (Release) ============================================================ > BUILDLOG.txt
cmake -Wno-dev -G %generator% -Thost=x64 -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON -DLLVM_ENABLE_EH=ON -DLLVM_ENABLE_RTTI=ON -DCMAKE_INSTALL_PREFIX=%root%stage\%platform%\llvm-release %src%\llvm %redirect%
%devenv% llvm.sln /build Release /project INSTALL %redirect%
type BUILDLOG.txt >> %root%build\%platform%\BUILDLOG.txt
popd
REM ===============================================================================
:zlib
echo %time% ^| [ 3/14] Building zlib...
mkdir %root%build\%platform%\zlib-debug 2>nul
pushd %root%build\%platform%\zlib-debug
echo === zlib (Debug) ============================================================== > BUILDLOG.txt
cmake -Wno-dev -G %generator% -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=%root%stage\%platform%\zlib-debug %src%\zlib %redirect%
%devenv% zlib.sln /build Debug /project INSTALL %redirect%
ren %src%\zlib\zconf.h.included zconf.h
copy zlibstatic.dir\Debug\*.pdb %root%stage\%platform%\zlib-debug\lib %redirect%
type BUILDLOG.txt >> %root%build\%platform%\BUILDLOG.txt
popd
mkdir %root%build\%platform%\zlib-release 2>nul
pushd %root%build\%platform%\zlib-release
echo === zlib (Release) ============================================================ > BUILDLOG.txt
cmake -Wno-dev -G %generator% -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%root%stage\%platform%\zlib-release %src%\zlib %redirect%
%devenv% zlib.sln /build Release /project INSTALL %redirect%
ren %src%\zlib\zconf.h.included zconf.h
type BUILDLOG.txt >> %root%build\%platform%\BUILDLOG.txt
popd
REM ===============================================================================
:libpng
echo %time% ^| [ 4/14] Building libpng...
mkdir %root%build\%platform%\libpng-debug 2>nul
pushd %root%build\%platform%\libpng-debug
echo === libpng (Debug) ============================================================ > BUILDLOG.txt
cmake -Wno-dev -G %generator% -DCMAKE_BUILD_TYPE=Debug -DZLIB_INCLUDE_DIR=%root%stage\%platform%\zlib-debug\include -DZLIB_LIBRARY=%root%stage\%platform%\zlib-debug\lib\zlibstaticd.lib -DCMAKE_INSTALL_PREFIX=%root%stage\%platform%\libpng-debug %src%\libpng %redirect%
%devenv% libpng.sln /build Debug /project INSTALL %redirect%
copy png16_static.dir\Debug\*.pdb %root%stage\%platform%\libpng-debug\lib %redirect%
type BUILDLOG.txt >> %root%build\%platform%\BUILDLOG.txt
popd
mkdir %root%build\%platform%\libpng-release 2>nul
pushd %root%build\%platform%\libpng-release
echo === libpng (Release) ========================================================== > BUILDLOG.txt
cmake -Wno-dev -G %generator% -DCMAKE_BUILD_TYPE=Release -DZLIB_INCLUDE_DIR=%root%stage\%platform%\zlib-release\include -DZLIB_LIBRARY=%root%stage\%platform%\zlib-release\lib\zlibstatic.lib -DCMAKE_INSTALL_PREFIX=%root%stage\%platform%\libpng-release %src%\libpng %redirect%
%devenv% libpng.sln /build Release /project INSTALL %redirect%
type BUILDLOG.txt >> %root%build\%platform%\BUILDLOG.txt
popd
REM ===============================================================================
:libjpeg
echo %time% ^| [ 5/14] Building libjpeg-turbo...
mkdir %root%build\%platform%\libjpeg-turbo-debug 2>nul
pushd %root%build\%platform%\libjpeg-turbo-debug
echo === libjpeg-turbo (Debug) ===================================================== > BUILDLOG.txt
cmake -Wno-dev -G %generator% -DCMAKE_BUILD_TYPE=Debug -DWITH_SIMD=OFF -DCMAKE_INSTALL_PREFIX=%root%stage\%platform%\libjpeg-turbo-debug %src%\libjpeg-turbo %redirect%
%devenv% libjpeg-turbo.sln /build Debug /project INSTALL %redirect%
copy jpeg-static.dir\Debug\*.pdb %root%stage\%platform%\libjpeg-turbo-debug\lib %redirect%
copy turbojpeg-static.dir\Debug\*.pdb %root%stage\%platform%\libjpeg-turbo-debug\lib %redirect%
type BUILDLOG.txt >> %root%build\%platform%\BUILDLOG.txt
popd
mkdir %root%build\%platform%\libjpeg-turbo-release 2>nul
pushd %root%build\%platform%\libjpeg-turbo-release
echo === libjpeg-turbo (Release) =================================================== > BUILDLOG.txt
cmake -Wno-dev -G %generator% -DCMAKE_BUILD_TYPE=Release -DWITH_SIMD=OFF -DCMAKE_INSTALL_PREFIX=%root%stage\%platform%\libjpeg-turbo-release %src%\libjpeg-turbo %redirect%
%devenv% libjpeg-turbo.sln /build Release /project INSTALL %redirect%
type BUILDLOG.txt >> %root%build\%platform%\BUILDLOG.txt
popd
REM ===============================================================================
:libtiff
echo %time% ^| [ 6/14] Building libtiff...
mkdir %root%build\%platform%\libtiff-debug 2>nul
pushd %root%build\%platform%\libtiff-debug
echo === libtiff (Debug) =========================================================== > BUILDLOG.txt
xcopy /E /Q /Y %src%\libtiff\*.* . %redirect%
copy /Y nmake-debug.opt nmake.opt %redirect%
nmake -f Makefile.vc JPEG_SUPPORT=1 JPEGDIR=%root%stage\%platform%\libjpeg-turbo-debug JPEG_INCLUDE=-I%root%stage\%platform%\libjpeg-turbo-debug\include JPEG_LIB=%root%stage\%platform%\libjpeg-turbo-debug\lib\jpeg-static.lib ZIP_SUPPORT=1 ZLIBDIR=%root%stage\%platform%\zlib-debug ZLIB_INCLUDE=-I%root%stage\%platform%\zlib-debug\include ZLIB_LIB=%root%stage\%platform%\zlib-debug\lib\zlibstaticd.lib %redirect%
mkdir %root%stage\%platform%\libtiff-debug\lib %redirect%
mkdir %root%stage\%platform%\libtiff-debug\include %redirect%
copy libtiff\libtiff.lib %root%stage\%platform%\libtiff-debug\lib %redirect%
copy libtiff\libtiff.pdb %root%stage\%platform%\libtiff-debug\lib %redirect%
copy libtiff\*.h %root%stage\%platform%\libtiff-debug\include %redirect%
type BUILDLOG.txt >> %root%build\%platform%\BUILDLOG.txt
popd
mkdir %root%build\%platform%\libtiff-release 2>nul
pushd %root%build\%platform%\libtiff-release
echo === libtiff (Release) ========================================================= > BUILDLOG.txt
xcopy /E /Q /Y %src%\libtiff\*.* . %redirect%
copy /Y nmake-release.opt nmake.opt %redirect%
nmake -f Makefile.vc JPEG_SUPPORT=1 JPEGDIR=%root%stage\%platform%\libjpeg-turbo-release JPEG_INCLUDE=-I%root%stage\%platform%\libjpeg-turbo-release\include JPEG_LIB=%root%stage\%platform%\libjpeg-turbo-release\lib\jpeg-static.lib ZIP_SUPPORT=1 ZLIBDIR=%root%stage\%platform%\zlib-release ZLIB_INCLUDE=-I%root%stage\%platform%\zlib-release\include ZLIB_LIB=%root%stage\%platform%\zlib-release\lib\zlibstatic.lib %redirect%
mkdir %root%stage\%platform%\libtiff-release\lib %redirect%
mkdir %root%stage\%platform%\libtiff-release\include %redirect%
copy libtiff\libtiff.lib %root%stage\%platform%\libtiff-release\lib %redirect%
copy libtiff\*.h %root%stage\%platform%\libtiff-release\include %redirect%
type BUILDLOG.txt >> %root%build\%platform%\BUILDLOG.txt
popd
REM ===============================================================================
:ilmbase
echo %time% ^| [ 7/14] Building ilmbase...
mkdir %root%build\%platform%\ilmbase-debug 2>nul
pushd %root%build\%platform%\ilmbase-debug
echo === ilmbase (Debug) =========================================================== > BUILDLOG.txt
cmake -Wno-dev -G %generator% -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=%root%stage\%platform%\ilmbase-debug %src%\ilmbase %redirect%
%devenv% ilmbase.sln /build Debug /project INSTALL %redirect%
copy Half\Half.dir\Debug\*.pdb %root%stage\%platform%\ilmbase-debug\lib %redirect%
copy Iex\Iex.dir\Debug\*.pdb %root%stage\%platform%\ilmbase-debug\lib %redirect%
copy IexMath\IexMath.dir\Debug\*.pdb %root%stage\%platform%\ilmbase-debug\lib %redirect%
copy IlmThread\IlmThread.dir\Debug\*.pdb %root%stage\%platform%\ilmbase-debug\lib %redirect%
copy Imath\Imath.dir\Debug\*.pdb %root%stage\%platform%\ilmbase-debug\lib %redirect%
type BUILDLOG.txt >> %root%build\%platform%\BUILDLOG.txt
popd
mkdir %root%build\%platform%\ilmbase-release 2>nul
pushd %root%build\%platform%\ilmbase-release
echo === ilmbase (Release) ========================================================= > BUILDLOG.txt
cmake -Wno-dev -G %generator% -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=%root%stage\%platform%\ilmbase-release %src%\ilmbase %redirect%
%devenv% ilmbase.sln /build Release /project INSTALL %redirect%
type BUILDLOG.txt >> %root%build\%platform%\BUILDLOG.txt
popd
REM ===============================================================================
:openexr
echo %time% ^| [ 8/14] Building OpenEXR...
mkdir %root%build\%platform%\openexr-debug 2>nul
pushd %root%build\%platform%\openexr-debug
echo === OpenEXR (Debug) =========================================================== > BUILDLOG.txt
cmake -Wno-dev -G %generator% -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=OFF -DILMBASE_PACKAGE_PREFIX=%root%stage\%platform%\ilmbase-debug -DZLIB_INCLUDE_DIR=%root%stage\%platform%\zlib-debug\include -DZLIB_LIBRARY=%root%stage\%platform%\zlib-debug\lib\zlibstaticd.lib -DCMAKE_INSTALL_PREFIX=%root%stage\%platform%\openexr-debug %src%\openexr %redirect%
%devenv% openexr.sln /build Debug /project INSTALL %redirect%
copy IlmImf\IlmImf.dir\Debug\*.pdb %root%stage\%platform%\openexr-debug\lib %redirect%
copy IlmImfUtil\IlmImfUtil.dir\Debug\*.pdb %root%stage\%platform%\openexr-debug\lib %redirect%
type BUILDLOG.txt >> %root%build\%platform%\BUILDLOG.txt
popd
mkdir %root%build\%platform%\openexr-release 2>nul
pushd %root%build\%platform%\openexr-release
echo === OpenEXR (Release) ========================================================= > BUILDLOG.txt
cmake -Wno-dev -G %generator% -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DILMBASE_PACKAGE_PREFIX=%root%stage\%platform%\ilmbase-release -DZLIB_INCLUDE_DIR=%root%stage\%platform%\zlib-release\include -DZLIB_LIBRARY=%root%stage\%platform%\zlib-release\lib\zlibstatic.lib -DCMAKE_INSTALL_PREFIX=%root%stage\%platform%\openexr-release %src%\openexr %redirect%
%devenv% openexr.sln /build Release /project INSTALL %redirect%
type BUILDLOG.txt >> %root%build\%platform%\BUILDLOG.txt
popd
REM ===============================================================================
:ocio
echo %time% ^| [ 9/14] Building OpenColorIO...
set OCIO_PATH_SAVE=%PATH%
set PATH=%root%tools\patch;%PATH%
mkdir %root%build\%platform%\ocio-debug 2>nul
pushd %root%build\%platform%\ocio-debug
echo === OpenColorIO (Debug) ======================================================= > BUILDLOG.txt
cmake -Wno-dev -G %generator% -DCMAKE_BUILD_TYPE=Debug -DOCIO_BUILD_SHARED=OFF -DOCIO_BUILD_TRUELIGHT=OFF -DOCIO_BUILD_NUKE=OFF -DOCIO_BUILD_PYGLUE=OFF -DOCIO_USE_BOOST_PTR=OFF -DCMAKE_INSTALL_PREFIX=%root%stage\%platform%\ocio-debug %src%\ocio %redirect%
%devenv% OpenColorIO.sln /build Debug /project INSTALL %redirect%
copy ext\dist\lib\*.lib %root%stage\%platform%\ocio-debug\lib %redirect%
copy ext\build\tinyxml\tinyxml.dir\Debug\*.pdb %root%stage\%platform%\ocio-debug\lib %redirect%
copy ext\build\yaml-cpp\yaml-cpp.dir\Debug\*.pdb %root%stage\%platform%\ocio-debug\lib %redirect%
copy src\core\OpenColorIO_STATIC.dir\Debug\*.pdb %root%stage\%platform%\ocio-debug\lib %redirect%
type BUILDLOG.txt >> %root%build\%platform%\BUILDLOG.txt
popd
mkdir %root%build\%platform%\ocio-release 2>nul
pushd %root%build\%platform%\ocio-release
echo === OpenColorIO (Release) ===================================================== > BUILDLOG.txt
cmake -Wno-dev -G %generator% -DCMAKE_BUILD_TYPE=Release -DOCIO_BUILD_SHARED=OFF -DOCIO_BUILD_TRUELIGHT=OFF -DOCIO_BUILD_NUKE=OFF -DOCIO_BUILD_PYGLUE=OFF -DOCIO_USE_BOOST_PTR=OFF -DCMAKE_INSTALL_PREFIX=%root%stage\%platform%\ocio-release %src%\ocio %redirect%
%devenv% OpenColorIO.sln /build Release /project INSTALL %redirect%
copy ext\dist\lib\*.lib %root%stage\%platform%\ocio-release\lib %redirect%
type BUILDLOG.txt >> %root%build\%platform%\BUILDLOG.txt
popd
set PATH=%OCIO_PATH_SAVE%
REM ===============================================================================
:oiio
echo %time% ^| [10/14] Building OpenImageIO...
mkdir %root%build\%platform%\oiio-debug 2>nul
pushd %root%build\%platform%\oiio-debug
echo === OpenImageIO (Debug) ======================================================= > BUILDLOG.txt
cmake -Wno-dev -G %generator% -DCMAKE_BUILD_TYPE=Debug -DBOOST_ROOT=%boost_root% -DBoost_USE_STATIC_LIBS=ON -DCMAKE_PREFIX_PATH=%qt_root_path% -DBUILDSTATIC=ON -DLINKSTATIC=ON -DUSE_SIMD=sse2 -DOIIO_BUILD_TESTS=OFF -DUSE_PYTHON=OFF -DUSE_FIELD3D=OFF -DUSE_OPENVDB=OFF -DUSE_TBB=OFF -DUSE_FFMPEG=OFF -DUSE_OPENJPEG=OFF -DUSE_OPENCV=OFF -DUSE_FREETYPE=OFF -DUSE_GIF=OFF -DUSE_PTEX=OFF -DUSE_WEBP=OFF -DUSE_LIBRAW=OFF -DUSE_NUKE=OFF -DUSE_DICOM=OFF -DEXTRA_CPP_ARGS="/DBOOST_ALL_NO_LIB /DBOOST_PYTHON_STATIC_LIB" -DILMBASE_ROOT_DIR=%root_fwd_slashes%stage/%platform%/ilmbase-debug -DOPENEXR_ROOT_DIR=%root_fwd_slashes%stage/%platform%/openexr-debug -DZLIB_INCLUDE_DIR=%root_fwd_slashes%stage/%platform%/zlib-debug/include -DZLIB_LIBRARY=%root_fwd_slashes%stage/%platform%/zlib-debug/lib/zlibstaticd.lib -DPNG_PNG_INCLUDE_DIR=%root_fwd_slashes%stage/%platform%/libpng-debug/include -DPNG_LIBRARY=%root_fwd_slashes%stage/%platform%/libpng-debug/lib/libpng16_staticd.lib -DJPEG_INCLUDE_DIR=%root_fwd_slashes%stage/%platform%/libjpeg-turbo-debug/include -DJPEG_LIBRARY=%root_fwd_slashes%stage/%platform%/libjpeg-turbo-debug/lib/jpeg-static.lib -DTIFF_INCLUDE_DIR=%root_fwd_slashes%stage/%platform%/libtiff-debug/include -DTIFF_LIBRARY=%root_fwd_slashes%stage/%platform%/libtiff-debug/lib/libtiff.lib -DOCIO_INCLUDE_PATH=%root_fwd_slashes%stage/%platform%/ocio-debug/include -DOCIO_LIBRARY_PATH=%root_fwd_slashes%stage/%platform%/ocio-debug/lib -DCMAKE_LIBRARY_PATH=%root%build\%platform%\ocio-debug\ext\dist\lib -DCMAKE_INSTALL_PREFIX=%root%stage\%platform%\oiio-debug %src%\oiio %redirect%
%devenv% OpenImageIO.sln /build Debug /project INSTALL %redirect%
copy src\libOpenImageIO\OpenImageIO.dir\Debug\*.pdb %root%stage\%platform%\oiio-debug\lib %redirect%
copy src\libutil\OpenImageIO_Util.dir\Debug\*.pdb %root%stage\%platform%\oiio-debug\lib %redirect%
type BUILDLOG.txt >> %root%build\%platform%\BUILDLOG.txt
popd
mkdir %root%build\%platform%\oiio-release 2>nul
pushd %root%build\%platform%\oiio-release
echo === OpenImageIO (Release) ===================================================== > BUILDLOG.txt
cmake -Wno-dev -G %generator% -DCMAKE_BUILD_TYPE=Release -DBOOST_ROOT=%boost_root% -DBoost_USE_STATIC_LIBS=ON -DCMAKE_PREFIX_PATH=%qt_root_path% -DBUILDSTATIC=ON -DLINKSTATIC=ON -DUSE_SIMD=sse2 -DOIIO_BUILD_TESTS=OFF -DUSE_PYTHON=OFF -DUSE_FIELD3D=OFF -DUSE_OPENVDB=OFF -DUSE_TBB=OFF -DUSE_FFMPEG=OFF -DUSE_OPENJPEG=OFF -DUSE_OPENCV=OFF -DUSE_FREETYPE=OFF -DUSE_GIF=OFF -DUSE_PTEX=OFF -DUSE_WEBP=OFF -DUSE_LIBRAW=OFF -DUSE_NUKE=OFF -DUSE_DICOM=OFF -DEXTRA_CPP_ARGS="/DBOOST_ALL_NO_LIB /DBOOST_PYTHON_STATIC_LIB" -DILMBASE_ROOT_DIR=%root_fwd_slashes%stage/%platform%/ilmbase-release -DOPENEXR_ROOT_DIR=%root_fwd_slashes%stage/%platform%/openexr-release -DZLIB_INCLUDE_DIR=%root_fwd_slashes%stage/%platform%/zlib-release/include -DZLIB_LIBRARY=%root_fwd_slashes%stage/%platform%/zlib-release/lib/zlibstatic.lib -DPNG_PNG_INCLUDE_DIR=%root_fwd_slashes%stage/%platform%/libpng-debug/include -DPNG_LIBRARY=%root_fwd_slashes%stage/%platform%/libpng-release/lib/libpng16_static.lib -DJPEG_INCLUDE_DIR=%root_fwd_slashes%stage/%platform%/libjpeg-turbo-release/include -DJPEG_LIBRARY=%root_fwd_slashes%stage/%platform%/libjpeg-turbo-release/lib/jpeg-static.lib -DTIFF_INCLUDE_DIR=%root_fwd_slashes%stage/%platform%/libtiff-release/include -DTIFF_LIBRARY=%root_fwd_slashes%stage/%platform%/libtiff-release/lib/libtiff.lib -DOCIO_INCLUDE_PATH=%root_fwd_slashes%stage/%platform%/ocio-release/include -DOCIO_LIBRARY_PATH=%root_fwd_slashes%stage/%platform%/ocio-release/lib -DCMAKE_LIBRARY_PATH=%root%build\%platform%\ocio-release\ext\dist\lib -DCMAKE_INSTALL_PREFIX=%root%stage\%platform%\oiio-release %src%\oiio %redirect%
%devenv% OpenImageIO.sln /build Release /project INSTALL %redirect%
type BUILDLOG.txt >> %root%build\%platform%\BUILDLOG.txt
popd
REM Build a Ship variant of OIIO (same as release bu with /GL (Whole Program Optimization) enabled) to work around a bug that causes VS 2015 builds of appleseed in Ship configuration to crash.
REM See https://developercommunity.visualstudio.com/content/problem/701555/stdthread-with-lambda-crashes-when-compiled-withou.html for more information.
mkdir %root%build\%platform%\oiio-ship 2>nul
pushd %root%build\%platform%\oiio-ship
echo === OpenImageIO (Ship) ===================================================== > BUILDLOG.txt
cmake -Wno-dev -G %generator% -DCMAKE_BUILD_TYPE=Release -DBOOST_ROOT=%boost_root% -DBoost_USE_STATIC_LIBS=ON -DCMAKE_PREFIX_PATH=%qt_root_path% -DBUILDSTATIC=ON -DLINKSTATIC=ON -DUSE_SIMD=sse2 -DOIIO_BUILD_TESTS=OFF -DUSE_PYTHON=OFF -DUSE_FIELD3D=OFF -DUSE_OPENVDB=OFF -DUSE_TBB=OFF -DUSE_FFMPEG=OFF -DUSE_OPENJPEG=OFF -DUSE_OPENCV=OFF -DUSE_FREETYPE=OFF -DUSE_GIF=OFF -DUSE_PTEX=OFF -DUSE_WEBP=OFF -DUSE_LIBRAW=OFF -DUSE_NUKE=OFF -DUSE_DICOM=OFF -DEXTRA_CPP_ARGS="/DBOOST_ALL_NO_LIB /DBOOST_PYTHON_STATIC_LIB /GL" -DILMBASE_ROOT_DIR=%root_fwd_slashes%stage/%platform%/ilmbase-release -DOPENEXR_ROOT_DIR=%root_fwd_slashes%stage/%platform%/openexr-release -DZLIB_INCLUDE_DIR=%root_fwd_slashes%stage/%platform%/zlib-release/include -DZLIB_LIBRARY=%root_fwd_slashes%stage/%platform%/zlib-release/lib/zlibstatic.lib -DPNG_PNG_INCLUDE_DIR=%root_fwd_slashes%stage/%platform%/libpng-debug/include -DPNG_LIBRARY=%root_fwd_slashes%stage/%platform%/libpng-release/lib/libpng16_static.lib -DJPEG_INCLUDE_DIR=%root_fwd_slashes%stage/%platform%/libjpeg-turbo-release/include -DJPEG_LIBRARY=%root_fwd_slashes%stage/%platform%/libjpeg-turbo-release/lib/jpeg-static.lib -DTIFF_INCLUDE_DIR=%root_fwd_slashes%stage/%platform%/libtiff-release/include -DTIFF_LIBRARY=%root_fwd_slashes%stage/%platform%/libtiff-release/lib/libtiff.lib -DOCIO_INCLUDE_PATH=%root_fwd_slashes%stage/%platform%/ocio-release/include -DOCIO_LIBRARY_PATH=%root_fwd_slashes%stage/%platform%/ocio-release/lib -DCMAKE_LIBRARY_PATH=%root%build\%platform%\ocio-release\ext\dist\lib -DCMAKE_INSTALL_PREFIX=%root%stage\%platform%\oiio-ship %src%\oiio %redirect%
%devenv% OpenImageIO.sln /build Release /project INSTALL %redirect%
type BUILDLOG.txt >> %root%build\%platform%\BUILDLOG.txt
popd
REM ===============================================================================
:osl
echo %time% ^| [11/14] Building OpenShadingLanguage...
set OSL_PATH_SAVE=%PATH%
mkdir %root%build\%platform%\osl-debug 2>nul
pushd %root%build\%platform%\osl-debug
echo === OpenShadingLanguage (Debug) =============================================== > BUILDLOG.txt
set PATH=%root%tools\FlexBison\bin;%root%stage\%platform%\llvm-debug\bin;%OSL_PATH_SAVE%
cmake -Wno-dev -G %generator% -DCMAKE_BUILD_TYPE=Debug -DOSL_BUILD_PLUGINS=OFF -DOSL_BUILD_TESTS=OFF -DBOOST_ROOT=%boost_root% -DBoost_USE_STATIC_LIBS=ON -DCMAKE_PREFIX_PATH=%qt_root_path% -DBUILDSTATIC=ON -DLINKSTATIC=ON -DENABLERTTI=ON -DLLVM_STATIC=ON -DUSE_SIMD=sse2 -DUSE_PARTIO=OFF -DILMBASE_ROOT_DIR=%root%stage\%platform%\ilmbase-debug -DOPENEXR_ROOT_DIR=%root%stage\%platform%\openexr-debug -DOPENIMAGEIO_ROOT_DIR=%root%stage\%platform%\oiio-debug -DZLIB_INCLUDE_DIR=%root%stage\%platform%\zlib-debug\include -DZLIB_LIBRARY=%root%stage\%platform%\zlib-debug\lib\zlibstaticd.lib -DEXTRA_CPP_ARGS="/DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS" -DCMAKE_INSTALL_PREFIX=%root%stage\%platform%\osl-debug %src%\osl %redirect%
%devenv% osl.sln /build Debug /project INSTALL %redirect%
copy src\liboslcomp\oslcomp.dir\Debug\*.pdb %root%stage\%platform%\osl-debug\lib %redirect%
copy src\liboslexec\oslexec.dir\Debug\*.pdb %root%stage\%platform%\osl-debug\lib %redirect%
copy src\liboslnoise\oslnoise.dir\Debug\*.pdb %root%stage\%platform%\osl-debug\lib %redirect%
copy src\liboslquery\oslquery.dir\Debug\*.pdb %root%stage\%platform%\osl-debug\lib %redirect%
type BUILDLOG.txt >> %root%build\%platform%\BUILDLOG.txt
popd
mkdir %root%build\%platform%\osl-release 2>nul
pushd %root%build\%platform%\osl-release
echo === OpenShadingLanguage (Release) ============================================= > BUILDLOG.txt
set PATH=%root%tools\FlexBison\bin;%root%stage\%platform%\llvm-release\bin;%OSL_PATH_SAVE%
cmake -Wno-dev -G %generator% -DCMAKE_BUILD_TYPE=Release -DOSL_BUILD_PLUGINS=OFF -DOSL_BUILD_TESTS=OFF -DBOOST_ROOT=%boost_root% -DBoost_USE_STATIC_LIBS=ON -DCMAKE_PREFIX_PATH=%qt_root_path% -DBUILDSTATIC=ON -DLINKSTATIC=ON -DENABLERTTI=ON -DLLVM_STATIC=ON -DUSE_SIMD=sse2 -DUSE_PARTIO=OFF -DILMBASE_ROOT_DIR=%root%stage\%platform%\ilmbase-release -DOPENEXR_ROOT_DIR=%root%stage\%platform%\openexr-release -DOPENIMAGEIO_ROOT_DIR=%root%stage\%platform%\oiio-release -DZLIB_INCLUDE_DIR=%root%stage\%platform%\zlib-release\include -DZLIB_LIBRARY=%root%stage\%platform%\zlib-release\lib\zlibstatic.lib -DEXTRA_CPP_ARGS="/DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS" -DCMAKE_INSTALL_PREFIX=%root%stage\%platform%\osl-release %src%\osl %redirect%
%devenv% osl.sln /build Release /project INSTALL %redirect%
type BUILDLOG.txt >> %root%build\%platform%\BUILDLOG.txt
popd
set PATH=%OSL_PATH_SAVE%
REM ===============================================================================
:seexpr
echo %time% ^| [12/14] Building SeExpr...
mkdir %root%build\%platform%\seexpr-debug 2>nul
pushd %root%build\%platform%\seexpr-debug
echo === SeExpr (Debug) ============================================================ > BUILDLOG.txt
mkdir src\SeExpr\generated %redirect%
mkdir src\SeExprEditor\generated %redirect%
copy %src%\seexpr\windows7\SeExpr\generated\*.* src\SeExpr\generated %redirect%
copy %src%\seexpr\windows7\SeExprEditor\generated\*.* src\SeExprEditor\generated %redirect%
cmake -Wno-dev -G %generator% -DCMAKE_BUILD_TYPE=Debug -DZLIB_INCLUDE_DIR=%root%stage\%platform%\zlib-debug\include -DZLIB_LIBRARY=%root%stage\%platform%\zlib-debug\lib\zlibstaticd.lib -DPNG_PNG_INCLUDE_DIR=%root%stage\%platform%\libpng-debug\include -DPNG_LIBRARY=%root%stage\%platform%\libpng-debug\lib\libpng16_staticd.lib -DCMAKE_PREFIX_PATH=%qt_root_path% -DCMAKE_INSTALL_PREFIX=%root%stage\%platform%\seexpr-debug %src%\seexpr %redirect%
%devenv% SeExpr.sln /build Debug /project INSTALL %redirect%
copy src\SeExpr\SeExpr-static.dir\Debug\*.pdb %root%stage\%platform%\seexpr-debug\lib %redirect%
copy src\SeExprEditor\SeExprEditor.dir\Debug\*.pdb %root%stage\%platform%\seexpr-debug\lib %redirect%
type BUILDLOG.txt >> %root%build\%platform%\BUILDLOG.txt
popd
mkdir %root%build\%platform%\seexpr-release 2>nul
pushd %root%build\%platform%\seexpr-release
echo === SeExpr (Release) ========================================================== > BUILDLOG.txt
mkdir src\SeExpr\generated %redirect%
mkdir src\SeExprEditor\generated %redirect%
copy %src%\seexpr\windows7\SeExpr\generated\*.* src\SeExpr\generated %redirect%
copy %src%\seexpr\windows7\SeExprEditor\generated\*.* src\SeExprEditor\generated %redirect%
cmake -Wno-dev -G %generator% -DCMAKE_BUILD_TYPE=Release -DZLIB_INCLUDE_DIR=%root%stage\%platform%\zlib-release\include -DZLIB_LIBRARY=%root%stage\%platform%\zlib-release\lib\zlibstatic.lib -DPNG_PNG_INCLUDE_DIR=%root%stage\%platform%\libpng-release\include -DPNG_LIBRARY=%root%stage\%platform%\libpng-release\lib\libpng16_static.lib -DCMAKE_PREFIX_PATH=%qt_root_path% -DCMAKE_INSTALL_PREFIX=%root%stage\%platform%\seexpr-release %src%\seexpr %redirect%
%devenv% SeExpr.sln /build Release /project INSTALL %redirect%
type BUILDLOG.txt >> %root%build\%platform%\BUILDLOG.txt
popd
REM ===============================================================================
:embree
echo %time% ^| [13/14] Building Embree...
mkdir %root%build\%platform%\embree-debug 2>nul
pushd %root%build\%platform%\embree-debug
echo === Embree (Debug) ============================================================ > BUILDLOG.txt
cmake -G %generator% -DCMAKE_BUILD_TYPE=Debug -DEMBREE_STATIC_LIB=ON -DEMBREE_TUTORIALS=OFF -DEMBREE_RAY_MASK=ON -DEMBREE_TASKING_SYSTEM=INTERNAL -DEMBREE_ISPC_SUPPORT=OFF -DCMAKE_INSTALL_PREFIX=%root%stage\%platform%\embree-debug %src%\embree %redirect%
%devenv% embree3.sln /build Debug /project INSTALL %redirect%
copy common\algorithms\algorithms.dir\Debug\*.pdb %root%stage\%platform%\embree-debug\lib %redirect%
copy common\lexers\lexers.dir\Debug\*.pdb %root%stage\%platform%\embree-debug\lib %redirect%
copy common\math\math.dir\Debug\*.pdb %root%stage\%platform%\embree-debug\lib %redirect%
copy common\simd\simd.dir\Debug\*.pdb %root%stage\%platform%\embree-debug\lib %redirect%
copy common\sys\sys.dir\Debug\*.pdb %root%stage\%platform%\embree-debug\lib %redirect%
copy common\tasking\tasking.dir\Debug\*.pdb %root%stage\%platform%\embree-debug\lib %redirect%
copy kernels\embree.dir\Debug\*.pdb %root%stage\%platform%\embree-debug\lib %redirect%
copy kernels\embree_avx.dir\Debug\*.pdb %root%stage\%platform%\embree-debug\lib %redirect%
copy kernels\embree_avx2.dir\Debug\*.pdb %root%stage\%platform%\embree-debug\lib %redirect%
copy kernels\embree_sse42.dir\Debug\*.pdb %root%stage\%platform%\embree-debug\lib %redirect%
type BUILDLOG.txt >> %root%build\%platform%\BUILDLOG.txt
popd
mkdir %root%build\%platform%\embree-release 2>nul
pushd %root%build\%platform%\embree-release
echo === Embree (Release) ========================================================== > BUILDLOG.txt
if [%platform%] == [vc140] (
REM The CMake argument
REM -DCMAKE_CXX_FLAGS="-d2SSAOptimizer-"
REM is required to work around a bug in the new SSA optimizer introduced in VS 2015:
REM https://github.com/embree/embree/issues/157#issuecomment-334696351
cmake -G %generator% -DCMAKE_BUILD_TYPE=Release -DEMBREE_STATIC_LIB=ON -DEMBREE_TUTORIALS=OFF -DEMBREE_RAY_MASK=ON -DEMBREE_TASKING_SYSTEM=INTERNAL -DEMBREE_ISPC_SUPPORT=OFF -DCMAKE_CXX_FLAGS="-d2SSAOptimizer-" -DCMAKE_INSTALL_PREFIX=%root%stage\%platform%\embree-release %src%\embree %redirect%
) else (
cmake -G %generator% -DCMAKE_BUILD_TYPE=Release -DEMBREE_STATIC_LIB=ON -DEMBREE_TUTORIALS=OFF -DEMBREE_RAY_MASK=ON -DEMBREE_TASKING_SYSTEM=INTERNAL -DEMBREE_ISPC_SUPPORT=OFF -DCMAKE_INSTALL_PREFIX=%root%stage\%platform%\embree-release %src%\embree %redirect%
)
%devenv% embree3.sln /build Release /project INSTALL %redirect%
type BUILDLOG.txt >> %root%build\%platform%\BUILDLOG.txt
popd
:end_embree
REM ===============================================================================
:lz4
echo %time% ^| [14/14] Building lz4...
mkdir %root%build\%platform%\lz4-debug 2>nul
pushd %root%build\%platform%\lz4-debug
echo === lz4 (Debug) =============================================================== > BUILDLOG.txt
cmake -Wno-dev -G %generator% -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DLZ4_BUILD_LEGACY_LZ4C=OFF -DCMAKE_INSTALL_PREFIX=%root%stage\%platform%\lz4-debug %src%\lz4\contrib\cmake_unofficial %redirect%
%devenv% lz4.sln /build Debug /project INSTALL %redirect%
copy lz4_static.dir\Debug\*.pdb %root%stage\%platform%\lz4-debug\lib %redirect%
type BUILDLOG.txt >> %root%build\%platform%\BUILDLOG.txt
popd
mkdir %root%build\%platform%\lz4-release 2>nul
pushd %root%build\%platform%\lz4-release
echo === lz4 (Release) ============================================================= > BUILDLOG.txt
cmake -Wno-dev -G %generator% -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DLZ4_BUILD_LEGACY_LZ4C=OFF -DCMAKE_INSTALL_PREFIX=%root%stage\%platform%\lz4-release %src%\lz4\contrib\cmake_unofficial %redirect%
%devenv% lz4.sln /build Release /project INSTALL %redirect%
type BUILDLOG.txt >> %root%build\%platform%\BUILDLOG.txt
popd
REM ===============================================================================
:done
echo %time% ^| Build complete.
echo.
:end
endlocal