自动配置VS及QT环境,实现一键编译

This commit is contained in:
gb 2022-07-27 10:10:30 +08:00
parent 4bce95ac8d
commit b83385a3af
2 changed files with 46 additions and 0 deletions

46
auto_build.bat Normal file
View File

@ -0,0 +1,46 @@
@echo off
set dev=""
set qmake=""
call findqt.exe
for /f "tokens=1,2,* " %%i in ('reg QUERY "HKEY_CURRENT_USER\SOFTWARE\Qt" /v qmake') do set qmake=%%k
if %qmake%=="" (
echo "Can not find qmake path"
goto end
)
echo qmake=%qmake%
for /f "tokens=1,2,* " %%i in ('reg QUERY "HKEY_CLASSES_ROOT\CLSID\{2E1517DA-87BF-4443-984A-D2BF18F5A908}\LocalServer32" /ve') do set dev=%%k
echo dev=%dev%
if %dev%=="" (
echo "Can not find Visual-Studio installing path"
goto end
)
call %dev%\..\..\..\vc\auxiliary\build\vcvars32.bat
MSBuild.exe ./build/windows/HGSolution.sln /p:Configuration=Release /p:Platform=x86
cd /d ./build-qt/HGSolution/HGScanner
%qmake% -r -tp vc HGScanner.pro
MSBuild.exe HuaGoScan.vcxproj /p:Configuration=Release /p:Platform=x86
del /f /s /q *.h
del /f /s /q .qmake.stash
del /f /s /q HuaGoScan_resource.rc
del /f /s /q HuaGoScan.vcxproj.filters
del /f /s /q HuaGoScan.vcxproj
rd /s /q debug
rd /s /q release
cd /d ../HGUpgrade
%qmake% -r -tp vc HGUpgrade.pro
MSBuild.exe HuaGoScanUpgrade.vcxproj /p:Configuration=Release /p:Platform=x86
del /f /s /q *.h
del /f /s /q .qmake.stash
del /f /s /q HuaGoScanUpgrade_resource.rc
del /f /s /q HuaGoScanUpgrade.vcxproj.filters
del /f /s /q HuaGoScanUpgrade.vcxproj
rd /s /q debug
rd /s /q release
:end

BIN
findqt.exe Normal file

Binary file not shown.