辛亚平的博客专栏

在Windows平台使用Visual C++ 2022编译QT6源码

在 Windows 平台使用 Visual C++ 2022 编译 QT6 源码

0. 引言

如果您想要自己编译 QT6 的开发库,可以参考我这篇短文。什么时候需要自己编译 QT6 开发库呢?或许您想要调研并修补 QT 的 Bug,或许您工作在特殊行业(例如军工行业)需要在不连接互联网的情况下安装 QT 开发库。那我们闲言少叙,直接开始吧。

1. 准备工作

首先要获得我们的QT6开发库的源码。现在是2022年11月,QT6最新的稳定版是6.4.0,所以我刚刚从QT的官方网站下载了一份 QT 6.4.0 的源码,是一份压缩文件:qt-everywhere-src-6.4.0.zip。下载地址:https://download.qt.io/archive/qt/6.4/6.4.0/single/

我们需要准备的工具软件如下表所示:

序号 软件名称 软件版本建议 实际采用的版本
1 Visual Studio 版本不低于VS2015 Visual Studio 2022 (17.4.0)
2 Python Python 3.x-64位 Python 3.11.0-64位
3 Perl Perl5-64位 Perl5 v5.32.1 for MSWin32-x64-multi-thread
4 cmake 版本不低于3.16 cmake 3.24.3
5 ninja 版本不低于1.10.2 ninja 1.11.1 这是我自己编译的

然后将QT 6.4.0 的源码qt-everywhere-src-6.4.0.zip解压缩。接下来的一切操作,全都是在解压后的源码目录中进行。
我很刻意地把源码解压目录重命名为:qt-everywhere-src-6.4.0_x64。为什么呢?因为接下来的操作我是以编译为64位版本为例的。假如您还需要编译一份32位版本,那么您可以将源码目录重命名为qt-everywhere-src-6.4.0_x86,就不跟这个64位的库混淆了。

2. 配置

以我的开发环境为例,现在我的 QT6 源码目录的路径是D:\Dev\qt-everywhere-src-6.4.0_x64,我想要把编译过程中生产的文件保存在D:\QT6_x64目录中。

在开始菜单中单击 Visual Studio 2022 的x64 Native Tools Command Prompt for VS 2022控制台窗口。
注意:本文是以编译64位的QT6为例进行操作的,如果您需要编译32位版本,请单击 Visual Studio 2022 的x86ve Tools Command Prompt for VS 2022控制台窗口。

在此控制台窗口中执行以下命令:
cd /d D:\Dev\qt-everywhere-src-6.4.0_x64

cd /d D:\Dev\qt-everywhere-src-6.4.0_x64
configure -prefix D:\QT6_x64\ -debug-and-release -opensource

如下图所示:
image
执行完了以后输出的运行日志如下图所示:
image

仔细阅读上述日志,尤其关注配置失败的条目,看看这些没有配置成功的条目是否是自己所关心(需要)的模块。假如您希望安装的模块没有配置成功,那么需要通过google、stackoverflow等互联网资源进行搜索调查,看看如何解决。有些条目可能需要依赖一些第三方库,那么您需要把第三方库的源码文件拷贝到相应目录中,再重新执行一下这个配置过程。

我的配置结果日志文件如下所示:

点击查看代码
**********************************************************************
** Visual Studio 2022 Developer Command Prompt v17.4.0
** Copyright (c) 2022 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'

D:\App\Dev\Microsoft\Visual_Studio\2022\Enterprise>cd /d D:\Dev\qt-everywhere-src-6.4.0_x64

