Skip to content

Instantly share code, notes, and snippets.

@rlabbe
Created June 16, 2026 16:37
Show Gist options
  • Select an option

  • Save rlabbe/c6cabcebc521bc99c5ad019d0b04cd5c to your computer and use it in GitHub Desktop.

Select an option

Save rlabbe/c6cabcebc521bc99c5ad019d0b04cd5c to your computer and use it in GitHub Desktop.
rem Build static Qt 6.8.3 RELEASE
echo.
echo === Cleaning previous build ===
if exist CMakeCache.txt del CMakeCache.txt
for /d %%d in (CMakeFiles*) do if exist "%%d" rmdir /s /q "%%d"
echo.
echo === Configuring ===
call configure.bat -static -static-runtime -release -prefix d:\qt\6.8.3\msvc2022_64_static -skip qtwebengine -skip qtwebchannel -skip qtwebview -skip qtpdf -skip qttools -skip qtdoc -skip qttranslations -nomake examples -nomake tests -DPython3_ROOT_DIR=C:/Users/roger/miniconda3
echo configure.bat exited with %ERRORLEVEL%
if %ERRORLEVEL% neq 0 (
echo Configure FAILED
exit /b 1
)
if not exist build.ninja (
echo Configure produced errors -- build.ninja not generated
exit /b 1
)
echo.
echo === Building ===
cmake --build . --parallel
if errorlevel 1 (
echo Build FAILED
exit /b 1
)
echo.
echo === Installing ===
cmake --install .
if errorlevel 1 (
echo Install FAILED
exit /b 1
)
echo.
echo === Patching qconfig.pri to neutral ===
powershell -NoProfile -Command "$f='d:\qt\6.8.3\msvc2022_64_static\mkspecs\qconfig.pri'; $c=gc $f; $c=$c -replace 'QT_CONFIG \+= static no-pkg-config (debug|release)', 'QT_CONFIG += static no-pkg-config'; $c=$c -replace 'QT.global.disabled_features \+= (debug|release) build_all', 'QT.global.disabled_features += build_all'; $c=$c -replace 'pkg-config debug_and_release ', 'pkg-config '; if($c -notmatch 'debug_and_release'){$c=$c -replace 'QT.global.enabled_features = (.*)', 'QT.global.enabled_features = `$1 debug_and_release'}; $c | sc $f"
if errorlevel 1 (echo Patch FAILED & exit /b 1)
echo.
echo === Done ===
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment