[Lazarus] embed git version info

Graeme Geldenhuys graeme at geldenhuys.co.uk
Thu Mar 28 16:04:50 CET 2013


On 2013-03-28 11:52, Xiangrong Fang wrote:
>>
>> What about the following...
>>>
>>>   const
>>>     cGitRevision = '''' + {$revision.inc} + '''';
>>>
>> That should work :)
>>
> 
> That does not work.


Indeed, I just tested it (which I didn't before). Anyway, ignore my
"spoon feeding" comment....email humour fails 99.9% of the times.

Whatever you choose to use... scripts, InstantFPC, console app etc, just
make sure that the include file contains the full declaration of a
constant, or a string in quotes. I tested the attached program, and it
works 100%.

I now consider your question answered.


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

-------------- next part --------------
program test;

{$mode objfpc}{$H+}

const
  cGitRevision = {$i revision.inc};

begin
  Writeln(cGitRevision);
end.
-------------- next part --------------
'v1.0-123'


More information about the Lazarus mailing list