[Lazarus] Search paths per platform
Mattias Gaertner
nc-gaertnma at netcologne.de
Fri Sep 9 22:58:24 CEST 2011
On Fri, 09 Sep 2011 20:22:55 +0000
Mark Morgan Lloyd <markMLl.lazarus at telemetry.co.uk> wrote:
> Mattias Gaertner wrote:
>
> > 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';
>
> I wonder if I could ask a silly question. I think a lot of us probably
> have personal conventions as to how we lay out directories etc., for
> example I copy the FPC sources into /usr/local/lib/fpc/x.x.x/fpcsrc.
That was one of the reasons, why the Lazarus packages were created.
The package maintainer can define the directory layout of his package,
and the user can freely put the package anywhere on the file system.
The above static connection between a project and the synapse sources
is unnecessary with Lazarus. The '../../synapse' and the '../synapse'
can be computed by Lazarus automatically. Just open the laz_synapse.lpk
in the IDE and click 'Use / Add to project'. The above paths are
automatically computed. No need to use conditionals, macros or edit
search paths.
Copy the project and synapse to another computer and/or OS. Again: No
need to adapt the search paths. Just open the laz_synapse.lpk and the
project once.
Same for the FPC sources.
The compiler needs search paths. The IDE creates them for you.
> Do any of the configuration files implement a backtick or similar, so
> that an external script or program in some suitable language can deduce
> parameters based on local conventions?
Well, you could define environment variables and use them in fpc.cfg and
Lazarus. But these are mostly for linker paths and options or for
instantfpc.
Mattias
More information about the Lazarus
mailing list