CMake with Make

已回答

I have a Makefile project which the source code is on Windows, but a library I need is on WSL-Ubuntu.

For VS Code, I can download the source code into Ubuntu, and use the remote-SSH option to open the source code directly located on Ubuntu.

For CLion, as far as my search goes, all remote options requires the source code to be on the local machine, which is my Windows. What I have done is set up my toolchain, set up my CMake to use my Ubuntu toolchain, and set up my deployment -> mappings to the folder where I would have had the source code if it was on Ubuntu. However, in some of the code, it includes some headers that are in the Ubuntu library:

<llvm/IR/abc.h>

However, CLion warns me: "unable to find declaration to go to", there are also a lot of red code, and the folder is not deployed

I understand that I need CMake, so I created a CMake file, but CLion refuses to pick up the CMakeLists.txt file.

I did find a solution.

I deleted the .idea folder, and moved the Makefile elsewhere. When reopened, CLion prompted me to create a new CMakeList.txt, and after that, I moved back my Makefile, and everything worked smoothly.

Why is CLion not picking up the CMake that I manually created? Is there a setting that I need to change somewhere? Also, is there a way to force CLion to generate a CMake file for me, instead of having to delete .idea and the Makefile.

0

Hello!

Here is the issue about supporting full remote mode for Makefile projects - https://youtrack.jetbrains.com/issue/CPP-20695. This task is in our roadmap for CLion 2021.1. Feel free to comment or upvote the issue in order to get updates. 

>Why is CLion not picking up the CMake that I manually created?

Because you have Makefile in the project, so CLion considered this project as a Makefile project when you first opened it. At the moment there is no option to load/unload Makefile project (https://youtrack.jetbrains.com/issue/CPP-23524, https://youtrack.jetbrains.com/issue/CPP-20733).

>is there a way to force CLion to generate a CMake file for me, instead of having to delete .idea and the Makefile

Currently, no, there is no other way.

0

请先登录再写评论。