Why use CLion?
- Better indexing and intelligence hints for C++ than Eclipse and QtCreator-desktop.
- Free for students.
- Also integrate PyCharm already.
- Good Git integration (although I am still used to commandline git).
- I really like the
code inspection clang-tidyfunction which makes the code style more modern.
Highly recommend you to add
source <CATKIN_WORKSPACE_DIR>/devel/setup.bash to the end of
~/.zshrc (Depends you use bash or zsh). So when you type
you can find both
/opt/ros/<ROS_DIST>/share. So next time you open any terminal, your cmakelist can find the package of
Method 1: Launch CLion via terminal
Recommend you to make alias for this command in
Method 2: Launch CLion via app icon on sidebar
/usr/share/applications/jetbrains-clion.desktop. If it does not exist, open up Clion and hit
Tools > Create Desktop Entry first. Here I give an example and if you are using
zsh, just change
[Desktop Entry] Version=1.0 Type=Application Name=CLion Icon=XXX/clion-2017.2.3/bin/clion.svg Exec=bash -i -c "XXX/clion-2017.2.3/bin/clion.sh" %f Comment=The Drive to Develop Categories=Development;IDE; Terminal=false StartupWMClass=jetbrains-clion
In CLion, you can set the
Toolchain dialog (including CMake, C++ compiler, gdb) so it can be consistent with your current system-level toolchain.
Also you can set the pass any envrionment variables and parameters to CMake in CLion by using the
|C++ tool chain settings||Cmake settings|
CLion builds your project in
cmake-build-debug by default. If you want to change that, you could easily set:
Or change the build output directory in the
CMake dialog as well.
In addition, the
Run/Debug Configurations dialog in the right up corner allows you to set program execution arguments, working directory, and environment variables.
|open debug & run setting||modify execution arguments|
Now try to build & run your ROS project! I hope this could provide you with better experience on project development.