[Lazarus] Lazbuild search path

Mattias Gaertner nc-gaertnma at netcologne.de
Fri Feb 17 21:39:59 CET 2012


On Fri, 17 Feb 2012 17:28:13 -0300
Leonardo M. Ramé <l.rame at griensu.com> wrote:

> On 2012-02-17 19:57:47 +0100, Mattias Gaertner wrote:
> > On Fri, 17 Feb 2012 15:29:45 -0300
> > Leonardo M. Ramé <l.rame at griensu.com> wrote:
> > 
> > > Hi, I'm trying to use Lazbuild from a cron job in a server to create
> > > nightly builds. Our projects are developed on machines with different
> > > paths for libraries, and I would like to know how to force Lazbuild to
> > > ignore the search-path specified in the .lpi file, and use a new one.
> > > 
> > > How can I do that?
> > 
> > Why does you lpi contain wrong search paths?
> > 
> > Make the search paths relative. 
> > 
> > Put the platform specific parts into packages.
> > 
> > Use macros.
> > http://wiki.lazarus.freepascal.org/IDE_Macros_in_paths_and_filenames
> > 
> > Use environment options and the macro env.
> > 
> > Otherwise:
> > Copy the lpi and change the search paths there.
> > 
> 
> Thanks Mattias, the lpi contains correct search path for the develpment
> PC, but the library directories are organized differently on the build machine.

Normally you organize libraries in lazarus packages. It's not hard. Just
create a package, add the files and add the package to the project.

Then you can simply do

lazbuild /path/to/package.lpk /path/to/project.lpi

I hardly set search paths anymore. The IDE does that for me.

 
> Is there a way to pass a Macro as an Lazbuild parameter?.

Add to the project compiler options search path ;$ENV(MYPATH).

Then you can do in bash:
MYPATH=/your/path lazbuild some.lpi


Mattias




More information about the Lazarus mailing list