How can I use PackNGo without naming dependencies on the current directory?

4 views (last 30 days)
When using the 'Package code & artifacts' feature with code generation, the resulting .ZIP package contains two subfolders. One is named after the current directory, and the other is named after the release of MATLAB. Can this be avoided? I want to write a general (and fixed) makefile that compiles the generated code, but if the folders depend on the current directory then that makefile will have to change every time someone generates the code depending on what their pwd is.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 14 Apr 2023
Edited: MathWorks Support Team on 14 Apr 2023
If you do not want to have any sub-folders named after the PWD, you will need to use the 'flat' structure for 'packNGo'. To do this, you can use the command-line API instead of the model's configuration parameters. You will want to add a 'PostCodeGenCommand' with the 'set_param' function. For example:
>> set_param(gcs,'PostCodeGenCommand','packNGo(buildInfo,''packType'',''flat'',''fileName'',''myPackage'')');
For more information about the 'packNGo' command, please refer here:
For general information about using the command line with 'packNGo', please refer here:

More Answers (0)

Categories

Find more on Simulink Coder in Help Center and File Exchange

Tags

No tags entered yet.

Products


Release

R2016b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!