Importing Existing GNAT Projects

Importing existing GNAT projects (i.e., those defined by a GNAT project file), is accomplished using a wizard provided by GNATbench.

To invoke the wizard you may use either the "File" menu and select "Import...", or use the contextual menu in the Navigator and again select "Import..." The first approach is illustrated below.

file import menu

A new wizard page will appear (shown below), allowing you to choose which import wizard to apply. Workbench defines a number of import wizards so you may need to expand the "Other" category. Select "Existing GNAT Project" and press Next.

import wizard selection page

The next wizard page appears (see the following figure) and requests the location of the GNAT project file defining the project to be imported. You may either enter the path manually or browse to it via the "Browse" button to the right of the text entry pane.

import gnat project selection page

On that same page you also choose whether to import the GNAT project into an existing Workbench project or into a new Workbench project.

That page also offers the choice of whether to copy the files of the GNAT project into the Workbench project or only create links to the existing files.

Press Finish after making all these choices. The new project will be created for you.

Note that you may have to modify the GNAT project file created by the wizard. For example, you might need to re-specify the location of the executable (a directory) if the original GNAT project file specified it with an absolute path. Similarly, the GNAT project file might specify multiple main programs or other properties that should be changed.