A
A
Aleksey Pleshkov2016-02-03 11:45:03
C++ / C#
Aleksey Pleshkov, 2016-02-03 11:45:03

How to compile RIOT OS in CLion?

Good day.

Used this instruction ( link ) to build RIOT in Eclipse. Is it possible to configure this in Clion for comfortable work?

I am new to C/C++. It seems like the include directories need to be registered in CmakeLists using include_directories, but I still haven’t figured out how to do this correctly.

I would be grateful for help.

Added:
Here is a link to the OS itself: https://github.com/RIOT-OS/RIOT . The project is initially built from under the examples/* folder with the examples, using the make command.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vkil, 2016-02-29
@Vkil

Clion uses CMake, so you need to create the appropriate CMake files to build the project.
Apparently, you need to analyze the Makefile, figure out which libraries and executable files are created in the project, and rewrite it all in CMake.
If "comfortable work" means only auto-completion. Then you can get by with creating CMakeLists.txt with the content of the form

cmake_minimum_required(VERSION 3.0)

add_executable(foo <список cpp файлов с которыми нужно работать>)
target_include_directories(foo PUBLIC <список директорий в которых лежат хидеры>)

Put the file in the root of the project and open it with CLion. You will have to compile through the command line or another IDE, but autocompletion should work.
For details on cmake commands here: https://cmake.org/cmake/help/v3.0/command/target_i...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question