D:\Dev\qt-everywhere-src-6.4.0_x64>configure -prefix D:\QT6_x64\ -debug-and-release -opensource
+ cd qtbase
+ D:\Dev\qt-everywhere-src-6.4.0_x64\qtbase\configure.bat -top-level -prefix D:\QT6_x64\ -debug-and-release -opensource
-- Windows 10 SDK version: 10.0.19041.0
'D:/App/Dev/CMake/bin/cmake.exe' '-DCMAKE_INSTALL_PREFIX=D:/QT6_x64;-debug-and-release' '-G' 'Ninja' 'D:/Dev/qt-everywhere-src-6.4.0_x64'
-- The CXX compiler identification is MSVC 19.34.31933.0
-- The C compiler identification is MSVC 19.34.31933.0
-- The ASM compiler identification is MSVC
-- Found assembler: D:/App/Dev/Microsoft/Visual_Studio/2022/Enterprise/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: D:/App/Dev/Microsoft/Visual_Studio/2022/Enterprise/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: D:/App/Dev/Microsoft/Visual_Studio/2022/Enterprise/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
Checking dependencies of submodule 'qtbase'
Checking dependencies of submodule 'qtimageformats'
Checking dependencies of submodule 'qtlanguageserver'
Checking dependencies of submodule 'qtshadertools'
Checking dependencies of submodule 'qtsvg'
Checking dependencies of submodule 'qtdeclarative'
Checking dependencies of submodule 'qtmultimedia'
Checking dependencies of submodule 'qt3d'
Checking dependencies of submodule 'qt5compat'
Checking dependencies of submodule 'qtactiveqt'
Checking dependencies of submodule 'qtcharts'
Checking dependencies of submodule 'qtcoap'
Checking dependencies of submodule 'qtconnectivity'
Checking dependencies of submodule 'qtdatavis3d'
Checking dependencies of submodule 'qttools'
Checking dependencies of submodule 'qtdoc'
Checking dependencies of submodule 'qtwebsockets'
Checking dependencies of submodule 'qthttpserver'
Checking dependencies of submodule 'qtlottie'
Checking dependencies of submodule 'qtmqtt'
Checking dependencies of submodule 'qtnetworkauth'
Checking dependencies of submodule 'qtopcua'
Checking dependencies of submodule 'qtserialport'
Checking dependencies of submodule 'qtpositioning'
Checking dependencies of submodule 'qtquicktimeline'
Checking dependencies of submodule 'qtquick3d'
Checking dependencies of submodule 'qtquick3dphysics'
Checking dependencies of submodule 'qtremoteobjects'
Checking dependencies of submodule 'qtscxml'
Checking dependencies of submodule 'qtsensors'
Checking dependencies of submodule 'qtserialbus'
Checking dependencies of submodule 'qtspeech'
Checking dependencies of submodule 'qttranslations'
Checking dependencies of submodule 'qtvirtualkeyboard'
Checking dependencies of submodule 'qtwayland'
Checking dependencies of submodule 'qtwebchannel'
Checking dependencies of submodule 'qtwebengine'
Checking dependencies of submodule 'qtwebview'
Configuring submodule 'qtbase'
-- Could NOT find md4c (missing: md4c_DIR)
QtCore: WARNING: D:/Dev/qt-everywhere-src-6.4.0_x64/qtbase/src/corelib/tools/qatomicscopedvaluerollback_p.h does not have the "We mean it." warning
-- Could NOT find md4c (missing: md4c_DIR)
Configuring submodule 'qtimageformats'
Configuring submodule 'qtlanguageserver'
Configuring submodule 'qtshadertools'
Configuring submodule 'qtsvg'
Configuring submodule 'qtdeclarative'
QtQuickDialogs2QuickImpl: WARNING: D:/Dev/qt-everywhere-src-6.4.0_x64/qtdeclarative/src/quickdialogs2/quickdialogs2quickimpl/qquickcolordialogutils_p.h does not have the "We mean it." warning
shaders/SaturationLightness.frag -> shaders/SaturationLightness.frag.qsb exposed as :/qt-project.org/imports/QtQuick/Dialogs/quickimpl/shaders/SaturationLightness.frag.qsb
QtQmlDom: WARNING: D:/Dev/qt-everywhere-src-6.4.0_x64/qtdeclarative/src/qmldom/standalone/private/qtqmlcompilerexports_p.h does not have the "We mean it." warning
Configuring submodule 'qtmultimedia'
Configuring submodule 'qt3d'
CMake Warning (dev) at qtbase/lib/cmake/Qt6Qml/Qt6QmlBuildInternals.cmake:410 (message):
  INSTALL_SOURCE_QMLTYPES option is deprecated and should not be used.
  Please port your module to use declarative type registration.
