Use vswhere to find MSBUILD

develop
Amber Brown 2023-01-14 13:16:07 +11:00
parent 68e373100b
commit 3459d61dc4
12 changed files with 28 additions and 42 deletions

@ -1,4 +1,3 @@
call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64 call msvc_include.bat
cd VC2022 %msbuild% /m /p:Platform=x64 /p:Configuration=RelWithDebInfo VC2022/ALL_BUILD.vcxproj
msbuild /m /p:Platform=x64 /p:Configuration=RelWithDebInfo ALL_BUILD.vcxproj
cd ..

@ -1,5 +1,3 @@
call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64 call msvc_include.bat
cd VC2022 %msbuild% /m /p:Platform=x64 /p:Configuration=Release VC2022/ALL_BUILD.vcxproj
msbuild /m /p:Platform=x64 /p:Configuration=Release ALL_BUILD.vcxproj
cd ..
pause pause

@ -1,6 +1,4 @@
IF EXIST DF_PATH.txt SET /P _DF_PATH=<DF_PATH.txt IF EXIST DF_PATH.txt SET /P _DF_PATH=<DF_PATH.txt
IF NOT EXIST DF_PATH.txt SET _DF_PATH=%CD%\DF IF NOT EXIST DF_PATH.txt SET _DF_PATH=%CD%\DF
mkdir VC2022
cd VC2022
echo generating a build folder echo generating a build folder
cmake ..\..\.. -G"Visual Studio 17 2022" -A x64 -DCMAKE_INSTALL_PREFIX="%_DF_PATH%" -DBUILD_DEVEL=1 -DBUILD_DEV_PLUGINS=1 -DBUILD_STONESENSE=1 cmake ..\.. -G"Visual Studio 17 2022" -A x64 -B VC2022 -DCMAKE_INSTALL_PREFIX="%_DF_PATH%" -DBUILD_DEVEL=1 -DBUILD_DEV_PLUGINS=1 -DBUILD_STONESENSE=1

@ -1,7 +1,5 @@
IF EXIST DF_PATH.txt SET /P _DF_PATH=<DF_PATH.txt IF EXIST DF_PATH.txt SET /P _DF_PATH=<DF_PATH.txt
IF NOT EXIST DF_PATH.txt SET _DF_PATH=%CD%\DF IF NOT EXIST DF_PATH.txt SET _DF_PATH=%CD%\DF
mkdir VC2022
cd VC2022
echo Pre-generating a build folder echo Pre-generating a build folder
cmake ..\..\.. -G"Visual Studio 17 2022" -A x64 -DCMAKE_INSTALL_PREFIX="%_DF_PATH%" cmake ..\.. -G"Visual Studio 17 2022" -A x64 -B VC2022 -G"Visual Studio 17 2022" -A x64 -DCMAKE_INSTALL_PREFIX="%_DF_PATH%"
cmake-gui . cmake-gui VC2022

@ -1,6 +1,4 @@
IF EXIST DF_PATH.txt SET /P _DF_PATH=<DF_PATH.txt IF EXIST DF_PATH.txt SET /P _DF_PATH=<DF_PATH.txt
IF NOT EXIST DF_PATH.txt SET _DF_PATH=%CD%\DF IF NOT EXIST DF_PATH.txt SET _DF_PATH=%CD%\DF
mkdir VC2022
cd VC2022
echo generating a build folder echo generating a build folder
cmake ..\..\.. -G"Visual Studio 17 2022" -A x64 -DCMAKE_INSTALL_PREFIX="%_DF_PATH%" -DBUILD_DEVEL=0 -DBUILD_DEV_PLUGINS=0 -DBUILD_STONESENSE=0 cmake ..\.. -G"Visual Studio 17 2022" -A x64 -B VC2022 -DCMAKE_INSTALL_PREFIX="%_DF_PATH%" -DBUILD_DEVEL=0 -DBUILD_DEV_PLUGINS=0 -DBUILD_STONESENSE=0

