简体   繁体   中英

CMake: Qt Project to CLion with MSVC 2017

I'm having a project in Qt Creator and I'm trying to port it into CLion but I found myself blocked into some problems. If any of you could help me to port this CMake project I would really appreciate it.


Qt Creator

So, here is my setup for the Qt Creator project first:

Qt: 5.14.2

Compiler: MSVC 2017 64-bits

在此处输入图像描述

Also, here are my custom paths and my build environment:

在此处输入图像描述

Also, the build (install) time in Qt Creator takes around 20-30minutes.


CLion

Now in terms of CLion and what I've tried here are the following.

在此处输入图像描述

and in terms of setting up the CMake:

在此处输入图像描述

I've also added the paths into Environment Variables from CLion

在此处输入图像描述

But the problem arises when I'm trying to compile the project. I'm going to install the project via Build -> Install

在此处输入图像描述

After that, I need to wait for around 1h or more(even if in Qt Creator is going to take just 20-30min) to a point where the build will fail and I will receive the following error message

MASM : fatal error A1000: cannot open file : 4 [C:\PRJOJECT_NAME\build_clion\components\extern_crashpad\crashpad\util\crashpad_util.vcxproj]

but if I'm searching for that file, it exists in that folder which is specified. But the problem is that I don't understand why the same project if build with Qt Creator is working but not vice versa. Could any of you help me to understand what I'm doing wrong?

It looks like QT Creator is using Ninja as a generator and CLion is using MSVC.

Try -G Ninja in your CLion CMake Options text box. Make sure Ninja is in a path accessible by CMake.

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