How to use Jetbrains Clion compile and run a single cpp file (configure their own external tools) 1

This article refer to the following blog post, but it did not have a place to make it clear, as I ought way to do it, I had a little mistake.
Slight modifications on it. Following the modified method posted (mainly copy him, made some modifications)

https://blog.csdn.net/he_yang_/article/details/96644480

 

We all know that clion using cmake to build and run the project for a single cpp file compiler does not support. Some online method is achieved by modifying the CmakeLists.txt file, but creates a file each time you have to modify the file, relatively cumbersome, so is there any way once and for all it?
Haha, of course, some friends !!!
we can to achieve this functionality to configure external tools.

1. Configure External Tools

Here Insert Picture Description

Here Insert Picture Description

Here g ++, G ++ to change the bin file of your own mingw. Exe, others do exactly as drawing the line
Here Insert Picture Description

2 Configure Shortcuts

Here Insert Picture Description

3. Test

Here Insert Picture Description
Here Insert Picture Description

Done

After the configuration I think there may be a key to compile and run, then had to try.
however. . .
Command line can be executed, the tool is not, why he is not yet. . .
Here Insert Picture Description

Here Insert Picture Description

 

 

The only drawback is that still need points twice, not once both compile and run.

Guess you like

Origin www.cnblogs.com/wmxl/p/12052232.html