Here are some of my notes on using Clion. In general, I would say it is a pretty good IDE. However, I do find some issues that took me a while to figure out. Here are some notes and tips on using CLion.
This post covers the following topics
- Make sure to RELOAD CMakeLists.txt often
- Set environment variables such as LD_LIBRARY_PATH
Make sure to RELOAD CMakeLists.txt often
Interface with CMake
By default, CLION will add every source file by name to the dependency of the executables.
However, you can change that by using wild card with FILE
FILE(GLOB, SOURCE_FILES src/*.cpp)
However, a big CAVEAT here
You need to RELOAD the CMAKE file every time you add new files. Otherwise, they won’t be refreshed. Newly added files will not show up in the dependencies.
Set environment variables such as LD_LIBRARY_PATH
Sometimes, I find myself trying to use dynamically loaded libraries. It works in the bash shell, however, it doesn’t work in CLion.
To get around this, go to “run configurations”, set the environment variable there.