addAdditionalSourcePath - Add source path to array of source paths for code replacement table

        entry - MATLAB ([original](https://in.mathworks.com/help/ecoder/ref/addadditionalsourcepath.html)) ([raw](?raw))

Main Content

Add source path to array of source paths for code replacement table entry

Syntax

Description

addAdditionalSourcePath([hEntry](#d126e952),[path](#d126e983)) adds a specified additional source file path to the array of additional source file paths for a code replacement table.

This function adds -I to the compile line in the generated makefile.

example

Examples

collapse all

This example shows how to use theaddAdditionalSourcePath function withaddAdditionalHeaderFile,addAdditionalIncludePath, andaddAdditionalSourceFile to specify path to additional header and source files fully for a code replacement table entry.

% Path to external header and source files libdir = fullfile('$(MATLAB_ROOT)','..', '..', 'lib');

op_entry = RTW.TflCOperationEntry; . . . addAdditionalHeaderFile(op_entry, 'all_additions.h'); addAdditionalIncludePath(op_entry, fullfile(libdir, 'include'));

addAdditionalSourceFile(op_entry, 'all_additions.c'); addAdditionalSourcePath(op_entry, fullfile(libdir, 'src'));

Input Arguments

collapse all

The hEntry is a handle to a code replacement table entry previously returned by instantiating a code replacement table entry class, such as _`hEntry`_ = RTW.TflCFunctionEntry or_`hEntry`_ = RTW.TflCOperationEntry.

Example: op_entry

The path is a character vector or string scalar specifying the full path to an additional source file. The character vector or string scalar can include tokens (for example,$myfolder$, where myfolder is a variable defined as a character vector, cell array of character vectors, or string array in the MATLABĀ® workspace).

Example: fullfile(libdir, 'src')

Version History

Introduced in R2007b