Call Stack (most recent call first):
  qt3d/src/quick3d/imports/render/CMakeLists.txt:7 (qt_internal_add_qml_module)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at qtbase/lib/cmake/Qt6Qml/Qt6QmlBuildInternals.cmake:410 (message):
  INSTALL_SOURCE_QMLTYPES option is deprecated and should not be used.
  Please port your module to use declarative type registration.
Call Stack (most recent call first):
  qt3d/src/quick3d/imports/scene3d/CMakeLists.txt:7 (qt_internal_add_qml_module)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at qtbase/lib/cmake/Qt6Qml/Qt6QmlBuildInternals.cmake:410 (message):
  INSTALL_SOURCE_QMLTYPES option is deprecated and should not be used.
  Please port your module to use declarative type registration.
Call Stack (most recent call first):
  qt3d/src/quick3d/imports/extras/CMakeLists.txt:7 (qt_internal_add_qml_module)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at qtbase/lib/cmake/Qt6Qml/Qt6QmlBuildInternals.cmake:410 (message):
  INSTALL_SOURCE_QMLTYPES option is deprecated and should not be used.
  Please port your module to use declarative type registration.
Call Stack (most recent call first):
  qt3d/src/quick3d/imports/scene2d/CMakeLists.txt:7 (qt_internal_add_qml_module)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at qtbase/lib/cmake/Qt6Qml/Qt6QmlBuildInternals.cmake:410 (message):
  INSTALL_SOURCE_QMLTYPES option is deprecated and should not be used.
  Please port your module to use declarative type registration.
Call Stack (most recent call first):
  qt3d/src/quick3d/imports/input/CMakeLists.txt:7 (qt_internal_add_qml_module)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at qtbase/lib/cmake/Qt6Qml/Qt6QmlBuildInternals.cmake:410 (message):
  INSTALL_SOURCE_QMLTYPES option is deprecated and should not be used.
  Please port your module to use declarative type registration.
Call Stack (most recent call first):
  qt3d/src/quick3d/imports/logic/CMakeLists.txt:7 (qt_internal_add_qml_module)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at qtbase/lib/cmake/Qt6Qml/Qt6QmlBuildInternals.cmake:410 (message):
  INSTALL_SOURCE_QMLTYPES option is deprecated and should not be used.
  Please port your module to use declarative type registration.
Call Stack (most recent call first):
  qt3d/src/quick3d/imports/animation/CMakeLists.txt:7 (qt_internal_add_qml_module)
This warning is for project developers.  Use -Wno-dev to suppress it.

Configuring submodule 'qt5compat'
CMake Warning (dev) at qtbase/lib/cmake/Qt6Qml/Qt6QmlBuildInternals.cmake:410 (message):
  INSTALL_SOURCE_QMLTYPES option is deprecated and should not be used.
  Please port your module to use declarative type registration.
Call Stack (most recent call first):
  qt5compat/src/imports/graphicaleffects5/CMakeLists.txt:33 (qt_internal_add_qml_module)
This warning is for project developers.  Use -Wno-dev to suppress it.

Configuring submodule 'qtactiveqt'
Configuring submodule 'qtcharts'
Configuring submodule 'qtcoap'
Configuring submodule 'qtconnectivity'
Configuring submodule 'qtdatavis3d'
Configuring submodule 'qttools'
-- Could NOT find Clang (missing: Clang_DIR)
-- Could NOT find Clang (missing: Clang_DIR)
QtDesigner: WARNING: D:/Dev/qt-everywhere-src-6.4.0_x64/qttools/src/designer/src/lib/uilib/formbuilder.h includes abstractformbuilder.h when it should include QtDesigner/abstractformbuilder.h
Configuring submodule 'qtdoc'
Configuring submodule 'qtwebsockets'
CMake Warning (dev) at qtbase/lib/cmake/Qt6Qml/Qt6QmlBuildInternals.cmake:410 (message):
  INSTALL_SOURCE_QMLTYPES option is deprecated and should not be used.
  Please port your module to use declarative type registration.
Call Stack (most recent call first):
  qtwebsockets/src/imports/qmlwebsockets/CMakeLists.txt:1 (qt_internal_add_qml_module)
This warning is for project developers.  Use -Wno-dev to suppress it.

Configuring submodule 'qthttpserver'
Configuring submodule 'qtlottie'
CMake Warning (dev) at qtbase/lib/cmake/Qt6Qml/Qt6QmlBuildInternals.cmake:410 (message):
  INSTALL_SOURCE_QMLTYPES option is deprecated and should not be used.
  Please port your module to use declarative type registration.
Call Stack (most recent call first):
  qtlottie/src/imports/CMakeLists.txt:1 (qt_internal_add_qml_module)
This warning is for project developers.  Use -Wno-dev to suppress it.

Configuring submodule 'qtmqtt'
Configuring submodule 'qtnetworkauth'
Configuring submodule 'qtopcua'
Configuring submodule 'qtserialport'
Configuring submodule 'qtpositioning'
Configuring submodule 'qtquicktimeline'
Configuring submodule 'qtquick3d'
assets/shaders/frostedGlass.frag -> assets/shaders/frostedGlass.frag.qsb exposed as ://assets/shaders/frostedGlass.frag.qsb
Configuring submodule 'qtquick3dphysics'
Configuring submodule 'qtremoteobjects'
Configuring submodule 'qtscxml'
Configuring submodule 'qtsensors'
Configuring submodule 'qtserialbus'
Configuring submodule 'qtspeech'
Configuring submodule 'qttranslations'
CMake Warning at qttranslations/translations/CMakeLists.txt:37 (message):
  Directory
  'D:/Dev/qt-everywhere-src-6.4.0_x64/qttranslations/translations/../../qtlocation/src'
  for qtlocation does not exist.  Skipping...
Call Stack (most recent call first):
  qttranslations/translations/CMakeLists.txt:105 (add_ts_targets)


CMake Warning at qttranslations/translations/CMakeLists.txt:44 (message):
  No source files located for qtlocation, skipping target creation
Call Stack (most recent call first):
  qttranslations/translations/CMakeLists.txt:105 (add_ts_targets)


Configuring submodule 'qtvirtualkeyboard'
QtVirtualKeyboard: WARNING: D:/Dev/qt-everywhere-src-6.4.0_x64/qtvirtualkeyboard/src/virtualkeyboard/qvirtualkeyboard_namespace.h does not include QT_BEGIN_NAMESPACE
Configuring submodule 'qtwayland'
Skipping the build as the condition "LINUX OR MACOS OR QNX" is not met.
Configuring submodule 'qtwebchannel'
CMake Warning (dev) at qtbase/lib/cmake/Qt6Qml/Qt6QmlBuildInternals.cmake:410 (message):
  INSTALL_SOURCE_QMLTYPES option is deprecated and should not be used.
  Please port your module to use declarative type registration.
Call Stack (most recent call first):
  qtwebchannel/src/imports/webchannel/CMakeLists.txt:7 (qt_internal_add_qml_module)
This warning is for project developers.  Use -Wno-dev to suppress it.

Configuring submodule 'qtwebengine'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'html5lib'
-- Windows 10 SDK version: 10.0.19041.0
-- Support check for QtWebEngine failed: node.js version 12 or later is required.
-- Support check for QtPdf failed: node.js version 12 or later is required.
Configuring submodule 'qtwebview'
-- Could NOT find Qt6WebEngineCore (missing: Qt6WebEngineCore_DIR)
CMake Warning at qtbase/lib/cmake/Qt6/Qt6Config.cmake:270 (message):
  Failed to find optional Qt component "WebEngineCore".

  Expected Config file at
  "D:/Dev/qt-everywhere-src-6.4.0_x64/qtbase/lib/cmake/Qt6WebEngineCore/Qt6WebEngineCoreConfig.cmake"
  does NOT exist

