diff --git a/doc/mkdocs/data/autogenerate_code.md b/doc/mkdocs/data/autogenerate_code.md index 295ccdb..9e31bbc 100644 --- a/doc/mkdocs/data/autogenerate_code.md +++ b/doc/mkdocs/data/autogenerate_code.md @@ -1,9 +1,17 @@ # How to autogenerate C++ code -!!! warning - This tutorial is not yet ready +The capability of autogenerating C++ code from a Simulink model is provided by Simulink Coder. BlockFactory received a preliminary support of this toolbox, and only basic features are currently supported. +If you are already building your Simulink autogenerated code via CMake, to start using code autogenerated from models that use BlockFactory's blocks, you simply need to look for `BlockFactory` in CMake as any other dependency via: +~~~cmake +find_package(BlockFactory COMPONENTS SimulinkCoder REQUIRED) +~~~ -The capability of autogenerating C++ code from a Simulink model is provided by Simulink Coder. BlockFactory received a preliminary support of this toolbox, and only basic features are currently supported. Following the previous how-to, check these links for a simple example: +and then link your target that contains the autogenerated code to the `BlockFactory::SimulinkCoder` imported target: +~~~cmake +target_link_libraries( PRIVATE BlockFactory::SimulinkCoder) +~~~ + +For more advanced uses, check the following example: - [`AutogenerationExample.mdl`](https://github.com/robotology/blockfactory/tree/master/example/matlab/AutogenerationExample.mdl) A Simulink model with the right configuration of Simulink Coder - [`example/matlab/AutogenerationExample_grt_rtw`](https://github.com/robotology/blockfactory/tree/master/example/matlab/AutogenerationExample_grt_rtw) The folder containing the autogenerated sources