CMake+CLion+Qt configuration

Here I downloaded the MSVC toolkit and did not download Visual Studio.

Configure the compilation environment

The two methods are basically the same, and I am currently using the second method.

After downloading the MSVC toolkit, install it. Open CLion and select Toolchains in settings. The path is as follows:

The default compilation environment of CLion is MinGW. I added Visual Studio as the MSVC compilation environment here and set it to Default state.

First set up the Toolset. My installation path is as shown in the picture below, so you can see that the path in the picture above must be under the BuildTools folder to include all the required tools.

If you download Visual Studio, you must specify the corresponding version of Visual Studio. As shown in the figure below, because the download is the Community version, the Toolset must be assigned to the Community version folder.

This is followed by setting up BuildTool, C Compiler and C++ Compiler. The IDE will automatically search, but it is very slow. It is recommended to set it manually.

The toolkit configuration path is shown in the figure below:

Set CMake loading. When the CMake file is modified, the system automatically loads the modified version. Click the "+" sign in the middle to automatically add Release. If you click the + sign again, versions of other modes will be added.

Create C++ project

Set the CMake prefix when creating a C++ project. Select what to compile in Qt. The specific path is as follows:

C:\ProgramFiles\Qt\6.5.2\msvc2019_64\lib\cmake

In fact, just choose msvc2009_64.

Guess you like

Origin blog.csdn.net/weiweiqiao/article/details/132756762