User forums > Help

using project variables in project files

(1/2) > >>

JeDi:
Hi,

Is using the internal variables ($(PROJECT_NAME), ...) supported in the .cdp files? I tried creating a user template, and wanted to use for example <Unit filename="../../src/$(PROJECT_NAME)/global.h">, but that gave me an error, the variable doesn't seem to be replaced while loading the project.

Any thoughts?

Greetz,
JeDi

thomas:
That is correct, the project loader does not replace variables, and for the sake of performance, I think it shouldn't, either. Variable replacement is something that takes a non-trivial amount of CPU-time.
It is very well possible to build templates without using variables in units, so there is no urgent need for this, either.

Those variables are thought to give you some flexibility during the build process, not to define the layout of a new project. If you want to make the layout customisable, use a template script (this is supported). That will evaluate once, not at every startup, which is better.

JeDi:
So you're saying that the variables do work in the other parts of the project (include dirs, output dirs, ...)? Cause I don't need it in the units, that was just to test it. And you say template scripts are supported? So I can create a script that creates a dir, put some source files in it, replace some stuff in the source files? That would be very cool (and a lot better than visual studio).

Do you have any special links for this feature? Or should I just search a tutorial on AngelScript?

Thanks!
Greetz,
JeDi

Michael:

--- Quote from: JeDi on April 10, 2006, 12:47:19 pm ---Do you have any special links for this feature? Or should I just search a tutorial on AngelScript?

--- End quote ---

Hello,

Did you try to search in the forum? There should be something useful :).

Best wishes,
Michael

thomas:

--- Quote from: JeDi on April 10, 2006, 12:47:19 pm ---So you're saying...
--- End quote ---
Yes, yes, and yes.

Navigation

[0] Message Index

[#] Next page

Go to full version