Re: [Lazarus] Shared project configuration

2014-03-25 Thread Graeme Geldenhuys
On 2014-03-25 09:26, Xiangrong Fang wrote:
> What I want is not like this, but just to configure related projects to
> use common units and output there executables in common directory.

MSEide does that pretty nicely, and you can export and import settings
to and from projects, or setup template projects. But all is not lost
when using Lazarus IDE (I think). I have accomplished what you asked -
with an external compiler config file.

It's simply a text file with the compiler parameters you want. One
parameter setting per line.

You could then add that config file in the Project Options dialog. Not
ideal, but it worked. But looking at my copy of Lazarus IDE (a couple
months old), that option doesn't seem to be there any more. :-/


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Shared project configuration

2014-03-25 Thread hinstance


25.03.2014 11:53, Xiangrong Fang ?:

Hi All,

Is it possible for lazarus to use "shared project configurations"? The 
scenario is:


1. I have a project layout as below:


  


  
  

The core units I am writing will be put into //, 
while  sub-dir will contain demo project I use to test/debug 
the units.


At present, I will have to configure any new project to let it look 
for units under //.


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


Another important reason to have such file is that I want to add it to 
version control system.


Is that possible?

Xiangrong


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


To get something like shared project configuration one could utilize 
FreePascal config files. 
http://www.freepascal.org/docs-html/user/usersu10.html
Then specify same fpc config file for every project. FPC config files 
have include directive, so they are flexible to some degree
This way one could have multiple projects refer to a single FPC config 
file, then change search path for all projects altogether.

Assume one has two versions of library, then creates two FPC config files:

lib_v1.fpc:
#Define lib_v1
-FU../lib_v1/src
-FU../lib_v1/src/additional

lib_v2.fpc
#Define lib_v2
-FU../lib_v2/src
-FU../lib_v2/src/additional

Then specify fpc config file for multiple projects with content of the 
config file looking something like:

#Include ../lib_v1.fpc

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:

#Include ../lib_v2.fpc

lawl. I hope you got the idea.
I think this is currently the best approach for multiple Lazarus 
projects sharing common configuration.

Alternatively one could possibly use Lazarus packages for this task.
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)

Hope this helps

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Shared project configuration

2014-03-25 Thread Mattias Gaertner
On Tue, 25 Mar 2014 17:26:27 +0800
Xiangrong Fang  wrote:

> Hi Mattias,
> 
> If I understood correctly, this method is binding the template to your IDE,
> not your project.

Yes, you asked for "all new project I create".

 
> In another word, if I create a project and add such a project.ini file in
> the project, push it to github. You pull this project, and before you can
> use the templetate, you must install my template "separately" (not by just
> open the project.ini via lazarus), AND, after install the template you can
> use the template OUTSIDE of the project context.  i.e. the template become
> somewhat "standard", e.g. "Lazarus Project for Android" might be a custom
> template?

No.
All the methods I gave were helpers for creating new projects. They
create regular projects.
For example you set the output directory of a project 'T1' to
'output/$(TargetOS)'. Then you set "use as default" and click ok.
The next time you create a project, say 'T2', the new project will use
this output directory. The IDE just copied the value. When you now
change project T1 it has no effect on project T2 or any new project
you create.
People on github can open your project without your template and
the addons.

 
> What I want is not like this, but just to configure related projects to use
> common units and output there executables in common directory.

If you want to share units, then you should put them into a
Lazarus package. Especially if you want to share them with other people.


Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Shared project configuration

2014-03-25 Thread Xiangrong Fang
Hi Mattias,

If I understood correctly, this method is binding the template to your IDE,
not your project.

In another word, if I create a project and add such a project.ini file in
the project, push it to github. You pull this project, and before you can
use the templetate, you must install my template "separately" (not by just
open the project.ini via lazarus), AND, after install the template you can
use the template OUTSIDE of the project context.  i.e. the template become
somewhat "standard", e.g. "Lazarus Project for Android" might be a custom
template?

What I want is not like this, but just to configure related projects to use
common units and output there executables in common directory.

Thanks,
Xiangrong





2014-03-25 17:11 GMT+08:00 Mattias Gaertner :

> On Tue, 25 Mar 2014 15:53:37 +0800
> Xiangrong Fang  wrote:
>
> > Hi All,
> >
> > Is it possible for lazarus to use "shared project configurations"? The
> > scenario is:
> >
> > 1. I have a project layout as below:
> >
> > 
> >   
> > 
> > 
> >   
> >   
> >
> > The core units I am writing will be put into //, while
> >  sub-dir will contain demo project I use to test/debug the units.
> >
> > At present, I will have to configure any new project to let it look for
> > units under //.
> >
> > 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).
> >
> > Another important reason to have such file is that I want to add it to
> > version control system.
> >
> > Is that possible?
>
> Yes.
> You can save the project options (including compiler options,
> excluding files) as a default:
>
> http://wiki.lazarus.freepascal.org/IDE_Window:_Project_Options#Use_these_settings_as_default_for_new_projects
>
> And you can create new project templates with files:
> http://wiki.lazarus.freepascal.org/Project_Templates
>
> And finally you can write an IDE addon to register project types, with
> their own setup dialogs, bells and whistles.
>
> Mattias
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Shared project configuration

2014-03-25 Thread Mattias Gaertner
On Tue, 25 Mar 2014 15:53:37 +0800
Xiangrong Fang  wrote:

> Hi All,
> 
> Is it possible for lazarus to use "shared project configurations"? The
> scenario is:
> 
> 1. I have a project layout as below:
> 
> 
>   
> 
> 
>   
>   
> 
> The core units I am writing will be put into //, while
>  sub-dir will contain demo project I use to test/debug the units.
> 
> At present, I will have to configure any new project to let it look for
> units under //.
> 
> 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).
> 
> Another important reason to have such file is that I want to add it to
> version control system.
> 
> Is that possible?

Yes.
You can save the project options (including compiler options,
excluding files) as a default:
http://wiki.lazarus.freepascal.org/IDE_Window:_Project_Options#Use_these_settings_as_default_for_new_projects

And you can create new project templates with files:
http://wiki.lazarus.freepascal.org/Project_Templates

And finally you can write an IDE addon to register project types, with
their own setup dialogs, bells and whistles.

Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Shared project configuration

2014-03-25 Thread Xiangrong Fang
Hi All,

Is it possible for lazarus to use "shared project configurations"? The
scenario is:

1. I have a project layout as below:


  


  
  

The core units I am writing will be put into //, while
 sub-dir will contain demo project I use to test/debug the units.

At present, I will have to configure any new project to let it look for
units under //.

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

Another important reason to have such file is that I want to add it to
version control system.

Is that possible?

Xiangrong
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus