Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/corochann/singlefileexecutionplugin
Single File Execution Plugin is a plugin for CLion (C/C++ IDE on IntelliJ platform provided by Jetbrain).
https://github.com/corochann/singlefileexecutionplugin
clion cmakelists cpp intellij jetbrains
Last synced: 5 days ago
JSON representation
Single File Execution Plugin is a plugin for CLion (C/C++ IDE on IntelliJ platform provided by Jetbrain).
- Host: GitHub
- URL: https://github.com/corochann/singlefileexecutionplugin
- Owner: corochann
- License: mit
- Created: 2016-05-12T08:15:54.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-12-28T01:53:14.000Z (almost 4 years ago)
- Last Synced: 2023-08-01T04:54:06.082Z (over 1 year ago)
- Topics: clion, cmakelists, cpp, intellij, jetbrains
- Language: Java
- Size: 77.1 KB
- Stars: 79
- Watchers: 3
- Forks: 12
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SingleFileExecutionPlugin
[CLion](https://www.jetbrains.com/clion/) plugin to execute single file .c/.cpp file quickly.## Description
CLion is a C/C++ IDE on [IntelliJ IDEA](https://www.jetbrains.com/idea/) platform provided by [JetBrains](https://www.jetbrains.com/).CLion is working on CMake platform, so when you want to run a single file with main() function you need to configure CMakeLists.txt file everytime.
This plugin helps you to add a configuration to quickly run a single .c/.cpp file.Links
- **[Document page](http://corochann.com/projects/single-file-execution-plugin)**: for more detail information.
- **[Official plugin page](https://plugins.jetbrains.com/plugin/8352?pr=)**Installation
C/C++ Single File Execution plugin is uploaded on JetBrains repositry, so you can download by navigating [File] → [Settings] → [Plugins] tab → click [Browse repositries...] in CLion.
You can find and install C/C++ Single File Execution plugin.
How to use
- Create or show C/C++ source code you want to run on the editor.
Right click on the editor.- Select "Add executable for single c/cpp file".
That's all! Plugin automatically insert
add_executable
toCMakeLists.txt
with proper path for you.
After that, you can start coding and once it's done, run it by selecting proper executable name on the top-right panel in CLion.
Configuration
Little configuration is available from [File] → [Settings] → [Tools] tab > [Single File Execution Plugin].
executable name
You may specify the executable name. As a default with
%FILENAME%
, it will use a name depending on the source code file name. In this case, every time you add a new source code and insertadd_executable
, new executable name will be added. Build configuration tab can be messy in this case as the number of files increases.Another way is to use "fixed" executable name here (not use
%FILENAME%
), in that case you can always run single source code file with same executable name.runtime output directory
You can also specify a directory where the executable file will be stored after build.
For example, when you set
%FILEDIR%
, executable file will be located in the same directory of source file. This configuration is especially useful when your source code reads/writes another file which is located in same directory of the source file.Concrete example is for programming contest. You may want to read the input data from another text file. You can just place the input data text file in the same directory of source file, and just write below
int main() {
freopen("input_data.txt", "r", stdin);...
}
you can now build and run this program by pressing "run" button on CLion.