build.htm

## Adding Source Files to a Project

The Sources tab of the Project Configuration dialog automatically appears after specifying the Project Database.

You can manually add sources, see below. Or you can tie the project sources to those specified in an MS Visual C++ project file (MS WIndows version only). See the "Working with MSVC Projects section on page 39

Browse to the directory where the source files are located or type in the full path name. When browsing, clicking on any file in the directory and then clicking the Open button will load the directory path into the Directory field of the Project dialog box. By default, all .c, .cpp, .cc, and .h files will be added to the project. You may specify a different file filter if desired. When the correct path and file filter is specified, click the Add button to add the source files in that directory to the project.

You can later get to this Project Configuration dialog box for an existing project by clicking on the Configure button on Understand for C++'s main window.

To select and add multiple subdirectories to a project configuration, check the "Add all Recursive Directory Files" box. This will load all source files matching the files filter in all subdirectories of the specified path into the project.

Tip: You may browse and add files from multiple directory trees.

If running Understand for C++ on Windows 95/NT you may drag and drop a folder, a file, or a selection of files, from another window into the Project Configuration dialog to add it to the project. To drag and drop a folder and all its subdirectories into the project, be sure that the box to "Add all Recursive Directory Files" is checked. All files within the directory which meet the file filter criteria will automatically be added to the project. When dragging a particular file into the project, that file will be added to the project whether it satisfies the file filter or not.

Once the directory paths and files are specified and added to the project, the directory tree and project files are shown:

Files included in the project are shown with green diamonds. Left click on the diamond or filename to toggle the source file in or out of the project configuration. A red diamond denotes that the file is NOT included in the project and it will not be analyzed.

Status information about the project files are displayed in the status bar at the bottom.

### Right-click Menus

Right-click menus provide options for adding and removing files and directories from the project and the display. The following diagram shows the right-click menu available for directories (folders).

There are several options available:

· Show All Files
This option displays all files in the current directory, whether they are defined in the project or not.
· Remove All Files From Project
This option removes all files in the directory from the project configuration.
· Add All *.c,*.h. *.cpp Files to Project
This option will add all source files in the directory (*.c,*.h, *.cpp) to the project configuration.
· Disable/Enable Parsing
The Disable Parsing option will disable the project files in this directory from being parsed. The files will remain in the project configuration. A directory which has parsing disabled will be displayed pink instead of yellow. To restore parsing to this directory, select Enable Parsing.
· Remove Directory
This option removes this directory and all the files it contains from the project configuration.

The following diagram shows the display after the option to display all files is selected. Notice that source files in the project configuration are denoted with green diamonds and files that are not included in the project definition are red diamonds.

Tip: To add just one or a few source files that may be in a large directory, add the entire directory to the project, then use the right-click menu to remove all files from the project, then manually select the required file to add it back to the project.

### Filename Changes within a Project

If a file in the project is deleted, moved, or re-named, the project display will show the missing project file with a red "X". If the file was renamed and not yet added to the project, the new file will be displayed but will not be included in the project definition until explicitly added.

Following is an example where the file mk4.h has been renamed to old_mk4.h. The original file mk4.h was in the project, but no longer exists, so a red "X" is shown. The new file old_mk4.h has not been added to the project, so is displayed with a red diamond to signify that it will not be included in the analysis.

Scientific Toolworks, Inc. http://www.scitools.com Voice: (802) 763-2995 Fax: (802) 763-3066 support@scitools.com sales@scitools.com