Main Content

findIncludeFiles

Find and add include (header) files to build information

Description

findIncludeFiles(buildinfo,extensions,Name,Value) 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 extensions 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.

example

Examples

collapse all

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

myBuildInfo = RTW.BuildInfo;
addSourcePaths(myBuildInfo,{fullfile(pwd,...
   'mycustomheaders')},'myheaders');
findIncludeFiles(myBuildInfo);
headerfiles = getIncludeFiles(myBuildInfo,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 extensions argument:

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

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

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

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: minimalHeaders=false,ignoreParseError=true

If true, include only the minimal header files required to build the code.

If false, include header files found on the include path.

Example: minimalHeaders=false

If false, terminate on parse errors.

If true, do not terminate on parse errors.

Example: ignoreParseError=true

Version History

Introduced in R2006b