Skip to content

Commit 04e2ae2

Browse files
authored
Simple documentation on how to use autogenerated code that uses BlockFactory with CMake (#80)
1 parent 22f6281 commit 04e2ae2

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

doc/mkdocs/data/autogenerate_code.md

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
# How to autogenerate C++ code
22

3-
!!! warning
4-
This tutorial is not yet ready
3+
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.
4+
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:
5+
~~~cmake
6+
find_package(BlockFactory COMPONENTS SimulinkCoder REQUIRED)
7+
~~~
58

6-
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:
9+
and then link your target that contains the autogenerated code to the `BlockFactory::SimulinkCoder` imported target:
10+
~~~cmake
11+
target_link_libraries(<targetwithautogeneratecode> PRIVATE BlockFactory::SimulinkCoder)
12+
~~~
13+
14+
For more advanced uses, check the following example:
715

816
- [`AutogenerationExample.mdl`](https://github.com/robotology/blockfactory/tree/master/example/matlab/AutogenerationExample.mdl) A Simulink model with the right configuration of Simulink Coder
917
- [`example/matlab/AutogenerationExample_grt_rtw`](https://github.com/robotology/blockfactory/tree/master/example/matlab/AutogenerationExample_grt_rtw) The folder containing the autogenerated sources

0 commit comments

Comments
 (0)