| Real-Time Workshop® | ![]() |
Add include files to model's build information
addIncludeFiles(buildinfo, filenames, paths, groups)
paths and groups are optional.
Build information returned by RTW.BuildInfo.
A character array or cell array of character arrays that specifies names of include files to be added to the build information.
The filename strings can include wildcard characters, provided that the dot delimiter (.) is present. Examples are '*.*', '*.h', and '*.h*'.
The function adds the filenames 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 file 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 specifies paths to the include files. The function adds the paths to the end of a vector in the order that you specify them. If you specify a single path as a character array, the function uses that path for all files.
A character array or cell array of character arrays that groups specified include files. You can use groups to
Document the use of specific include files
Retrieve or apply groups of include files
You can apply
A single group name to an include file
A single group name to multiple include files
Multiple group names to collections of multiple include files
| To... | Specify groups as a... |
|---|---|
| Apply one group name to all include files | Character array. |
| Apply different group names to include files | Cell array of character arrays such that the number of group names that you specify matches the number of elements you specify for filenames. |
The addIncludeFiles function adds specified include files to the model's build information. The Real-Time Workshop® software stores the include files in a vector. The function adds the filenames to the end of the vector in the order that you specify them.
In addition to the required buildinfo and filenames arguments, you can specify optional paths and groups arguments. You can specify each optional argument 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 files it adds to the build information |
| Cell array of character arrays | Pairs each character array with a specified include file. Thus, the length of the cell array must match the length of the cell array you specify for filenames. |
If you choose to specify groups, but omit paths, specify a null string ('') for paths.
Add the include file mytypes.h to build information myModelBuildInfo and place the file in the group SysFiles.
myModelBuildInfo = RTW.BuildInfo; addIncludeFiles(myModelBuildInfo, ... 'mytypes.h', '/pathto/myheaders', 'SysFiles');
Add the include files etc.h and etc_private.h to build information myModelBuildInfo and place the files in the group AppFiles.
myModelBuildInfo = RTW.BuildInfo;
addIncludeFiles(myModelBuildInfo, ...
{'etc.h' 'etc_private.h'}, ...
'/pathto/myheaders', 'AppFiles');Add the include files etc.h, etc_private.h, and mytypes.h to build information myModelBuildInfo. Group the files etc.h and etc_private.h with the string AppFiles and the file mytypes.h with the string SysFiles.
myModelBuildInfo = RTW.BuildInfo;
addIncludeFiles(myModelBuildInfo, ...
{'etc.h' 'etc_private.h' 'mytypes.h'}, ...
'/pathto/myheaders', ...
{'AppFiles' 'AppFiles' 'SysFiles'});Add all of the .h files in a specified directory to build information myModelBuildInfo and place the files in the group HFiles.
myModelBuildInfo = RTW.BuildInfo; addIncludeFiles(myModelBuildInfo, ... '*.h', '/pathto/myheaders', 'HFiles');
addIncludePaths, addSourceFiles, addSourcePaths, updateFilePathsAndExtensions, updateFileSeparator
Programming a Post Code Generation Command
![]() | addDefines | addIncludePaths | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |