14

Can anyone tell me where to find a list of the "pseudo" environment variables available in RAD Studio? The ones like $(Platform), $(Config), and so on. Specifically, I want one which gives me the RTL version, so that I can put my compiled units (*.dcu) into the correct directory, ie. D15 for XE, D16 for XE2, etc.

I was hoping that there would be one of these which corresponds with the "RTLVersion" compiler conditional definition, but $(RTLVersion) doesn't work.

user977725
  • 141
  • 1
  • 3
  • I think they are just normal environment variables as discussed [here](http://stackoverflow.com/questions/6870282/how-are-delphi-environment-variables-such-as-bds-evaluated). – Ondrej Kelle Oct 04 '11 at 07:00
  • These are environment variables set be IDE itself. "Overrides" are stored in registry. BTW, `RTLVersion` is not conditional symbols, but true constant. Also, i dont see big reasons to organize temporary files. – Premature Optimization Oct 04 '11 at 21:49
  • I'm trying to configure my projects so that they can be built on a build server, without having to add special commands on the build server. The build server may have several different versions of Delphi. It may also have several different code libraries, such as Jedi (all in source control). I want the build script to build those libraries as well as my product. But Jedi has different folders for each RTL verion (eg. \lib\D15). So I want to make my project options look in ..\lib\D$(RTLVersion), because then I don't have to change every project file when a new Delphi version is released. – user977725 Oct 04 '11 at 23:19

4 Answers4

11

There is not a RTLVersion variable but you can create easily using the option Enviroment variables

enter image description here

or the windows registry.

For Delphi XE Check this entry

HKEY_CURRENT_USER\Software\Embarcadero\BDS\8.0\Environment Variables 

Then you can create a new variable called RTLVersion

enter image description here

And then from the Delphi IDE you can use like so

enter image description here

RRUZ
  • 134,889
  • 20
  • 356
  • 483
  • In D2007 I have a "Environment variables" page in the options dialog under "Environment options" (all translated from German). Is this gone in DXE? – Uli Gerhardt Oct 04 '11 at 07:53
  • @UlrichGerhardt, the `Environment variables` page still exists, I updated my answer. – RRUZ Oct 04 '11 at 08:01
4

Have you tried $(ProductVersion)? this will not give you D16, but contains the BDS product version 9.0 for XE2.

Unfortunately my XE2 Demo version is expired so I can't verify myself if it works. You'll find the definition bin\CodeGear.Common.Targets

Update: The ProductVersion define is new in XE2, so it won't work in older versions, but since its newly added, the possibility is high that it will be maintained by embarcadero in future versions.

Tobias R
  • 928
  • 8
  • 22
2

There is no environment variable for the RTL version. You will have to create a separate project for each version and then tweak the output folders as needed.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
0

I use $(ProductVersion). But I attempt to create this in older then delphi 7 because delphi 7 and older do not have $(ProductVersion) previously defined.

Red
  • 26,798
  • 7
  • 36
  • 58