'Qt6 build error from source. Multi-config build is only supported by Xcode, Ninja Multi-Config and Visual Studio generators

I'm trying to build Qt6.3.0 from sources. I'm new in qt and trying to build static version. I'm use this tree: C:/Qt/6.3.0/Src C:/Qt/6.3.0/static

In C:/Qt/6.3.0/Src/qtbase/mkspecs/win32-g++/qmake.conf: I add this in end of file:

# Static
QMAKE_LFLAGS += -static -static-libgcc
QMAKE_CFLAGS_RELEASE -= -O2
QMAKE_CFLAGS_RELEASE += -Os -momit-leaf-frame-pointer
DEFINES += QT_STATIC_BUILD
CONFIG += static
# Static

In C:/Qt/6.3.0/static/make.bat:

set QtDir=C:/Qt/6.3.0/static
set MingwDir=C:/Qt/Tools/mingw1120_64
set QtSrcDir=C:/Qt/6.3.0/Src
set CMAKE_INCLUDE_PATH=%MingwDir%/x86_64-w64-mingw32/include
:: Set a clean path including MinGW.
set PATH=%PATH%;%MingwDir%/bin;%MingwDir%/opt/bin
:: Force English locale to avoid weird effects of tools localization.
set LANG=en
:: Set environment variable QT_INSTALL_PREFIX. Documentation says it should be
:: used by configure as prefix but this does not seem to work. So, we will
:: also specify -prefix option in configure.
set QT_INSTALL_PREFIX=%QtDir%
:: Configure, compile and install Qt.
cmd /c "%QtSrcDir%/configure.bat -static -debug-and-release -platform win32-g++ -prefix %QtDir% -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -qt-sqlite -no-openssl -opensource -confirm-license -make libs -nomake tools -nomake examples -nomake tests" > log_cmd.txt
mingw32-make -k -j6 > log_make.txt
mingw32-make -k -j6 install > log_make_install.txt
pause

But this give me this error:

CMake Warning at C:/Qt/6.3.0/Src/qtbase/cmake/QtProcessConfigureArgs.cmake:264 (message):
  '-nomake tools' is not implemented yet.
Call Stack (most recent call first):
  C:/Qt/6.3.0/Src/qtbase/cmake/QtProcessConfigureArgs.cmake:790 (qtConfAddWarning)
  C:/Qt/6.3.0/Src/qtbase/cmake/QtProcessConfigureArgs.cmake:849 (check_qt_build_parts)


CMake Warning at C:/Qt/6.3.0/Src/qtbase/cmake/QtProcessConfigureArgs.cmake:264 (message):
  '-make libs' is not implemented yet.
Call Stack (most recent call first):
  C:/Qt/6.3.0/Src/qtbase/cmake/QtProcessConfigureArgs.cmake:790 (qtConfAddWarning)
  C:/Qt/6.3.0/Src/qtbase/cmake/QtProcessConfigureArgs.cmake:850 (check_qt_build_parts)


CMake Error at C:/Qt/6.3.0/Src/qtbase/cmake/QtProcessConfigureArgs.cmake:940 (message):
  Multi-config build is only supported by Xcode, Ninja Multi-Config and
  Visual Studio generators.  Current generator is "MinGW Makefiles".

  Note: Use '-cmake-generator <generator name>' option to specify the
  generator manually.

If i think right, it not support MinGW generator? What kind of generator should i use?

This my path:

D:\YD\Python\py\
D:\YD\Python\py\Scripts\
C:\Qt\Tools\CMake_64\bin
C:\Qt\Tools\mingw1120_64\bin
C:\Strawberry\perl\bin

From qt installer(what i installed):

Qt/Qt6.3.0/MinGW 11.2.0 64-bit
Qt/Qt6.3.0/Sources
Qt/Qt6.3.0/Qt Shader Tools
Qt/Qt6.3.0/Additional Libraries
Qt/Qt6.3.0/Qt Debug Information Files
Developer and Designel Tools/Qt Creator 7.0.1 . . .
Developer and Designel Tools/Debuging Tools for Windows
Developer and Designel Tools/Qt Creator 7.0.1 Debug Symbols
Developer and Designel Tools/Qt Creator 7.0.1 Plugin Development
Developer and Designel Tools/MinGW 11.2.0 64-bit

I also have this: Python v3.10.4 Strawberry Perl v5.32.1

My os: Windows 10 Build 19044

I all make true or what is incorrect? What i should do to fix this error?



Solution 1:[1]

I am able to build both static and shared versions of Qt 6.3.0 using CMake with Ninja under MSYS2 shell (Cmake flag -GNinja), but I build them separately using a different out-of-source build folder but the same install destination (same -DCMAKE_INSTALL_PREFIX= CMake flag).

If you want to find out the details on how my build works, see https://github.com/brechtsanders/winlibs_recipes/blob/main/recipes/qt6.winlib (sorry, it's a bit messy because I leave a lot of previous attempts in there as comments).

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Brecht Sanders