Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-02

Lazbuild search path

5 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Leonardo M. Ramé

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?

Thanks in advance,

Reply by email

Mattias Gaertner
to Leonardo M. Ramé
Show quoted text 6 lines
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.

Mattias

Reply by email

Leonardo M. Ramé
to Mattias Gaertner
Mattias Gaertner wrote 24 lines
On Fri, 17 Feb 2012 15:29:45 -0300 Leonardo M. Ram? 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.

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

Reply by email

Mattias Gaertner
to Leonardo M. Ramé
Show quoted text 28 lines
On 2012-02-17 19:57:47 +0100, Mattias Gaertner wrote: > On Fri, 17 Feb 2012 15:29:45 -0300 > Leonardo M. Ram? 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

Reply by email

Leonardo M. Ramé
to Mattias Gaertner
Mattias Gaertner wrote 40 lines
On Fri, 17 Feb 2012 17:28:13 -0300 Leonardo M. Ram? wrote: > On 2012-02-17 19:57:47 +0100, Mattias Gaertner wrote: > > On Fri, 17 Feb 2012 15:29:45 -0300 > > Leonardo M. Ram? 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.

Show quoted text 8 lines
> 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

Reply by email