[Lazarus] Lazbuild search path

Leonardo M. Ramé l.rame at griensu.com
Fri Feb 17 21:51:22 CET 2012


On 2012-02-17 21:39:59 +0100, Mattias Gaertner wrote:
> 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.

Ah!, I didn't thought about that. Looks good.

For example, I use Synapse library. I could create an .lpk package only
in my build system then I can compile my programs as you mentioned.

> 
>  
> > 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

-- 
Leonardo M. Ramé
http://leonardorame.blogspot.com




More information about the Lazarus mailing list