[Lazarus] Search paths per platform

Leonardo M. Ramé l.rame at griensu.com
Fri Sep 9 20:21:25 CEST 2011


On 2011-09-09 20:09:03 +0200, Mattias Gaertner wrote:
> On Fri, 9 Sep 2011 14:16:27 -0300
> Leonardo M. Ramé <l.rame at griensu.com> wrote:
> 
> > Hi, is there a way to setup unit search paths per platform?.
> > 
> > I usually develp for Linux and Windows, and some times, I use units that
> > can't be accessed using the same relative paths on both platforms.
> > 
> > For example, on Linux I use:
> > 
> > ../synapse
> > 
> > To let the compiler find units from Synapse library.
> 
> Have you tried the Lazarus package 'laz_synapse.lpk' of Synapse?

Synapse was just an example, I use many other libraries in different
directories.

> > On Windows, the synapse directory is installed on ../../synapse, for
> > example.
> > 
> > I would be nice to have conditionals or build modes for each platform.
> 
> You can do that with the Lazarus trunk version.
> 
> http://wiki.lazarus.freepascal.org/Macros_and_Conditionals#Conditionals
> 
> For example:
> 
> if TargetOS='win32' then
>   UnitPath := '../../synapse'
> else
>   UnitPath := '../synapse';
> 
> 
> Mattias

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




More information about the Lazarus mailing list