Portable Projects
From DSignT Support Database
1 Problem
CCS4 projects store absolute paths. Moving a project to a different directory or another computer is not possible.
2 Solution
This example assumes the following directory structure:
CCS_projects | +--- dmodule (D.Module specific headers and linker command files) | +--- common (libs, headers, etc) | +--- utils | +--- myprojects | | | +--- current_project (source files)
- create a file macros.ini in the project directory (current_project in the above example). This file must contain an entry EXT_ROOT__current_project = ../../
EXT_ROOT__current_project now points to the project base directory (CCS_projects in the above example). To give highest compatibility even for later CCS releases, this macro should always start with a leading EXT_ROOT__ and end with the trailing project name.
- make sure all source files include header files with a relative path, or add the include path in the project settings:
#include "../../dmodule/dm2c6747.h"
or, if the base directory CCS_projects is added to the project include options:
#include <dmodule/dm2c6747.h>
- edit the .project file in the project directory (current_project in the above example) and replace the absolute paths with the EXT_ROOT__current_project macro. Replace the <location> tag
<linkedResources> <link> <name>dm2c6747.cmd</name> <type>1</type> <location>d:/work/ccs_projects/dmodule/dm2c6747.cmd</location> </link> </linkedResources>
with
<location>EXT_ROOT__current_project/dmodule/dm2c6747.cmd</location>
- Use ${EXT_ROOT__current_project} in the Build Properties to add include paths and/or call programs for post-build steps:
Build Properties - Tool Settings - C6000 Compiler - Include Options = ${EXT_ROOT__current_project} ${EXT_ROOT__current_project}/utils/makehex ${BuildArtifactFileBaseName}
3 Additional Tags
http://www.dsignt.de/support/doc/portable_ccs_projects/html/index.html