Author Topic: using project variables in project files  (Read 4681 times)

JeDi

  • Guest
using project variables in project files
« on: April 09, 2006, 05:24:30 pm »
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

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: using project variables in project files
« Reply #1 on: April 09, 2006, 06:37:31 pm »
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.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

JeDi

  • Guest
Re: using project variables in project files
« Reply #2 on: April 10, 2006, 12:47:19 pm »
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

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: using project variables in project files
« Reply #3 on: April 10, 2006, 12:51:42 pm »
Do you have any special links for this feature? Or should I just search a tutorial on AngelScript?

Hello,

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

Best wishes,
Michael

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: using project variables in project files
« Reply #4 on: April 10, 2006, 02:36:53 pm »
So you're saying...
Yes, yes, and yes.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

JeDi

  • Guest
Re: using project variables in project files
« Reply #5 on: April 10, 2006, 03:47:53 pm »
In the few days I'm trying Code::Blocks, I'm starting to like it very much :-)

For the template scripts, I can't really find that much information. I looked into some of the .template files provided with codeblocks, but it doesn't seem I can do the things I want with it. However, I read somewhere that you guys were working on a wizard-system. How is that going? Can I find some more technical information about it somewhere?

Greetz,
JeDi