-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.bat
52 lines (40 loc) · 1.61 KB
/
build.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
@echo off
SET OLDPATH=%PATH%
where cmake >NUL 2>NUL
IF %ERRORLEVEL% == 0 GOTO build
SET PATH=%PATH%;C:\Program Files\CMake\bin\
SET PATH=%PATH%;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\
SET PATH=%PATH%;C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\
SET PATH=%PATH%;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\
SET PATH=%PATH%;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\
SET PATH=%PATH%;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\
SET PATH=%PATH%;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\
where cmake >NUL 2>NUL
IF %ERRORLEVEL% == 0 GOTO build
SET PATH=%OLDPATH%
echo Could not find cmake in PATH
echo Ensure that cmake is in PATH before calling this script
timeout /t 5
exit 1
:build
REM Create build directories
if not exist build_win mkdir build_win
pushd build_win
set COMMANDLINE=-DCMAKE_GENERATOR_PLATFORM=x64
REM Debug build
if not exist debug mkdir debug
pushd debug
cmake %COMMANDLINE% -DCMAKE_BUILD_TYPE=debug ..\..
cmake --build . --config debug
popd
REM Release build
if not exist release mkdir release
pushd release
cmake %COMMANDLINE% -DCMAKE_BUILD_TYPE=release ..\..
cmake --build . --config release
popd
rem back to the roots
popd
SET PATH=%OLDPATH%
REM Build completed
echo Build completed.