<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<br>
<div class="moz-cite-prefix">25.03.2014 11:53, Xiangrong Fang пишет:<br>
</div>
<blockquote
cite="mid:CAP93jB0RGxmDBZfRDUCPxjx-A0MNv69+XmDow2FpF6ZBFToTDQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_default" style="font-family:'courier
new',monospace">Hi All,</div>
<div class="gmail_default" style="font-family:'courier
new',monospace"><br>
</div>
<div class="gmail_default" style="font-family:'courier
new',monospace">
Is it possible for lazarus to use "shared project
configurations"? The scenario is:</div>
<div class="gmail_default" style="font-family:'courier
new',monospace"><br>
</div>
<div class="gmail_default" style="font-family:'courier
new',monospace">
1. I have a project layout as below:</div>
<div class="gmail_default" style="font-family:'courier
new',monospace"><br>
</div>
<div class="gmail_default" style="font-family:'courier
new',monospace"><root></div>
<div class="gmail_default" style="font-family:'courier
new',monospace"> <src></div>
<div class="gmail_default" style="font-family:'courier
new',monospace"> <units></div>
<div class="gmail_default" style="font-family:'courier
new',monospace">
<demos></div>
<div class="gmail_default" style="font-family:'courier
new',monospace"> <bin></div>
<div class="gmail_default" style="font-family:'courier
new',monospace"> <doc></div>
<div class="gmail_default" style="font-family:'courier
new',monospace">
<br>
</div>
<div class="gmail_default" style="font-family:'courier
new',monospace">The core units I am writing will be put into
<root>/<src>/<units>, while <demos>
sub-dir will contain demo project I use to test/debug the
units.</div>
<div class="gmail_default" style="font-family:'courier
new',monospace"><br>
</div>
<div class="gmail_default" style="font-family:'courier
new',monospace">At present, I will have to configure any new
project to let it look for units under
<root>/<src>/<units>.</div>
<div class="gmail_default" style="font-family:'courier
new',monospace"><br>
</div>
<div class="gmail_default" style="font-family:'courier
new',monospace">It will be useful to have a "project group
configuration", such as "projects.prg", which can be opened by
lazarus to create a shared configuration, and from that lazrus
session, all new project I create will by default "inherit"
environment settings in the "project group" file (which can be
customized individually, of course).</div>
<div class="gmail_default" style="font-family:'courier
new',monospace"><br>
</div>
<div class="gmail_default" style="font-family:'courier
new',monospace">Another important reason to have such file is
that I want to add it to version control system.</div>
<div class="gmail_default" style="font-family:'courier
new',monospace"><br>
</div>
<div class="gmail_default" style="font-family:'courier
new',monospace">Is that possible?</div>
<div class="gmail_default" style="font-family:'courier
new',monospace">
<br>
</div>
<div class="gmail_default" style="font-family:'courier
new',monospace">Xiangrong</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">--
_______________________________________________
Lazarus mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Lazarus@lists.lazarus.freepascal.org">Lazarus@lists.lazarus.freepascal.org</a>
<a class="moz-txt-link-freetext" href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a>
</pre>
</blockquote>
<br>
To get something like shared project configuration one could utilize
FreePascal config files.
<a class="moz-txt-link-freetext" href="http://www.freepascal.org/docs-html/user/usersu10.html">http://www.freepascal.org/docs-html/user/usersu10.html</a><br>
Then specify same fpc config file for every project. FPC config
files have include directive, so they are flexible to some degree<br>
This way one could have multiple projects refer to a single FPC
config file, then change search path for all projects altogether.<br>
Assume one has two versions of library, then creates two FPC config
files:<br>
<br>
lib_v1.fpc:<br>
#Define lib_v1<br>
-FU../lib_v1/src<br>
-FU../lib_v1/src/additional<br>
<br>
lib_v2.fpc<br>
#Define lib_v2<br>
-FU../lib_v2/src<br>
-FU../lib_v2/src/additional<br>
<br>
Then specify fpc config file for multiple projects with content of
the config file looking something like:<br>
#Include ../lib_v1.fpc<br>
<br>
Then one would be able to change compiler settings for both projects
by changing settings in fpc config file. For example switch from
library v1 to library v2:<br>
#Include ../lib_v2.fpc<br>
<br>
lawl. I hope you got the idea. <br>
I think this is currently the best approach for multiple Lazarus
projects sharing common configuration.<br>
Alternatively one could possibly use Lazarus packages for this task.<br>
The only question which bothers me concerning fpc-config-file
approach is the following: whether Lazarus editor code completion
will work in this case or not? Will Lazarus search for sources
specified in FPC config files? Something tells me that yes, it will,
since it should be dealing with standard fpc config file somehow
(the one which is in the same directory where compiler executable
is)<br>
Hope this helps<br>
<br>
</body>
</html>