CLion Notes

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

  1. Shortcuts
  2. Make sure to RELOAD CMakeLists.txt often
  3. Set environment variables such as LD_LIBRARY_PATH

Shortcuts

https://www.jetbrains.com/help/clion/2016.3/keyboard-shortcuts-by-category.html

https://resources.jetbrains.com/storage/products/clion/docs/CLion_ReferenceCard.pdf

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.

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s