Skip to content

Latest commit

 

History

History

CLion

CLion Setup

This document describes the setup of CLion for ACPLT/RTE projects. This includes configuration for toolchains, OVM highlighting and source template generation.

Setup project workspace

Clone an existing Project or create a new one (see rte_example-project for reference). Open the Project in CLion at the root.

Adding toolchain in CLion

CLion on Windows knows serveral types of toolchaines. These include mingw, cygwin, Visual Studio, WSL and remote. On Linux CLion only differentiates between local and remote

To add a new Toolchain navigate to Build, Execution, Devleopment>Toolchains in the settings and click the plus sign.

MINGW-W64 (MSYS2)

  • In Environment select $MSYS2_ROOT$/mingw64.

CLion will probably complain about sh.exe beeing in the PATH. This error can be ignored for now.

  • In Debugger CLion should have found a MinGW-w64 GDB.

Switch to Build, Execution, Devleopment>CMake and add a new CMake configuraion. Select the mingw toolchain under Toolchain and set the Build type to a preferred value.

To fix the sh.exe problem add -DCMAKE_SH="CMAKE_SH-NOTFOUND" to the CMake options.

CYGWIN

TODO

WSL

This requires a WSL setup with enabled ssh server and required packages installed. See rte readme for instructions on setup on Linux.

Set the credentials for the ssh connection and the rest should be detected automatically. For instructions how to start the ssh server in wsl on startup, search the web.

OVM Highlighting

In CLion open 'File>Import Settings...' from the menu and navigate to $rte-repository$/tools/CLion and choose the CLion_Settings_OVM_Highlighting.zip. This loads the highlighting settings for ovm files.

Template generation

ACPLT/RTE includes a tool called acplt_builder to generate templates (c file stubs) for ov classes from ovm files. These templates are usually places in the source/sourcetemplates directory of an ov library.

! This feature requires the ovm highlighting as it defines the OV Model file type.

To enable automatic generation for templates on modification of the model file, install the File Watchers plugin in CLion. Configuration files(unix/unix) for this Plugin are provided in the $rte-repository$/tools/CLion directory. The appropriate file (WatcherTasks.xml.*) needs to be copied into the .idea directory in the project root and renamed to .xml .

Preferences for the plugin are found in the Settings dialog Tools>File Watcher. The default settings expect the acplt_builder executable in the path. An absolute path may be specified in the settings. The

acplt_builder requires the ovm files of included libraies for template generation. Search path are defined in the OV_LIBRARY_PATH environment variable, a :(unix systems) resp. ;(windows) separated list (similar to PATH) with libraries present in an equally named subdirectory.

By default the directories rte/core, rte/syslibs, rte_fblib, rte_field and rte_misc in the project root as well as the project root itself are included in the OV_LIBRARY_PATH. Additonal path can be specified in the File Watcher settings dialog.