Variable substitution in Project.meta
Substituted variables
Variable | Example |
$(MainConfigName) | Debug |
$(MainProjectName) | bootloader |
$(ConfigName) | lib |
$(ProjectName) | canDriver |
$(ProjectDir) | C:/Root/MyProject |
$(OutputDir) | Debug_bootloader |
$(ArtifactName) | bootloader_1.0.elf |
$(ArtifactNameBase) | bootloader_1.0 |
$(Time) | 2012-12-24 20:00:00 +0200 |
$(Hostname) | MY_COMPUTER |
Variable | Windows | Other |
$(/) | \ | / |
Expression | Description |
IncludeDir "$(Roots)" | Will be replaced by one or more IncludeDir statements for all workspace roots. |
Otherwise:
Variable | Example |
$(environment variable) | whatever |
If the environment variable does not exist, it will be substituted by an empty string.
Equal variables
In main project
Variable | is equal to |
$(MainConfigName) | $(ConfigName) |
$(MainProjectName) | $(ProjectName) |
$(OutputDir) | $(MainConfigName) |
In subproject
Variable | is equal to |
$(OutputDir) | $(MainConfigName)_$(MainProjectName) |
Auto-adjustment of paths to existing projects
If paths to other projects are needed, e.g. to "bootloaderUpdater", don't write a hard coded relative path like this:
CommandLine "../bootloaderUpdater/tools/PrimaryBootloader2Include.exe
bootloaderUpdater might be checked out into a different workspace root. If you write
CommandLine "bootloaderUpdater/tools/PrimaryBootloader2Include.exe
bake recognizes that the first part of the path is a valid project name and calculates the relative path to the project automatically.
Special case:
If you have a directory in the current project, which has the same name as a valid project and you need to reference the directory, write
IncludeDir "myProjectName/bootloaderUpdater/whatever"
which will then adjusted to
-I"bootloaderUpdater/whatever"
instead of
-I"../bootloaderUpdater/whatever" (depending of the location of the project bootloaderUpdater).
Supported elements for auto-adjustment:
- IncludeDir
- ExternalLibrary
- ExternalLibrarySearchPath
- UserLibrary
- CommandLine
Examples
CommandLine "ddump -Ruv -y 0xFFFFF -o$(OutputDir)/$(ArtifactNameBase).bin $(OutputDir)/$(ArtifactName)"
ExternalLibrarySearchPath "$(PATH_TO_CYGWIN)/usr/local/lib"
IncludeDir "bspDma/include"