Share Build Configuration Settings

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.

Export Settings

To export the current project settings to a code generation configuration object stored in the base workspace:

  1. To open the Generate dialog box, on the Generate Code page, click the Generate arrow .

  2. Set Build type to Source Code, Static Library, Dynamic Library), or Executable (depending on your requirements).

  3. Click More Settings.

  4. Click Import/Export Settings.

  5. In the Variable name field, specify a name for the configuration object.

  6. 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 TypeConfiguration Object
    MEX Functioncoder.MexCodeConfig
     
    C/C++ Static LibraryWithout 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.

Import Settings

To import the settings saved in a code generation configuration object stored in the base workspace:

  1. To open the Generate dialog box, on the Generate Code page, click the Generate arrow .

  2. Set Build type to Source Code, Static Library, Dynamic Library, or Executable (depending on your requirements).

  3. Click More Settings.

  4. Click Import/Export Settings.

  5. In the Variable name field, specify the name of the configuration object.

  6. Click Import from Variable.

Was this topic helpful?