简体   繁体   中英

How to install Qt5 libraries for Windows 10 for cmake development?

I want to develop in Windows 10 with cmake. I don't need QtCreator, nor any other things. Just the minimum to compile with cmake. I downloaded the qt online installed and selected Qt 5.14.1 but it has 36gb! I don't even have that amount of space.

What is the bare minimum to run Qt/QML applications with cmake?

I downloaded the qt online installed and selected Qt 5.14.1 but it has 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)

If you select "Qt 5.14.1", you select all the builds. That's why you're seeing 36 GB.

Instead of selecting "Qt 5.14.1," expand it and select a single build that matches your compiler. The libraries for MSVC 2017 32-bit is less than 600 MB:

Qt安装程序组件选择

What is the bare minimum to run Qt/QML applications with cmake?

The easiest way to get started is to use the Qt installer. You just need to select 2 components:

  1. Qt > Qt 5.14.1 > (One build of your choice)
  2. Qt > Developer and Designer Tools > Qt Creator 4.11.1

Note 1: You need a C++ compiler, and this compiler must match the build that you choose. Either install the MSVC compiler from Microsoft, or choose 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.

If you really, really want to avoid installing Qt Creator, then you must build the Qt libraries from source code. Here are the instructions: https://wiki.qt.io/Building_Qt_5_from_Git

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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