Main Content

copyRuntimeDependencies

Class: clibgen.LibraryDefinition
Namespace: clibgen

Copy run-time libraries to C++ interface library folder

Since R2023a

Syntax

copyRuntimeDependencies(libdef)
copyRuntimeDependencies(libdef,options)

Description

copyRuntimeDependencies(libdef) copies each run-time library specified in libDef to the folder containing the interface library file created by the build command. This folder is on the MATLAB® path, making the files available when you test. The clibPublishInterfaceWorkflow script calls this function in the Set up and copy run-time libraries section. For more information, see Set Up and Copy Run-Time Libraries.

This function collects the necessary files for distributing to end users so that they do not have to set environment variables to call functions in the library. For information about sharing with MATLAB users, see Distribute MATLAB Interface to C++ Library.

copyRuntimeDependencies(libdef,options) copies run-time libraries with additional options specified by one or more Name,Value pair arguments.

Input Arguments

expand all

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.

Absolute paths to folders with additional run-time dependencies, specified as a string vector. The function copies all run-time dependencies from each run-time path to the interface library folder.

Absolute paths to additional run-time dependencies, specified as a string vector, to be copied to the interface library folder.

Option to display details from the copy command, specified as a numeric or logical 1 (true) or 0 (false). If Verbose is true, then the function displays details about each library copied. If Verbose is false, then the function displays a brief success message.

Examples

expand all

Show details about libraries copied into the interface library folder.

libdef.copyRuntimeDependencies(AdditionalRuntimeFolders="C:\mylib\util\win64",...
    Verbose=true)
Copied 5 run-time library file(s) to 'C:\matlab\win64\mylib'
            C:\mylib\lib\win64\mylib.dll
            C:\mylib\util\win64\bar.dll
            C:\mylib\util\win64\foo.dll
            C:\mylib\util\win64\foo32.dll
            C:\mylib\util\win64\fubar.dll
Run-time dependencies copied to interface library folder.

Version History

Introduced in R2023a