Skip to content

Using CLion IDE

Jaci R edited this page Feb 7, 2017 · 3 revisions

Using JetBrains CLion IDE with GradleRIO-C

GradleRIO-C supports JetBrains' CLion IDE.

You can install CLion with an Educational License by signing up to JetBrains with your school-provided email address.

Setting Up

From the command line, run ./gradlew clion (or gradlew clion if you're on winblows). This will generate a proxy CMakeLists.txt file that defers build logic to gradle, while still allowing CLion to provide code hinting, include checking and other things IDEs do. You can use Clion and click "Open", directing the IDE to your project directory.

You can run ./gradlew cleanClion to remove CMakeLists.txt and all of CLion's files from the project directory.

If you're publishing on git, add CMakeLists.txt, .idea/, and cmake-build-debug to your .gitignore.

Running Builds and Deploys

If you completed setup properly, your CLion window will look something like the following:

To run a build, go up to the top right corner where it says "Build All" and change it to <binary name>_build (or <binary name>_deploy for a deploy). DO NOT SELECT fake_<binary name>. Fakes are used to trick cmake into seeing our project as a native project (therefore doing code completion and such).

Click the "build" button to the left of the selection box (the green 'down' arrow with a bunch of 1's and 0's on the side). Do not click Run (green play button) or Debug (green ladybug), as they will prompt you for an executable (which we don't have since we're cross-compiling).

If you're using a multi-project build, select the binary from the build configuration dropdown box that contains your user program (whatever is FRCUserProgram in your build.gradle). Dependencies will automatically be built by gradle.

Caveats

There are some issues in how CLion deals with include paths with multi-project builds. This is a bug in CLion, and can't be resolved on our end.

Clone this wiki locally