Get cake to define a CAKE_PROJECT_VERSION macro at build time.  cake determines the actual project version by running the PROJECT_VERSION_CMD which can be something as simple as "echo myproj-888.888.888-1" to a complicated git command.