CrossWorks has a project system that enables you to manage the source files and build instructions of your solution. The project explorer and the properties window are the standard ways in which to edit and view your solution. You can also edit and view the project file which contains your solution using the text editor - this can be used for making large changes to the solution.

Solutions

The term solution is used to refer to the current project file that CrossWorks has loaded. A solution can contain several projects and these projects can reside in different directories. These project directories are always used by CrossWorks relative to the directory in which the solution file resides. This enables project file hierarchies to be moved on to different computers.

Projects

The projects you create within a solution have a project type which is used to determine how to build the project. The project type is selected when you use the File | New | New Project... dialog. The particular set of project types can vary depending upon the variant of CrossWorks you are using however the following project types are standard to most CrossWorks variants:

When you create a project you will be asked for a project name and a directory. The project name should be unique to the solution and ideally the project directory should be relative to the solution directory. The project directory is where the project system will use as the current directory when it builds your project.

You can modify the type of the project by setting the Project Type property of the project with the Common configuration selected in properties window.

Folders

Projects can contain folders which are used to group related files together. This grouping can be done using the file extension of the file or it can be done by explicitly creating a file within a folder. Note that folders do not map onto directories in the file store they are solely used to structure the project explorer display.

Files

The source files of your project can be placed either in folders or directly in the project. Ideally files placed in project should be relative to the project directory, however there are cases when you might want to refer to a file in an absolute location so this is supported by the project system. The project system does not allow duplicate files to be put into the project irrespective of the folder that the project is placed in.

The extension of the file is used by the project system to determine the appropriate build action to be performed on the file. So for example a file with the extension .c will be compiled by the C compiler. a file with the extension .s will be compiled by the assembler and a file with the extension .h will not be compiled. You can modify this behaviour by setting the File Type property of the file with the Common configuration selected in the properties window - this enables files with non standard extensions to be compiled by the project system.

Project and Session Files

When you have created a solution it is stored in a project file. Project files are text files with the file extension .hzp, that contain an XML description of your project. When you exit CrossWorks details of your current session are stored in a session file. Session files are text files with the file extension .hzs that contain details such as files you have opened in the editor and breakpoints you set in the breakpoint window.

Solution links

You can create links to existing project files from a solution which enables you to create hierarchical builds. For example you could have a solution that builds a library together with a stub test driver executable. You can then link to this solution (by right clicking on the solution node of the project explorer and selecting Insert Link To Solution) to be able to use the library from a project in the current solution.