Help with Run Configurations

已回答

Very basic roadblock here. I've cloned a GitHub C++ project and am trying to create a Run/Debug Configuration. I don't know what a "Target" is or how to make one; what is the significance of the "All targets" option (which is the only option I'm offered)? I just want to create an executable from one of the main.cpp files in the project.

I also don't know how to complete the "Executable" field: It just says "Not selected" and sends me to a File dialog. What am I supposed to do?

From my research it appears that there should be a CMakeLists.txt file somewhere, but my project doesn't have one.

The project as received from GitHub has several versions of a Make file in the /src directory: Makefile, Makefile.gnu.serial, Makefile.intel.serial, etc. It's my understanding that CMake generates its own Makefile, but I don't know how this may interact with the existing ones.

0

Hello!

CLion uses a concept of a project and relies on CMake as a build system for it for now. This means that now CLion properly works only with CMake projects and you need to convert your project into a CMake one if you would like to work with it in CLion.

By the way, CLion is able to create a CMake project from the existing sources. To give it a try press File | Import Project… or select an Import option on the Welcome wizard. You can find out more information about this feature in the article of our web help:https://www.jetbrains.com/help/clion/importing-existing-non-cmake-project.html . So while you can auto-import existing sources and include directories, any external or non-trivial dependencies wouldn't be resolved (you should set them manually).

Just in case, we have a quick CMake tutorial in order to help our users to get to know CMake: https://www.jetbrains.com/help/clion/quick-cmake-tutorial.html. Also you can find a lot of useful CMake variables with descriptions in this wiki: https://cmake.org/Wiki/CMake_Useful_Variables. And here is the CMake documentation: https://cmake.org/cmake/help/v3.10/.

Also we are going to support Makefiles build system in future versions. Here is the feature request: https://youtrack.jetbrains.com/issue/CPP-494. Please follow it to get updates.

Since CLion 2018.1 we are finally starting to decouple CMake from CLion. This will allow for supporting new popular project models, as well as an API for those who’d like to implement plugins for custom project models for CLion. Please follow updates in our blog.

0

请先登录再写评论。