Main Content

addIncludePaths

Add include paths to model build information

Description

example

addIncludePaths(buildinfo,paths,groups) specifies included file paths to add to the build information.

The function requires the buildinfo and paths arguments. You can use an optional groups argument to group your options.

The code generator stores the included file path options in a build information object. The function adds options to the object based on the order in which you specify them.

The function adds the file paths to the compiler search path.

The code generator does not check whether a specified path is valid.

Examples

collapse all

Add the include path /etcproj/etc/etc_build to the build information myModelBuildInfo.

myModelBuildInfo = RTW.BuildInfo;
addIncludePaths(myModelBuildInfo,...
   '/etcproj/etc/etc_build');

Add the include paths /etcproj/etclib and /etcproj/etc/etc_build to the 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 the build information myModelBuildInfo. Group the paths /etc/proj/etclib and /etcproj/etc/etc_build with the character vector etc and the path /common/lib with the character vector shared.

myModelBuildInfo = RTW.BuildInfo;
addIncludePaths(myModelBuildInfo,...
   {'/etc/proj/etclib' '/etcproj/etc/etc_build'...
   '/common/lib'}, {'etc' 'etc' 'shared'});

Input Arguments

collapse all

You can specify the paths argument as a character vector, as an array of character vectors, or as a string. If you specify a single path as a character vector, the function uses that path for all files. If you specify the paths argument as multiple character vectors, for example, '/proj/src' and '/proj/inc', the paths argument is added to the build information as an array of character vectors.

The function removes duplicate include file path entries with an exact match of a path and file name to a previously defined entry in the build information object.

Example: '/proj/src'

You can specify the groups argument as a character vector, as an array of character vectors, or as a string. If you specify multiple groups, for example, 'etc' 'etc' 'shared', the function relates the groups to the paths in order of appearance. For example, the paths argument '/etc/proj/etclib' '/etcproj/etc/etc_build' '/common/lib' is an array of character vectors with three elements. The first element is in the 'etc' group, the second element is in the 'etc' group, and the third element is in the 'shared' group.

Example: 'etc' 'etc' 'shared'

Introduced in R2006a