2015-07-15 19:34:10 +03:00
|
|
|
.. _ide_clion:
|
|
|
|
|
|
|
|
|
|
CLion
|
|
|
|
|
=====
|
|
|
|
|
|
|
|
|
|
The `CLion <https://www.jetbrains.com/clion/>`_ is a cross-platform C/C++ IDE
|
|
|
|
|
for Linux, OS X, and Windows integrated with the CMake build system. The
|
|
|
|
|
initial version will support the GCC and Clang compilers and GDB debugger.
|
|
|
|
|
Clion includes such features as a smart editor, code quality assurance,
|
|
|
|
|
automated refactorings, project manager, integrated version control systems.
|
|
|
|
|
|
|
|
|
|
This software can be used with:
|
|
|
|
|
|
|
|
|
|
* all available :ref:`platforms`
|
|
|
|
|
* all available :ref:`frameworks`
|
|
|
|
|
|
|
|
|
|
Refer to the `CDT Documentation <https://www.jetbrains.com/clion/documentation/>`_
|
|
|
|
|
page for more detailed information.
|
|
|
|
|
|
|
|
|
|
.. contents::
|
|
|
|
|
|
|
|
|
|
Integration
|
|
|
|
|
-----------
|
|
|
|
|
|
|
|
|
|
Project Generator
|
|
|
|
|
^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
|
Since PlatformIO 2.0 you can generate CLion compatible project using
|
|
|
|
|
:option:`platformio init --ide` command. Please choose board type using
|
|
|
|
|
:ref:`cmd_boards` command and run:
|
|
|
|
|
|
|
|
|
|
.. code-block:: shell
|
|
|
|
|
|
|
|
|
|
platformio init --ide clion --board %TYPE%
|
|
|
|
|
|
2015-09-05 20:50:30 +03:00
|
|
|
Then:
|
|
|
|
|
|
|
|
|
|
1. Import this project via ``Menu: File > Import Project``
|
|
|
|
|
and specify root directory where is located :ref:`projectconf`
|
|
|
|
|
2. Open source file from ``src`` directory (``*.c, *.cpp, *.ino, etc.``)
|
|
|
|
|
3. Build project: ``Menu: Run > Build``.
|
2015-07-15 19:34:10 +03:00
|
|
|
|
2015-09-04 19:31:59 +03:00
|
|
|
There are 3 predefined targets for building:
|
|
|
|
|
|
|
|
|
|
* ``PLATFORMIO_BUILD`` - build project without auto-uploading
|
|
|
|
|
* ``PLATFORMIO_UPLOAD`` - build and upload (if no errors)
|
|
|
|
|
* ``PLATFORMIO_CLEAN`` - clean compiled objects and etc.
|
|
|
|
|
|
2015-07-15 19:34:10 +03:00
|
|
|
.. warning::
|
2015-07-16 13:27:58 +03:00
|
|
|
CLion is still in the development stage, so some of the features (like,
|
|
|
|
|
auto-complete) probably will not work with PlatformIO. See
|
|
|
|
|
`CLion issue #CPP-3977 <https://youtrack.jetbrains.com/issue/CPP-3977>`_.
|
|
|
|
|
|
|
|
|
|
Active discussion located in
|
|
|
|
|
`PlatformIO issue #132 <https://github.com/platformio/platformio/issues/132>`_.
|
2015-07-15 19:34:10 +03:00
|
|
|
|
|
|
|
|
Screenshot
|
|
|
|
|
----------
|
|
|
|
|
|
|
|
|
|
.. image:: ../_static/ide-platformio-clion.png
|
|
|
|
|
:target: http://docs.platformio.org/en/latest/_static/ide-platformio-clion.png
|
2015-09-04 23:48:57 +03:00
|
|
|
|
|
|
|
|
Examples
|
|
|
|
|
--------
|
|
|
|
|
|
|
|
|
|
"Blink" Project
|
|
|
|
|
^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
|
Source code of `CLion "Blink" Project <https://github.com/platformio/platformio/tree/develop/examples/ide/clion>`_.
|