Call Stack (most recent call first):
  qtwebview/CMakeLists.txt:12 (find_package)


-- Could NOT find Qt6WebEngineQuick (missing: Qt6WebEngineQuick_DIR)
CMake Warning at qtbase/lib/cmake/Qt6/Qt6Config.cmake:270 (message):
  Failed to find optional Qt component "WebEngineQuick".

  Expected Config file at
  "D:/Dev/qt-everywhere-src-6.4.0_x64/qtbase/lib/cmake/Qt6WebEngineQuick/Qt6WebEngineQuickConfig.cmake"
  does NOT exist

Call Stack (most recent call first):
  qtwebview/CMakeLists.txt:12 (find_package)



-- Configuration summary shown below. It has also been written to D:/Dev/qt-everywhere-src-6.4.0_x64/config.summary
-- Configure with --log-level=STATUS or higher to increase CMake's message verbosity. The log level does not persist across reconfigurations.

-- Configure summary:

Building for: win32-msvc (x86_64, CPU features: sse sse2)
Compiler: msvc 19.34.31933.0
Build options:
  Mode ................................... debug
  Fully optimize release builds (-O3) .... no
  Building shared libraries .............. yes
  Using C standard ....................... C11
  Using C++ standard ..................... C++17
  Relocatable ............................ yes
  Using precompiled headers .............. yes
  Using LTCG ............................. no
  Using Intel CET ........................ no
  Target compiler supports:
    SSE .................................. SSE2 SSE3 SSSE3 SSE4.1 SSE4.2
    AVX .................................. AVX AVX2 VAES
    AVX512 ............................... F ER CD PF DQ BW VL IFMA VBMI AVX512VBMI2
    Other x86 ............................ AES F16C RDRAND SHA
  Sanitizers:
    Addresses ............................ no
    Threads .............................. no
    Memory ............................... no
    Fuzzer (instrumentation only) ........ no
    Undefined ............................ no
  Build parts ............................ libs tools
  App store compliance ................... no
Qt modules and options:
  Qt Concurrent .......................... yes
  Qt D-Bus ............................... yes
  Qt D-Bus directly linked to libdbus .... no
  Qt Gui ................................. yes
  Qt Network ............................. yes
  Qt PrintSupport ........................ yes
  Qt Sql ................................. yes
  Qt Testlib ............................. yes
  Qt Widgets ............................. yes
  Qt Xml ................................. yes
Support enabled for:
  Using pkg-config ....................... no
  udev ................................... no
  Using system zlib ...................... no
  Zstandard support ...................... no
  Thread support ......................... yes
Common build options:
  Linker can resolve circular dependencies  yes
Qt Core:
  backtrace .............................. no
  DoubleConversion ....................... yes
    Using system DoubleConversion ........ no
  GLib ................................... no
  ICU .................................... no
  Using system libb2 ..................... no
  Built-in copy of the MIME database ..... yes
  cpp/winrt base ......................... yes
  Tracing backend ........................ <none>
  Logging backends:
    journald ............................. no
    syslog ............................... no
    slog2 ................................ no
  PCRE2 .................................. yes
    Using system PCRE2 ................... no
Qt Sql:
  SQL item models ........................ yes
Qt Network:
  getifaddrs() ........................... no
  IPv6 ifname ............................ no
  libproxy ............................... no
  Schannel ............................... yes
  OpenSSL ................................ yes
    Qt directly linked to OpenSSL ........ no
  OpenSSL 1.1 ............................ yes
  DTLS ................................... yes
  OCSP-stapling .......................... yes
  SCTP ................................... no
  Use system proxies ..................... yes
  GSSAPI ................................. no
  Brotli Decompression Support ........... no
  qTopLevelDomain() ...................... yes
    Built-in publicsuffix database ....... yes
    System publicsuffix database ......... no
Core tools:
  Android deployment tool ................ yes
  macOS deployment tool .................. no
  Windows deployment tool ................ yes
  qmake .................................. yes
