I am working on some c++ stuff and I hate having to create a whole new project just to run a few things on a file.
I also don\'t like how when you creat
Inside every CLion project there is a file CMakeLists.txt.
To run a single file you will have to write a single command inside this file and that is:
add_executable(file_name_without_extension_cpp file_name_with_extension_cpp)
For example: add_executable(CoinChange CoinChange.cpp)
Then click reload changes and then go to run option and then select the file you want to run then hit the run button. Your single file will be run.
How many single files will be in your CLion project you will have to perform this same action for running every single file.