Windows Qt lib build script

Scripts to simplify the compilation of Qt programs or libraries.

MinGW GCC


Example (Double click for full screen)

MinGW GGC

Download script

build64_latest.bat.zip

build64_latest.bat   |   Light  |  Dark   |  Open in new tab  |   Copy to clipboard

         
:: build64_latest.bat Copyright (C) 2023 Ingemar Ceicer
:: https://ceicer.eu
:: programming@ceicer.com

:: build64_latest.bat is free software:
:: you can redistribute it and/or modify
:: it under the terms of the
:: GNU General Public License as published by
:: the Free Software Foundation, version 3.

:: This program is distributed in the hope that it will be useful,
:: but WITHOUT ANY WARRANTY; without even the implied warranty of
:: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
:: GNU General Public License for more details.


::EDIT
set "QTVERSION=6.5.2"
::set "COMPILER=C:\Qt\Qt\Tools\mingw810_32\bin\mingw32-make.exe"
set "COMPILER=C:\Qt\Tools\mingw1120_64\bin\mingw32-make.exe"
set "PATH_TO_PRO_FILE=../code/"
::END EDIT

mkdir build
cd build
    ::debug
    C:\Qt\%QTVERSION%\mingw_64\bin\qmake.exe -project %PATH_TO_PRO_FILE%*.pro 
	C:\Qt\%QTVERSION%\mingw_64\bin\qmake.exe "CONFIG+=debug" %PATH_TO_PRO_FILE%*.pro *.pro -spec win32-g++ "CONFIG+=qtquickcompiler" && %COMPILER% qmake_all
  
    %COMPILER% -j%NUMBER_OF_PROCESSORS%
    %COMPILER% clean
cd ..

rmdir /S /Q build
mkdir lib_Qt-%QTVERSION%_MinGW
copy build-lib\*.* lib_Qt-%QTVERSION%_MinGW
rmdir /S /Q build-lib

mkdir build
cd build
    ::release
    C:\Qt\%QTVERSION%\mingw_64\bin\qmake.exe -project %PATH_TO_PRO_FILE%*.pro  
	C:\Qt\%QTVERSION%\mingw_64\bin\qmake.exe "CONFIG+=release" %PATH_TO_PRO_FILE%*.pro *.pro -spec win32-g++ "CONFIG+=qtquickcompiler" && %COMPILER% qmake_all
  
    %COMPILER% -j%NUMBER_OF_PROCESSORS%
    %COMPILER% clean
cd ..
rmdir /S /Q build
mkdir lib_Qt-%QTVERSION%_MinGW
copy build-lib\*.* lib_Qt-%QTVERSION%_MinGW
rmdir /S /Q build-lib

Scripts to simplify the compilation of Qt programs or libraries.

Microsoft Visual Studio


Example (Double click for full screen)

Microsoft Visual Studio

Download script

build64_latest_msvc.bat.zip

build64_latest_msvc.bat   |   Light  |  Dark   |  Open in new tab  |   Copy to clipboard

         
:: build64_latest_msvc.bat Copyright (C) 2023 Ingemar Ceicer
:: https://ceicer.eu
:: programming@ceicer.com

:: build64_latest_msvc.bat is free software:
:: you can redistribute it and/or modify
:: it under the terms of the
:: GNU General Public License as published by
:: the Free Software Foundation, version 3.

:: This program is distributed in the hope that it will be useful,
:: but WITHOUT ANY WARRANTY; without even the implied warranty of
:: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
:: GNU General Public License for more details.

::EDIT
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
set PROFILE="downloadunpack.pro"
set QTVERSION="6.5.2"
set QMAKE="C:/Qt/%QTVERSION%/msvc2019_64/bin/qmake.exe"
set "PATH_TO_PRO_FILE=../code/"
set "MSVC=MSVC2019"
::END EDIT

mkdir build
cd build

    %QMAKE% -project %PATH_TO_PRO_FILE%%PROFILE%
	%QMAKE% "CONFIG+=debug" %PATH_TO_PRO_FILE%%PROFILE% -o Makefile -spec win32-msvc "CONFIG+=qtquickcompiler" "CONFIG+=debug"
    nmake.exe
	
cd ..
rmdir /S /Q build
mkdir lib_Qt-%QTVERSION%_MSVC2019
copy /Y build-lib\* lib_Qt-%QTVERSION%_%MSVC%\
rmdir /S /Q build-lib



mkdir build
cd build

    %QMAKE% -project %PATH_TO_PRO_FILE%%PROFILE% 
	%QMAKE% "CONFIG+=debug" %PATH_TO_PRO_FILE%%PROFILE% -o Makefile -spec win32-msvc "CONFIG+=qtquickcompiler" "CONFIG+=release"
    nmake.exe
	
cd ..
rmdir /S /Q build
copy /Y build-lib\* lib_Qt-%QTVERSION%_%MSVC%\
rmdir /S /Q build-lib