Qt Gui:
  Accessibility .......................... yes
  FreeType ............................... yes
    Using system FreeType ................ no
  HarfBuzz ............................... yes
    Using system HarfBuzz ................ no
  Fontconfig ............................. no
  Image formats:
    GIF .................................. yes
    ICO .................................. yes
    JPEG ................................. yes
      Using system libjpeg ............... no
    PNG .................................. yes
      Using system libpng ................ no
  Text formats:
    HtmlParser ........................... yes
    CssParser ............................ yes
    OdfWriter ............................ yes
    MarkdownReader ....................... yes
      Using system libmd4c ............... no
    MarkdownWriter ....................... yes
  EGL .................................... no
  OpenVG ................................. no
  OpenGL:
    Desktop OpenGL ....................... no
    Dynamic OpenGL ....................... yes
    OpenGL ES 2.0 ........................ no
    OpenGL ES 3.0 ........................ no
    OpenGL ES 3.1 ........................ no
    OpenGL ES 3.2 ........................ no
  Vulkan ................................. no
  Session Management ..................... yes
Features used by QPA backends:
  evdev .................................. no
  libinput ............................... no
  HiRes wheel support in libinput ........ no
  INTEGRITY HID .......................... no
  mtdev .................................. no
  tslib .................................. no
  xkbcommon .............................. no
  X11 specific:
    XLib ................................. no
    XCB Xlib ............................. no
    EGL on X11 ........................... no
    xkbcommon-x11 ........................ no
    xcb-sm ............................... no
QPA backends:
  DirectFB ............................... no
  EGLFS .................................. no
  EGLFS details:
    EGLFS OpenWFD ........................ no
    EGLFS i.Mx6 .......................... no
    EGLFS i.Mx6 Wayland .................. no
    EGLFS RCAR ........................... no
    EGLFS EGLDevice ...................... no
    EGLFS GBM ............................ no
    EGLFS VSP2 ........................... no
    EGLFS Mali ........................... no
    EGLFS Raspberry Pi ................... no
    EGLFS X11 ............................ no
  LinuxFB ................................ no
  VNC .................................... no
  VK_KHR_display ......................... no
  QNX:
    lgmon ................................ no
    IMF .................................. no
  XCB:
    Using system-provided xcb-xinput ..... no
    GL integrations:
      GLX Plugin ......................... no
        XCB GLX .......................... no
      EGL-X11 Plugin ..................... no
  Windows:
    Direct 2D ............................ yes
    Direct 2D 1.1 ........................ yes
    DirectWrite .......................... yes
    DirectWrite 3 ........................ yes
Qt Widgets:
  GTK+ ................................... no
  Styles ................................. Fusion Windows WindowsVista
Qt Testlib:
  Tester for item models ................. yes
Qt PrintSupport:
  CUPS ................................... no
Qt Sql Drivers:
  DB2 (IBM) .............................. no
  InterBase .............................. no
  MySql .................................. no
  OCI (Oracle) ........................... no
  ODBC ................................... yes
  PostgreSQL ............................. no
  SQLite ................................. yes
    Using system provided SQLite ......... no
Further Image Formats:
  JasPer ................................. no
  MNG .................................... no
  TIFF ................................... yes
    Using system libtiff ................. no
  WEBP ................................... yes
    Using system libwebp ................. no
Qt QML:
  QML network support .................... yes
  QML debugging and profiling support .... yes
  QML just-in-time compiler .............. yes
  QML XML http request ................... yes
  QML Locale ............................. yes
Qt QML Models:
  QML list model ......................... yes
  QML delegate model ..................... yes
Qt Quick:
  AnimatedImage item ..................... yes
  Canvas item ............................ yes
  Support for Qt Quick Designer .......... yes
  Flipable item .......................... yes
  GridView item .......................... yes
  ListView item .......................... yes
  TableView item ......................... yes
  TreeView item .......................... yes
  Path support ........................... yes
  PathView item .......................... yes
  Positioner items ....................... yes
  Repeater item .......................... yes
  ShaderEffect item ...................... yes
  Sprite item ............................ yes
Qt Quick Templates 2:
  Hover support .......................... yes
  Multi-touch support .................... yes
  Calendar support ....................... yes
