The Embedded Studio Project Management is based on Solutions. A Solution can contain one or more projects, which allows managing and organizing all projects in one place. All projects in a solution can be built and loaded onto the target at once. A project contains and organizes everything which is needed to create one application or library. Projects can be dependent on each other to, for example, build your library project and directly include the library into your application project.
- Management of project sources in one place
- Flexible organization in virtual folders
- Automatic sync with file system
- Composed build configurations
- Property inheritance
A Solution is basically one single file with the file extension .emProject. It contains one or more projects and their settings. Projects are referenced relatively to the solution directory. A project can reside in the solution directory or its own one.
The Project Explorer (Open via
View → Project Explorer Ctrl+Alt+P) organizes your Solution, project and files, shows their properties and provides quick access to commands for them.
The Project Explorer shows some statistical information about each file and folder. The number of files in a folder and the code and data size of compiled files. In addition to your folders the Project Explorer shows additional, auto-generated folders for quick access to properties, file dependencies and output files for each element.
The Project marked in bold is currently active. Double-click on another project to switch to it.
1. To create a new project select File → Create New Project... (Shift-Ctrl+N).
2. Select "Create the project in a new solution" to close the current Solution and create a new Solution for this project. Select "Add the project to the current solution" to create the project in the current Solution for multi-project builds.
3. Select the project type from your target Support Package. Depending on the package, the following project types can be available:
- C/C++ executable / Assembly code only executable: Create an application which can be loaded and executed.
- Library: Create an object code library (an archive) which can be linked into an executable.
- Externally built executable: Include an application which was not built with Embedded Studio to load and execute it on your target.
4. Enter a Name for your project and a location for the solution and click Next.
Depending on the project type you can now optionally select some common properties. Click Next to go through the settings pages and click Finish when you are done.
You can determine the relationship between projects in a Solution. Projects can depend on other projects to define an order in which they are built and make sure all dependent projects are up-to-date when building. This is for example used to make an executable dependent on a library. When the executable is built, the build system will make sure the library is up-to-date.
To set project dependencies activate the project and select
Project > Dependencies... Select the dependencies by double-click on the projects and order them if necessary. Click OK. Cycle-dependencies are not possible (when Project A depends on Project B, Project B cannot depend on Project A).
Adding Folders to a Project:
Projects can include a folder structure to allow organizing and managing multiple files at once. To add a folder right-click on the project or a folder in the project and select New Folder.... Enter a folder name. Optionally make the folder a dynamic shortcut to a folder on your disc: Select a source folder to link to, include or exclude files by name or wildcard expression (*.c,*.cpp to include/exclude only source files). Click OK.
Adding Existing Files to a Project:
To add existing files to your project right-click on the folder you want to add the files to and select Add existing File.... In the file dialog, select one or more files you want to add to this project folder. Click OK.
Adding New Files to a Project:
To add a new file to your project right-click on the folder you want to add the files to and select Add new File.... Select a template to generate the file from, enter a name for the file and a location to save it to. Click OK. The file is now part of your project.
Build configurations can be used to build one project with different properties and settings, for example different output directories, compiler options or preprocessor defines, but also different, configuration dependent files. The most common use is to create a debug configuration which configures the project properties to allow easy debugging and produce more compiler warnings, and a release configuration which enables optimizations to reduce the size and increase the speed of the application.
Selecting a Configuration
The currently active configuration is shown in the project explorer's toolbar and can be selected from there. It is also available via
Build → Set Active Build Configuration (Ctrl+Shift+B). In the properties window you can also select from the combobox to which configuration you want to apply properties to without changing the active configuration.
Creating a new Configuration
To create a new build configuration open
Build → Build Configurations... and click on the '+' symbol. Enter a name for the configuration and press Enter.
With Embedded Studio you can set properties for solutions, projects, folders and files to configure the build system and debugging behavior. Property values can be set in the properties window, which is accessible as a docked window via View → Properties Window, which shows the property values for the currently selected file in the project explorer or via right-click on a project, folder or file in the project explorer to show the property values of this element.
Properties can be set for all build configurations with the private configuration "Common" and separately for each build configuration. The properties are grouped by their specific purpose. The properties window allows searching for specific properties. Not all properties might be available for all kind of elements and project types. Properties are inherited from parent elements. A project inherits from the Solution, a folder from the project, a sub-folder from its parent folder and files from folders.