@ -1,6 +1,4 @@
IF EXIST DF_PATH.txt SET /P _DF_PATH=<DF_PATH.txt IF EXIST DF_PATH.txt SET /P _DF_PATH=<DF_PATH.txt
IF NOT EXIST DF_PATH.txt SET _DF_PATH=%CD%\DF IF NOT EXIST DF_PATH.txt SET _DF_PATH=%CD%\DF
mkdir VC2022
cd VC2022
echo generating a build folder echo generating a build folder
cmake ..\..\.. -G"Visual Studio 17 2022" -A x64 -DCMAKE_INSTALL_PREFIX="%_DF_PATH%" -DBUILD_DEVEL=0 -DBUILD_DEV_PLUGINS=0 -DBUILD_DOCS=1 -DBUILD_STONESENSE=1 cmake ..\.. -G"Visual Studio 17 2022" -A x64 -B VC2022 -DCMAKE_INSTALL_PREFIX="%_DF_PATH%" -DBUILD_DEVEL=0 -DBUILD_DEV_PLUGINS=0 -DBUILD_DOCS=1 -DBUILD_STONESENSE=1

@ -1,6 +1,4 @@
IF EXIST DF_PATH.txt SET /P _DF_PATH=<DF_PATH.txt IF EXIST DF_PATH.txt SET /P _DF_PATH=<DF_PATH.txt
IF NOT EXIST DF_PATH.txt SET _DF_PATH=%CD%\DF IF NOT EXIST DF_PATH.txt SET _DF_PATH=%CD%\DF
mkdir VC2022
cd VC2022
echo generating a build folder echo generating a build folder
cmake ..\..\.. -G"Visual Studio 17 2022" -A x64 -DCMAKE_INSTALL_PREFIX="%_DF_PATH%" -DBUILD_SUPPORTED=0 -DBUILD_DEVEL=0 -DBUILD_DEV_PLUGINS=0 -DBUILD_STONESENSE=0 -DBUILD_SIZECHECK=1 cmake ..\.. -G"Visual Studio 17 2022" -A x64 -B VC2022 -DCMAKE_INSTALL_PREFIX="%_DF_PATH%" -DBUILD_SUPPORTED=0 -DBUILD_DEVEL=0 -DBUILD_DEV_PLUGINS=0 -DBUILD_STONESENSE=0 -DBUILD_SIZECHECK=1

@ -1,4 +1,2 @@
call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64 call msvc_include.bat
cd VC2022 %msbuild% /m /p:Platform=x64 /p:Configuration=RelWithDebInfo VC2022/INSTALL.vcxproj
msbuild /m /p:Platform=x64 /p:Configuration=RelWithDebInfo INSTALL.vcxproj
cd ..

@ -1,4 +1,2 @@
call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64 call msvc_include.bat
cd VC2022 %msbuild% /m /p:Platform=x64 /p:Configuration=Release VC2022/INSTALL.vcxproj
msbuild /m /p:Platform=x64 /p:Configuration=Release INSTALL.vcxproj
cd ..

@ -0,0 +1,9 @@
@ECHO OFF
setlocal enabledelayedexpansion
FOR /F "usebackq tokens=*" %%F IN (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -requires Microsoft.Component.MSBuild -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -version [17.0^,] -products * -find MSBuild\**\Bin\MSBuild.exe`) DO (
endlocal & set "MSBUILD="%%F""
goto :EOF
)
echo "Cannot find a Visual Studio 2022/Build Tools installation"
exit 1

@ -1,6 +1,3 @@
@echo off call msvc_include.bat
call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64 %msbuild% /m /p:Platform=x64 /p:Configuration=RelWithDebInfo VC2022/PACKAGE.vcxproj
cd VC2022
msbuild /m /p:Platform=x64 /p:Configuration=RelWithDebInfo PACKAGE.vcxproj
cd ..
exit %ERRORLEVEL% exit %ERRORLEVEL%

@ -1,5 +1,2 @@
@echo off call msvc_include.bat
call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64 %msbuild% /m /p:Platform=x64 /p:Configuration=Release VC2022/PACKAGE.vcxproj
cd VC2022
msbuild /m /p:Platform=x64 /p:Configuration=Release PACKAGE.vcxproj
cd ..