This is a version of CommonQt adapted for Qt5. It uses the same package names as the original CommonQt for Qt4, therefore the two cannot be loaded simultaneously.
- Ensure you have the following tools accessible via PATH (https://doc.qt.io/qt-5/windows-requirements.html):
* jom (1.1.3 works)
* ninja (v1.10.2 works)
* Ruby (2.7.3 works)
* Python 2.7
* bison and flex 2.5.5
* gnuwin32
* GPerf
* xmlstarlet 1.6.1
* Visual Studio 2019 Community edition
-
Make sure the directory that contains
win_bison.exeandwin_flex.exehas priority overgnuwin32in thePATHenvironment variable. -
Copy or rename
win_bison.exeandwin_flex.exetobison.exeandflex.exe. -
Add the
qt-install\bindirectory to the beginning of the PATH environment variable, it's wheremoc.exeand Qt's DLLs are installed.
Every project listed below should be compiled using "x64 Native Tools Command Prompt for VS 2019" cmd.
Repo: https://github.com/llvm/llvm-project, branch: 11.x.x
mkdir build && cd build
cmake ../llvm -G "Visual Studio 16 2019" -DLLVM_ENABLE_PROJECTS=clang;llvm;openmp -DCMAKE_INSTALL_PREFIX=%cd%\..\..\llvm-install -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_INCLUDE_TESTS=Off -DLLVM_INCLUDE_EXAMPLES=Off -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_CXX_STANDARD=14
msbuild ALL_BUILD.vcxproj -maxcpucount:4 /p:Configuration=RelWithDebInfo
msbuild INSTALL.vcxproj -maxcpucount:4 /p:Configuration=RelWithDebInfo
Repo: https://github.com/qt/qtbase, branch: 5.14.2
configure -opensource -release -platform win32-msvc -nomake tests -nomake examples -c++std c++14 -no-dbus -prefix %cd%\..\qt-install -confirm-license -force-debug-info
..\tools\jom\jom.exe -j 6
Repo: https://github.com/qt/qtdeclarative, branch: 5.14.2
qmake && nmake && nmake install
Repo: https://github.com/qt/qtquickcontrols2, branch: 5.14.2
qmake && nmake && nmake install
Repo: https://github.com/qt/qtwebchannel, branch: 5.14.2
qmake && nmake && nmake install
Repo: https://github.com/qt/qtwebsockets, branch: 5.14.2
qmake && nmake && nmake install
Repo: https://github.com/qt/qtwebengine, branch: 5.14.2
qmake -r && nmake && nmake install
Repo: https://github.com/qt/qtsvg, branch: 5.14.2
qmake && nmake && nmake install
Repo: https://github.com/commonqt/smokegen, branch: clang
mkdir build && cd build
cmake .. -G "Visual Studio 16 2019" -DCMAKE_INSTALL_PREFIX=%cd%\..\..\smokegen-install -DQt5_DIR="%cd%\..\..\qtbase" -DCMAKE_BUILD_TYPE=Release
msbuild ALL_BUILD.vcxproj -maxcpucount:4 /p:Configuration=Release
msbuild INSTALL.vcxproj -maxcpucount:4 /p:Configuration=Release
Repo: https://github.com/commonqt/smokeqt, branch: qt5
mkdir build && cd build
cmake .. -G "Visual Studio 16 2019" -DCMAKE_INSTALL_PREFIX=%cd%\..\..\smokeqt-install -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
msbuild ALL_BUILD.vcxproj -maxcpucount:4 /p:Configuration=Release /t:Rebuild
msbuild INSTALL.vcxproj -maxcpucount:4 /p:Configuration=Release
-
CMAKE_INSTALL_PREFIXand-prefix(for compiling qtbase) indicate the installation directory. Ensure that all those directories are included in thePATHenvironment variable. -
Compiling LLVM takes several GB of space, ensure that there is at least 30GB of free space.
-
The configure step of
qtbasewill set the definitions for all other Qt projects. -
Every project must be compile in the same configuration: DEBUG or RELEASE.
-
Qt, LLVM and smokegen must be compiled in RELEASE mode. The reason why is that Qt5 on windows differentiate the debug vs release dlls by a suffix letter, e.g. Qt5Core.dll (release) vs Qt5Cored.dll (debug). smokegen and smokeqt are not capable of coping with such difference. When migrating to Qt6, this will not be a problem as the suffix letter was dropped.
-
While compiling LLVM openmp, an error about "setlocal" and missing copy files may occur. To work around it:
- Go to
llvm-project\build\bin\Debugand movelibomp.dlltollvm-project\build\bin\; - Go to
llvm-project\build\lib\Debugand movelibomp.dll.libtollvm-project\build\lib; - Go to
llvm-project\build\lib\Debugand movelibomp.libtollvm-project\build\lib; - Run build Again
- Go to
-
Visual Studio 2019.8.1 has a bug (microsoft/STL#1300) that can be fixed using this patch:
- Go to
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\includeand back up filesintrin.handintrin0.h. git apply --unsafe-paths -p6 --directory="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include" vs2019.8.1.diff
- Go to
TODO: The qt-libs project has not yet been adapted to commonqt5.