-
Notifications
You must be signed in to change notification settings - Fork 9
Installing and Configuring CLion
For working with this project, CLion is our recommended IDE and the one used by the developers. The free community edition has all the tools needed to contribute to this project.
You are welcome to use any IDE you want, but we won't be available for troubleshooting if you have any problems with it. If you are convinced another IDE is superior in any way, feel free to write an installation guide for that IDE.
-
Download CLion and install.
-
Install compiler
- Open CLion.
-
ctrl + alt + s
(open settings). - Search for:
toolchains
. - Select "MinGW" as environment.
- This is probably not installed, download and install this, restart CLion after the installation.
- If the path is not correct set this path to MinGW (this probably looks like
C:\Program Files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32
)
-
Test if CLion and C++ work by creating and running a new project:
- Select in the top menu
File → New project → C++ Executable
. - Click
Create
. - In the bottom of the screen you see every thing loading.
- After this is done (without any errors) select in the top menu
Run → Run
.
- Select in the top menu
If there are no errors and the run is successful, everything is set-up correctly!
It is advised to install the Hatchery Plugin as it has ROS support.
You can install Hatchery directly through the IDE, via File | Settings | Plugins | Search for "hatchery"
.
- Install clang-format with
sudo apt-get install -y clang-format-3.8
. - Go to
File->Preferences->Plugins
and search forClangFormatIJ
. Install this plugin. It installs the context menu to invoke locally installed clang-format for a file or for a selection. - Go to
Tools->clang-format
and change theclang-format-binary
toclang-format-3.8
. - Go to
Keymap->Plugins->ClangFormatIJ->Reformat Code with clang-format
and setup a keyboard shortcut.
Your code is now properly formatted when you trigger your shortcut!
Settings -> Editor -> File and Code Templates
- Select Scheme:
Project
- Go to the
Includes
tab and select theC File Header
- Set the following code:
#if ($HEADER_COMMENTS)
// Copyright $YEAR Project March.
#end
-
Apply
and clickOK