Main Content

generateProject

Class: polyspace.Options
Namespace: polyspace

Generate psprj project from options object

Syntax

opts.generateProject(projectName)

Description

opts.generateProject(projectName) creates a .psprj project called projectName from the options specified in the polyspace.Options object opts. You can open a .psprj project in the user interface of the Polyspace® desktop products.

Input Arguments

expand all

Option object convert into a psprj file, specified as a polyspace.Options or polyspace.ModelLinkOptions object.

Example: opts = polyspace.Options;

Project file name specified as a character vector. This argument is used as the name of the psprj file.

Example: 'myProject'

Examples

expand all

This example shows how to create and use a Polyspace project that was generated from an options object.

Create a Bug Finder object and set properties.

sources = fullfile(polyspaceroot,'polyspace','examples','cxx','Bug_Finder_Example',...
   'sources','numerical.c');
opts = polyspace.Options();
opts.Prog = 'MyProject';
opts.Sources = {sources};
opts.TargetCompiler.Compiler = 'gnu4.7';

Generate a Polyspace project. Name the project using the Prog property.

psprj = opts.generateProject(opts.Prog);

Run a Bug Finder analysis using one of these commands. Both commands produce identical analysis results. The only difference is that the psprj project can be rerun in the Polyspace interface.

polyspaceBugFinder(psprj, '-nodesktop');
polyspaceBugFinder(opts);

To run a Code Prover analysis, use polyspaceCodeProver instead of polyspaceBugFinder.

Tips

If you want to include an options object in a pslinkoptions object:

  1. Use this method to convert your object to a project.

  2. Add the project to the pslinkoptions property PrjConfig.

  3. Turn on the property EnablePrjConfig.

Version History

Introduced in R2016b