If you cannot (or prefer not to) use the previously-mentioned project creation/import strategies, create the project from the GUI as follows:
In project settings, you can reference BUILD_ROOT as ${BUILD_ROOT} or ${env_var:BUILD_ROOT}. If you are creating a new project directly in the build directory, which is at the BUILD_ROOT, you can specify the project location as absolute path or using a workspace path variable. Do not use ${BUILD_ROOT} in a project path. |
Using the Source Directory as the Project Location
To create a project using the source directory as the project location:
- Choose File> New> Project.
- Choose C> C Project or C++> C++ Project.
- Click Next. The projects wizard will open.
- Enter a name for the project in the Project name field.
- Disable the Use default location option.
- Enter the path to the actual source directory in the Location field.
- Under Project Types, select Makefile project.
- Under Toolchain, select the appropriate Toolchain.
- (Optional) If you want to use Eclipse to build your project, click Next, then complete the settings in the available tabs.
- Click Finish.
Using an External Location as the Project Location
To create a project using an external location as the project location:
- Create an empty project as follows:
- Choose File> New> Project.
- Choose C> C Project or C++> C++ Project.
- Click Next. The projects wizard will open.
- Enter a name for the project in the Project name field.
- Click Finish.
- Link your source files to that project as follows:
- Choose File> New> Folder.
- Select the name of the project that you created in Step 1.
- Click the Advanced button.
- Enable the Link to folder in file system option.
- Enter or browse to the location of your source files.
- Click Finish.
The linked files will appear within the project folder in the C/C++ Projects view and Navigator view, but they will continue to "live" within their original location. C++test will not add any new files to the linked source location; any files that it generates will be saved in the project directory.
When configuring a project with a linked source folder, you need to modify any project build settings that refer to ${project_loc}; these settings must be changed to use resource_loc instead. If you do not change these default settings, the project’s source files will be skipped during testing. To change the project’s build settings: - Right-click the C/C++ Projects tree node for the project, then choose Properties from the shortcut menu. The Properties dialog will open.
- Expand the Parasoft> C++test category in the left pane.
- Select the Build Settings category.
- Modify the Build working directory setting to
${resource_loc:/<project name>/<linked source dir>/<actual make working dir path from there>}. - Modify the Dependency file(s) setting to
${resource_loc:/<project name>/<linked source dir>/<actual make working dir path from there>/Makefile}.

See Important note for projects with linked source folders for details on how to make the appropriate modifications to your build settings. |