Products & Services Solutions Academia Support User Community Company

Learn more about Real-Time Workshop   

addSourceFiles - Add source files to model's build information

Syntax

addSourceFiles(buildinfo, filenames, paths, groups)

paths and groups are optional.

Arguments

buildinfo

Build information returned by RTW.BuildInfo.

filenames

A character array or cell array of character arrays that specifies names of the source files to be added to the build information.

The filename strings can include wildcard characters, provided that the dot delimiter (.) is present. Examples are '*.*', '*.c', and '*.c*'.

The function adds the filenames 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 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.

paths (optional)

A character array or cell array of character arrays that specifies paths to the source 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.

groups (optional)

A character array or cell array of character arrays that groups specified source files. You can use groups to

  • Document the use of specific source files

  • Retrieve or apply groups of source files

You can apply

  • A single group name to a source file

  • A single group name to multiple source files

  • Multiple group names to collections of multiple source files

To...Specify group as a...
Apply one group name to all source filesCharacter array.
Apply different group names to source filesCell array of character arrays such that the number of group names that you specify matches the number of elements you specify for filenames.

Description

The addSourceFiles function adds specified source files to the model's build information. The Real-Time Workshop software stores the source 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 arrayApplies the character array to all source files it adds to the build information.
Cell array of character arraysPairs each character array with a specified source 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.

Examples

See Also

addIncludeFiles, addIncludePaths, addSourcePaths, updateFilePathsAndExtensions, updateFileSeparator
Programming a Post Code Generation Command

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS