To share build configuration settings between multiple projects or between the project and command-line workflow, you can export settings to and import settings from a code generation configuration object.
To export the current project settings to a code generation configuration object stored in the base workspace:
To open the Generate dialog box,
on the Generate Code page, click the Generate arrow
.
Set Build type to Source
Code
, Static Library
, Dynamic
Library)
, or Executable
(depending
on your requirements).
Click More Settings.
Click Import/Export Settings.
In the Variable name field, specify a name for the configuration object.
Click Export to Variable.
MATLAB® Coder™ saves the project settings information in a configuration object with the specified name in the base workspace.
Project Output Type | Configuration Object | |
---|---|---|
MEX Function | coder.MexCodeConfig | |
C/C++ Static Library | Without an Embedded Coder® license: coder.CodeConfig With an Embedded Coder license: coder.EmbeddedCodeConfig | |
C/C++ Dynamic Library | ||
C/C++ Executable |
You can then either import
these settings into another project or use the configuration object
with the codegen
function -config
option
to generate code at the command line.
To import the settings saved in a code generation configuration object stored in the base workspace:
To open the Generate dialog box,
on the Generate Code page, click the Generate arrow
.
Set Build type to Source
Code
, Static Library
, Dynamic
Library
, or Executable
(depending
on your requirements).
Click More Settings.
Click Import/Export Settings.
In the Variable name field, specify the name of the configuration object.
Click Import from Variable.