[Lazarus] Check if a package is available through macros

luiz americo pereira camara luizmed at oi.com.br
Sun Jul 5 16:03:22 CEST 2015


I'd like to check if a package is installed to add conditional defines.

Following the wiki instructions, i added this script in Compiler Options/
Other / Conditionals of a package

  PackageName := GetIDEValue('$PkgName(''LCL'')');
  if Defined(PackageName) then begin
    CustomOptions := '"' + PackageName + '"';
  end;

There's no dedicated macro to check if a package is installed so i tried to
use $PkgName macro.

Unfortunately, the PackageName is always empty

Is this the correct way to call the $PkgName macro?

Any hints?

Refs:
http://wiki.lazarus.freepascal.org/Macros_and_Conditionals
http://wiki.lazarus.freepascal.org/IDE_Macros_in_paths_and_filenames

Luiz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20150705/ae636785/attachment-0002.html>


More information about the Lazarus mailing list