Qt Quick Controls 2:
  Styles ................................. Basic Fusion Imagine iOS Material Universal macOS Windows
Qt Multimedia:
  Spatial Audio .......................... yes
  Spatial Audio (Quick3D) ................ no
  Low level Audio Backend:
    ALSA (experimental) .................. no
    PulseAudio ........................... no
    MMRenderer ........................... no
    CoreAudio ............................ no
    Windows Media SDK .................... yes
    Open SLES (Android) .................. no
    Web Assembly ......................... no
  Plugin:
    GStreamer 1.0 ........................ no
    FFmpeg ............................... no
    MMRenderer ........................... no
    AVFoundation ......................... no
    Windows Media Foundation ............. yes
  Hardware acceleration and features:
    Video for Linux ...................... no
    VAAPI support ........................ no
    Linux DMA buffer support ............. no
    VideoToolbox ......................... no
Qt 3D:
  Assimp ................................. yes
  System Assimp .......................... no
  Use SSE2 instructions .................. yes
  Use AVX2 instructions .................. no
  Aspects:
    Render aspect ........................ yes
    Input aspect ......................... yes
    Logic aspect ......................... yes
    Animation aspect ..................... yes
    Extras aspect ........................ yes
Qt 3D APIs:
  Vulkan ................................. no
Qt 3D Renderers:
  OpenGL Renderer ........................ yes
  RHI Renderer ........................... yes
Qt3D Geometry Loaders:
  Autodesk FBX ........................... no
Qt 5 Compatibility Libraries:
  iconv .................................. no
Qt Charts Types:
  Area Chart ............................. yes
  Line Chart ............................. yes
  Spline Chart ........................... yes
  Scatter Chart .......................... yes
  Bar Chart .............................. yes
  Pie Chart .............................. yes
  Boxplot Chart .......................... yes
  Candlestick Chart ...................... yes
Qt Axis Types:
  DateTime Axis .......................... yes
Qt Bluetooth:
  BlueZ .................................. no
  BlueZ Low Energy ....................... no
  Linux Crypto API ....................... no
  WinRT Bluetooth API .................... yes
  Qt Tools:
    Qt Assistant ......................... yes
    QDoc ................................. no
    Clang-based lupdate parser ........... no
    Qt Designer .......................... yes
    Qt Distance Field Generator .......... yes
    Qt Linguist .......................... yes
    pixeltool ............................ yes
    qdbus ................................ yes
    Qt Attributions Scanner .............. yes
    qtdiag ............................... yes
    qtplugininfo ......................... yes
  Qt Opcua:
    Open62541 ............................ yes
    Unified Automation C++ SDK ........... no
    Support for namespace 0 NodeId names . yes
    Namespace 0 NodeIds generator ........ no
    Open62541 security support ........... no
    Support for global discovery server .. no
  Serial Port:
    ntddmodm ............................. no
  QtQuick3D:
    Assimp ............................... yes
    System Assimp ........................ no
  Qt Remote Objects:
    High Availability Manager (ham) ...... no
  Qt Scxml:
    ECMAScript data model for QtScxml .... yes
  Qt Sensors:
    WinRT sensors backend ................ yes
  Qt SerialBus:
    Socket CAN ........................... no
    Socket CAN FD ........................ no
    SerialPort Support ................... yes
  Qt TextToSpeech:
    Flite ................................ no
    Flite with ALSA ...................... no
    Speech Dispatcher .................... no
  Qt Virtualkeyboard:
    Desktop integration .................. yes
    Built-in layouts ..................... yes
    Key navigation ....................... no
    Retro style as default ............... no
    Sensitive Debug ...................... no
    Cerence .............................. no
      Static Linking ..................... no
      Handwriting ........................ no
        Alphabetic ....................... no
        CJK .............................. no
      XT9 ................................ no
        XT9 Debug ........................ no
        XT9 9-key layouts ................ no
      Bundle resources ..................
