Create Project Automatically

If you use build automation scripts to build your source code, you can automatically setup a Polyspace® project from your scripts. The automatic project setup runs your automation scripts to determine:

  1. Select File > New Project.

  2. On the Project – Properties dialog box, after specifying the project name, location and language, under Project configuration, select Create from build command.

  3. On the next window, enter the following information:

    Specify command used for building your source files

    If you use an IDE such as Visual Studio® or Eclipse™ to build your project, specify the full path to your IDE executable or navigate to it using the button. For a tutorial using Visual Studio, see Trace Visual Studio Build.

    Example: "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\VCExpress.exe"

    If you use command-line tools to build your project, specify the appropriate command.


    • make -B -f makefileName or make -W makefileName

    • "mingw32-make.exe -B -f makefilename"

    Specify working directory for running build command

    Specify the folder from which you run your build automation script.

    If you specify the full path to your executable in the previous field, this field is redundant. Specify any folder.

    Add advanced configure options

    Specify additional options for advanced tasks such as incremental build. For the full list of options, see the -options value argument for polyspaceConfigure.

  4. Click .

    • If you entered your build command, Polyspace runs the command and sets up a project.

    • If you entered the path to an executable, the executable runs. Build your source code and close the executable. Polyspace traces your build and sets up a project.

      For example, in Visual Studio 2010, use Tools > Rebuild Solution to build your source code. Then close Visual Studio.

    After you click Finish, the new project appears on the Project Browser pane. To close the project at any time, in the Project Browser, right-click the project node and select Close.

  5. If you updated your build command, you can recreate the Polyspace project from the updated command. To recreate an existing project, on the Project Browser, right-click the project name and select Update Project.


    • In the Polyspace interface, it is possible that the created project will not show implicit defines or includes. The configuration tool does include them. However, they are not visible.

    • By default, Polyspace assigns the latest dialect for your compiler. If you have compilation errors in your project, check the dialect. If it does not apply to you, change it to a more appropriate one.

    • If your build process requires user interaction, you cannot run the build command from the Polyspace user interface and do an automatic project setup.

Related Examples

More About

Was this topic helpful?