- Run CLion
- Set Do not import settings, as there is nothing to import yet.
- Setup Light/Dark theme
- For the sake of simplicity, disable all plugins.
- Do not enable any featured plugins.
- Start using CLion.
- Toggle Evaluate for free for 30 days.
- Continue.
- On MacOS, hopefully everything is autoconfigured.
- CMake is bundled
- Make is autodetected from
/usr/bin
- CCompiler is taken from
CommandLineTools
- C++ Compiler is autodetected, too
- Debugger is Bundled LLDB
- Create a New Project.
- From the flavours on the left, pick C Executable.
- Pick an appropriate C Standard, such as C99.
- Wait a little bit for indexing to complete.
- Run
main.c
by clicking on the green "Play" triangle next to theint main()
line in the editor line gutter.
Install the plugin:
- Preferences > Plugins > C/C++ Single File Execution (by corochann).
- Restart IntelliJ
Usage:
- Create an additional file, e. g.
number.c
withmain()
. - Right click into the editor, select Add Executable for single c/cpp file.
- A notification “add_executable added for number.c.“ will be shown.
- Open
CMakeLists.txt
from the Project Tree. A Reload notification shows up. Enable Autoreload. - Now, run the
number.c
by clicking on the green "Play" triangle next to theint main()
line in the editor line gutter.