. no
        Handwriting ...................... no
        XT9 .............................. no
    Hunspell ............................. no
      Using Hunspell copy from 3rdparty/ . no
    OpenWnn .............................. yes
    MyScript ............................. no
    Language support enabled for:
      Arabic ............................. yes
      Bulgarian .......................... yes
      Czech .............................. yes
      Danish ............................. yes
      German ............................. yes
      Greek .............................. yes
      English GB ......................... yes
      English US ......................... yes
      Spanish ............................ yes
      Spanish Mexico ..................... yes
      Estonian ........................... yes
      Farsi .............................. yes
      Finnish ............................ yes
      French Canada ...................... yes
      French France ...................... yes
   Note: Hunspell in Qt Virtual Keyboard is not enabled. Spelling correction will not be available.

WARNING: QDoc will not be compiled, probably because libclang could not be located. This means that you cannot build the Qt documentation.
Either set CMAKE_PREFIX_PATH or LLVM_INSTALL_DIR to the location of your llvm installation.
On Linux systems, you may be able to install libclang by installing the libclang-dev or libclang-devel package, depending on your distribution.
On macOS, you can use Homebrew's llvm package.
You will also need to set the FEATURE_clang CMake variable to ON to re-evaluate this check.
WARNING: Clang-based lupdate parser will not be available. LLVM and Clang C++ libraries have not been found.
   Hebrew ............................. yes
      Hindi .............................. yes
      Croatian ........................... yes
      Hungarian .......................... yes
      Indonesian ......................... yes
      Italian ............................ yes
      Japanese ........................... yes
      Korean ............................. yes
      Malay .............................. yes
      Norwegian .......................... yes
      Dutch .............................. yes
      Polish ............................. yes
      Portuguese Brazil .................. yes
      Portuguese Portugal ................ yes
      Romanian ........................... yes
      Russian ............................ yes
      Slovak ............................. yes
      Slovenian .......................... yes
      Albanian ........................... yes
      Serbian ............................ yes
      Swedish ............................ yes
      Thai .............................You will need to set the FEATURE_clangcpp CMake variable to ON to re-evaluate this check.
WARNING: QtWebEngine won't be built. node.js version 12 or later is required.
WARNING: QtPdf won't be built. node.js version 12 or later is required.

.. yes
      Turkish ............................ yes
      Ukrainian .......................... yes
      Vietnamese ......................... yes
      Simplified Chinese ................. yes
      Traditional Chinese ................ yes
      HongKong Chinese ................... no
    Traditional chinese input methods:
      Zhuyin ............................. yes
      Cangjie ............................ yes
  WebEngine Repository Build Options:
    Build Ninja .......................... no
    Build Gn ............................. yes
    Jumbo Build .......................... yes
    Developer build ...................... no
    Build QtWebEngine Modules:
      Build QtWebEngineCore .............. no
      Build QtWebEngineWidgets ........... no
      Build QtWebEngineQuick ............. no
    Build QtPdf Modules:
      Build QtPdfWidgets ................. no
      Build QtPdfQuick ................... no

--

Qt is now configured for building. Just run 'cmake --build . --parallel'

Once everything is built, you must run 'cmake --install .'
Qt will be installed into 'D:/QT6_x64
D:/Dev/qt-everywhere-src-6.4.0_x64/-debug-and-release'

To configure and build other Qt modules, you can use the following convenience script:
        D:/QT6_x64
D:/Dev/qt-everywhere-src-6.4.0_x64/-debug-and-release/bin/qt-configure-module.bat

If reconfiguration fails for some reason, try removing 'CMakeCache.txt' from the build directory

-- Configuring done
-- Generating done
-- Build files have been written to: D:/Dev/qt-everywhere-src-6.4.0_x64

D:\Dev\qt-everywhere-src-6.4.0_x64>

3. 编译和安装

继续在 Visual Studio 2022 的x64 Native Tools Command Prompt for VS 2022控制台窗口中执行以下 2 条命令,分别完成编译和安装这 2 个过程。

cmake --build . --parallel
cmake --install .

操作完毕。

posted on 2022-11-14 01:36  辛亚平  阅读(3960)  评论(0编辑  收藏  举报

导航