1+ @ echo off
2+ setlocal enabledelayedexpansion
3+
4+ :: Parse command line arguments
5+ set " BUILD_CONFIG = %1 "
6+ if " %BUILD_CONFIG% " == " " (
7+ echo No build configuration specified, will build both Debug and Release versions
8+ set " BUILD_DEBUG = 1"
9+ set " BUILD_RELEASE = 1"
10+ ) else if /i " %BUILD_CONFIG% " == " Debug" (
11+ echo Build configuration: Debug
12+ set " BUILD_DEBUG = 1"
13+ set " BUILD_RELEASE = 0"
14+ ) else if /i " %BUILD_CONFIG% " == " Release" (
15+ echo Build configuration: Release
16+ set " BUILD_DEBUG = 0"
17+ set " BUILD_RELEASE = 1"
18+ ) else (
19+ echo Error: Invalid build configuration " %BUILD_CONFIG% "
20+ echo Usage: init.bat [Debug^ |Release]
21+ echo No arguments: Build both Debug and Release versions
22+ echo Debug: Build Debug version only
23+ echo Release: Build Release version only
24+ pause
25+ exit /b 1
26+ )
27+
128git submodule update --init --recursive
229for /f " delims=" %%i in ('" %ProgramFiles(x86)% \Microsoft Visual Studio\Installer\vswhere.exe" -products * -requires Microsoft.Component.MSBuild -property installationPath -latest') do set VSPath = %%i
330call " %VSPath% \VC\Auxiliary\Build\vcvars64.bat" x64
@@ -20,10 +47,19 @@ cmake .. -G "Ninja Multi-Config" ^
2047-D BUILD_PYBULLET=Off ^
2148-D BULLET2_MULTITHREADING=ON ^
2249-D BULLET2_USE_PPL_MULTITHREADING=ON
23- cmake --build . --config Debug -j
24- cmake --install . --config Debug --prefix ../../install
25- cmake --build . --config Release -j
26- cmake --install . --config Release --prefix ../../install
50+
51+ if " %BUILD_DEBUG% " == " 1" (
52+ echo Building bullet3 Debug version...
53+ cmake --build . --config Debug -j
54+ cmake --install . --config Debug --prefix ../../install
55+ )
56+
57+ if " %BUILD_RELEASE% " == " 1" (
58+ echo Building bullet3 Release version...
59+ cmake --build . --config Release -j
60+ cmake --install . --config Release --prefix ../../install
61+ )
62+
2763cd ../..
2864cd ./yaml-cpp
2965mkdir build
@@ -33,18 +69,36 @@ cmake .. -G "Ninja Multi-Config" ^
3369-D CMAKE_INSTALL_PREFIX=" ../../install" ^
3470-D YAML_CPP_BUILD_TESTS=Off ^
3571-D YAML_CPP_BUILD_TOOLS=Off
36- cmake --build . --config Debug -j
37- cmake --install . --config Debug --prefix ../../install
38- cmake --build . --config Release -j
39- cmake --install . --config Release --prefix ../../install
72+
73+ if " %BUILD_DEBUG% " == " 1" (
74+ echo Building yaml-cpp Debug version...
75+ cmake --build . --config Debug -j
76+ cmake --install . --config Debug --prefix ../../install
77+ )
78+
79+ if " %BUILD_RELEASE% " == " 1" (
80+ echo Building yaml-cpp Release version...
81+ cmake --build . --config Release -j
82+ cmake --install . --config Release --prefix ../../install
83+ )
84+
4085cd ../..
4186cd ./libMMD
4287mkdir build
4388cd build
4489cmake .. -G " Ninja Multi-Config" -D CMAKE_DEBUG_POSTFIX=" _Debug" -D CMAKE_INSTALL_PREFIX=" ../../install" -D LIBMMD_BULLET_ROOT=" ../../install" -D LIBMMD_ENABLE_TEST=off -D LIBMMD_INSTALL=on
45- cmake --build . --config Debug -j
46- cmake --install . --config Debug --prefix ../../install
47- cmake --build . --config Release -j
48- cmake --install . --config Release --prefix ../../install
90+
91+ if " %BUILD_DEBUG% " == " 1" (
92+ echo Building libMMD Debug version...
93+ cmake --build . --config Debug -j
94+ cmake --install . --config Debug --prefix ../../install
95+ )
96+
97+ if " %BUILD_RELEASE% " == " 1" (
98+ echo Building libMMD Release version...
99+ cmake --build . --config Release -j
100+ cmake --install . --config Release --prefix ../../install
101+ )
102+
49103cd ../..
50104pause
0 commit comments