| Real-Time Workshop® | ![]() |
Add include paths to model's build information
addIncludePaths(buildinfo, paths, groups)
groups is optional.
Build information returned by RTW.BuildInfo.
A character array or cell array of character arrays that specifies include file paths to be added to the build information. The function adds the paths to the end of a vector in the order that you specify them.
The function removes duplicate include file entries that
You specify as input
Already exist in the include path vector
Have a path that matches the path of a matching filename
A duplicate entry consists of an exact match of a path string and corresponding filename.
A character array or cell array of character arrays that groups specified include paths. You can use groups to
Document the use of specific include paths
Retrieve or apply groups of include paths
You can apply
A single group name to an include path
A single group name to multiple include paths
Multiple group names to collections of multiple include paths
| To... | Specify groups as a... |
|---|---|
| Apply one group name to all include paths | Character array. |
| Apply different group names to include paths | Cell array of character arrays such that the number of group names that you specify matches the number of elements you specify for paths. |
The addIncludePaths function adds specified include paths to the model's build information. The Real-Time Workshop® software stores the include paths in a vector. The function adds the paths to the end of the vector in the order that you specify them.
In addition to the required buildinfo and paths arguments, you can specify an optional groups argument. You can specify groups as a character array or a cell array of character arrays.
| If You Specify an Optional Argument as a... | The Function... |
|---|---|
| Character array | Applies the character array to all include paths it adds to the build information. |
| Cell array of character arrays | Pairs each character array with a specified include path. Thus, the length of the cell array must match the length of the cell array you specify for paths. |
Add the include path /etcproj/etc/etc_build to build information myModelBuildInfo.
myModelBuildInfo = RTW.BuildInfo; addIncludePaths(myModelBuildInfo,... '/etcproj/etc/etc_build');
Add the include paths /etcproj/etclib and /etcproj/etc/etc_build to build information myModelBuildInfo and place the files in the group etc.
myModelBuildInfo = RTW.BuildInfo;
addIncludePaths(myModelBuildInfo,...
{'/etcproj/etclib' '/etcproj/etc/etc_build'},'etc');
Add the include paths /etcproj/etclib, /etcproj/etc/etc_build, and /common/lib to build information myModelBuildInfo. Group the paths /etc/proj/etclib and /etcproj/etc/etc_build with the string etc and the path /common/lib with the string shared.
myModelBuildInfo = RTW.BuildInfo;
addIncludePaths(myModelBuildInfo,...
{'/etc/proj/etclib' '/etcproj/etc/etc_build'...
'/common/lib'}, {'etc' 'etc' 'shared'});
addIncludeFiles, addSourceFiles, addSourcePaths, updateFilePathsAndExtensions, updateFileSeparator
Programming a Post Code Generation Command
![]() | addIncludeFiles | addLinkFlags | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |