C/C++ Single File Execution

Compatible with CLion
Jun 10, 2016
3 270
When you want to build and run single c/cpp file in CLion, CMakeLists.txt needs to be configured to declare add_executable(). It is troublesome when you want to run many of the files independently within the same project.
This plugin supports to insert add_executable() statement into CMakeLists.txt, so that you can easily build and run a single file. Also, you can specify a location of directory for build executable file for each target.
Links:

Download plugin

Recent change notes

version 1.3: Bug fix for config. - Settings was not saved persistently

version 1.2:

  • Add set_target_properties() configuration for target specific runtime output directory setting.
  • Bug fix: handle directory name including whitespace

version 1.1: Bug fix.

General usage instructions

1. Open source file (.c/.cpp) which you want to execute in editor.

2. Right click on editor and choose "Add executable for single c/cpp file".

That's all! Plugin automatically insert add_executable() code in CMakeLists.txt

3. You can build and run this source file from top-right icon or from menu bar.