简体   繁体   English

如何为 Windows 10 安装 Qt5 库以进行 cmake 开发?

[英]How to install Qt5 libraries for Windows 10 for cmake development?

I want to develop in Windows 10 with cmake.我想使用 cmake 在 Windows 10 中进行开发。 I don't need QtCreator, nor any other things.我不需要 QtCreator,也不需要任何其他东西。 Just the minimum to compile with cmake.只是使用 cmake 编译的最低要求。 I downloaded the qt online installed and selected Qt 5.14.1 but it has 36gb!我下载了在线安装的qt并选择了Qt 5.14.1但它有36gb! I don't even have that amount of space.我什至没有那么多空间。

What is the bare minimum to run Qt/QML applications with cmake?使用 cmake 运行 Qt/QML 应用程序的最低要求是什么?

I downloaded the qt online installed and selected Qt 5.14.1 but it has 36gb!我下载了在线安装的qt并选择了Qt 5.14.1但它有36gb!

There are many different builds of Qt 5.14.1 (one build for MSVC 2017 32-bit, one build for MSVC 2017 64-bit, one build for MinGW 7.3.0 32-bit, one build for MinGW 7.3.0 64-bit, one build for Android, and so on) Qt 5.14.1 有许多不同的版本(一种是针对 MSVC 2017 32 位的,一种是针对 MSVC 2017 64 位的,一种是针对 MinGW 7.3.0 32 位的,一种是针对 MinGW 7.3.0 64 位的,一个针对 Android 的构建,等等)

If you select "Qt 5.14.1", you select all the builds.如果选择“Qt 5.14.1”,则选择所有版本。 That's why you're seeing 36 GB.这就是您看到 36 GB 的原因。

Instead of selecting "Qt 5.14.1," expand it and select a single build that matches your compiler.不要选择“Qt 5.14.1”,而是展开它并选择与您的编译器匹配的单个构建。 The libraries for MSVC 2017 32-bit is less than 600 MB: MSVC 2017 32 位的库小于 600 MB:

Qt安装程序组件选择

What is the bare minimum to run Qt/QML applications with cmake?使用 cmake 运行 Qt/QML 应用程序的最低要求是什么?

The easiest way to get started is to use the Qt installer.最简单的入门方法是使用 Qt 安装程序。 You just need to select 2 components:您只需要选择 2 个组件:

  1. Qt > Qt 5.14.1 > (One build of your choice) Qt > Qt 5.14.1 > (您选择的一个版本)
  2. Qt > Developer and Designer Tools > Qt Creator 4.11.1 Qt > 开发者和设计者工具 > Qt Creator 4.11.1

Note 1: You need a C++ compiler, and this compiler must match the build that you choose.注 1:您需要一个 C++ 编译器,并且该编译器必须与您选择的构建相匹配。 Either install the MSVC compiler from Microsoft, or choose Qt > Developer and Designer Tools > MinGW 7.3.0 xx-bit要么从 Microsoft 安装 MSVC 编译器,要么选择Qt > Developer and Designer Tools > MinGW 7.3.0 xx-bit

Note 2: You can't de-select Qt Creator in the installer, but that's <600 MB.注意 2:您不能在安装程序中取消选择 Qt Creator,但它小于 600 MB。

If you really, really want to avoid installing Qt Creator, then you must build the Qt libraries from source code.如果您真的非常想避免安装 Qt Creator,那么您必须从源代码构建 Qt 库。 Here are the instructions: https://wiki.qt.io/Building_Qt_5_from_Git以下是说明: https : //wiki.qt.io/Building_Qt_5_from_Git

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM