Forum > General

Is there any macro giving current version number

(1/2) > >>

Hi all,

I wonder if there is a macro able to get the current version/build number of a project, like $(ProjOutDir), $(TargetCPU), $(TargetOS) and so o.
I've searched in wiki without success.

If yes, is there anyway to use this kind of macro in code. The goal is to write a function able to return the current version of the binary, that is something like that:

--- Code: ---function Ver: String;
    result := $(ProjVer);

--- End code ---

My project is under Mac OS X, and unix binaries can not include executable version as  Windows binaries.

Any idea ?



--- Quote from: sinfoni on July 08, 2010, 04:28:56 pm ---Any idea ?

--- End quote ---

You can create such macro or const definition inside your project.
One way to make your program to show that info is to use a command line parameter. For example:

--- Code: ---MyProg --version

--- End code ---

and then the program would only output the version info to STDOUT and nothing else.


Yes, of course, but I would to use the Lazarus incremental version functionnality: Each time you build the project, the build version is automatically incremented. If I use constants (That's the way I do it now), I have to manually set these constants...

Can I create my own macro ?

I think in theory you can enable Version Info (Project Options/Version Info).
But when I try this myself (XP, 0.9.29 build 26516) I get a spurious error message.
This has never worked out-of-the-box in any recent version as far as I know.

Yes, Version Info is Enable. But Mac OS X is Unix based, and Unix binaries can not include version info. So... I tried to put version info using my own function which use Lazarus version Info. So, how access to Lazarus Version Info ? That's the question. 


[0] Message Index

[#] Next page

Go to full version