Main Content

findIncludeFiles

Find and add include (header) files to model build information

Description

example

findIncludeFiles(buildinfo,extPatterns) searches for and adds include files to the build information.

Use the findIncludeFiles function to:

  • Search for include files in source and include paths from the build information.

  • Apply the optional extPatterns argument to specify file name extension patterns for search.

  • Add the found files with their full paths to the build information.

  • Delete duplicate include file entries from the build information.

To ensure that findIncludeFiles finds header files, add their paths to buildInfo by using the addIncludePaths function.

Examples

collapse all

Find include files with file name extension .h that are in the build information, myModelBuildInfo. Add the full paths for these files to the build information. View the include files from the build information.

myModelBuildInfo = RTW.BuildInfo;
addSourcePaths(myModelBuildInfo,{fullfile(pwd,...
   'mycustomheaders')},'myheaders');
findIncludeFiles(myModelBuildInfo);
headerfiles = getIncludeFiles(myModelBuildInfo,true,false);
>> headerfiles

headerfiles = 

    'W:\work\mycustomheaders\myheader.h'

Input Arguments

collapse all

Object provides information for compiling and linking generated code.

To specify files for the search, the character vectors or strings in the extPatterns argument:

  • Must start with an asterisk immediately followed by a period (*.)

  • Can include a combination of alphanumeric and underscore (_) characters

Example: '*.h' '*.hpp' '*.x*'

Introduced in R2006b