[Lazarus] Environment variables in IDE's search path

Graeme Geldenhuys graemeg.lists at gmail.com
Sat May 16 09:41:41 CEST 2009

2009/5/16 Bogusław Brandys <brandys at o2.pl>:
> But then the question arise : if I create one nice package for a suite of
> components, but user will use only one component from suite in his
> application , does it mean then his project will depend on *ALL* components
> of suite ?

If you only have on large packages, then your project will depend on
that package. Smartlinking and disabling "Package Options > Usage >
Add package unit to uses clause" should prevent all those units from
being linked into your final executable.

I you want a project that say only depends on one component in that
large package, then why not split each component into its own package.

For example:

  Large3rdParty Package
     - Component1 package
     - Component2 package
     - Component3 package

So now you have 4 packages. If your project uses all the components,
then simply add "Large3rdParty Package" as a requirement to your
project. If your project only uses "Component1", then only include
"Component1 Package" as a project requirement.

I do this package hierarchy often in my projects. And the nice thing
is you only need to include the last package in the hierarchy that
fulfills your component requirements. I for example have the

  tiOPF.lpk             fpgui_toolkit.lpk
     |                         |

So if I create application that require FCL, tiOPF and fpGUI Toolkit,
I only include the tiOPFfpGUI.lpk package in my project.  If I need a
console based application that talks one of your databases via tiOPF
objects, then I only need to include tiOPF.lpk package in that

Lazarus Packages are very flexible and a real bonus to Lazarus! Also
if any of those components have changed, I can simply recompile my
project and any out-dated packages will be compiled if needed before
the project is compiled.

  - Graeme -

fpGUI - a cross-platform Free Pascal GUI toolkit

More information about the Lazarus mailing list