| Real-Time Workshop® | ![]() |
addSourcePaths(buildinfo, paths, groups)
groups is optional.
Build information returned by RTW.BuildInfo.
A character array or cell array of character arrays that specifies source 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 source file entries that
You specify as input
Already exist in the source 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.
Note The Real-Time Workshop® software does not check whether a specified path string is valid. |
A character array or cell array of character arrays that groups specified source paths. You can use groups to
Document the use of specific source paths
Retrieve or apply groups of source paths
You can apply
A single group name to a source path
A single group name to multiple source paths
Multiple group names to collections of multiple source paths
| To... | Specify groups as a... |
|---|---|
| Apply one group name to all source paths | Character array. |
| Apply different group names to source 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 addSourcePaths function adds specified source paths to the model's build information. The Real-Time Workshop software stores the source 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 source paths it adds to the build information. |
| Cell array of character arrays | Pairs each character array with a specified source path. Thus, the length of the character array or cell array must match the length of the cell array you specify for paths. |
Note The Real-Time Workshop software does not check whether a specified path string is valid. |
Add the source path /etcproj/etc/etc_build to build information myModelBuildInfo.
myModelBuildInfo = RTW.BuildInfo; addSourcePaths(myModelBuildInfo,... '/etcproj/etc/etc_build');
Add the source paths /etcproj/etclib and /etcproj/etc/etc_build to build information myModelBuildInfo and place the files in the group etc.
myModelBuildInfo = RTW.BuildInfo;
addSourcePaths(myModelBuildInfo,...
{'/etcproj/etclib' '/etcproj/etc/etc_build'}, 'etc');
Add the source 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;
addSourcePaths(myModelBuildInfo,...
{'/etc/proj/etclib' '/etcproj/etc/etc_build'...
'/common/lib'}, {'etc' 'etc' 'shared'});
addIncludeFiles, addIncludePaths, addSourceFiles, updateFilePathsAndExtensions, updateFileSeparator
Programming a Post Code Generation Command
![]() | addSourceFiles | emlc | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |